add rational fits#223
Conversation
|
This PR is quite long, so I want to highlight the main changes
Other changes including the tests are straightforward. I Had to change a few things to make the tests pass because we have changed the default to |
|
Hi @vijayvarma392, this PR is now ready to be reviewed. I have summarized the main changes here. I think at this point, I would like to have your comments for making further changes. |
| A dictionary of kwargs for `omega_gw_extrema_interpolation_method`. | ||
| Currently, the available `omega_gw_extrema_interpolation_method` and | ||
| the corresponding defaults for `special_interp_kwargs_for_omega_gw_extrema` | ||
| are: |
There was a problem hiding this comment.
Maybe this can be clearer:
"Currently, the available omega_gw_extrema_interpolation_method and the corresponding defaults for special_interp_kwargs_for_omega_gw_extrema are" -->
The defaults are set according to the value of `omega_gw_extrema_interpolation_method`:"
- if omega_gw_extrema_interpolation_method is "spline", default kwargs are set using `utils.get_default_spline_kwargs`
- if omega_gw_extrema_interpolation_method is "rational_fit", ...
| f"is {kwargs['extrap_order']}."} | ||
| if any([kwargs["include_zero_ecc"], kwargs["include_params_dict"], | ||
| not kwargs["keep_memory"]]): | ||
| not kwargs.get("keep_memory", True)]): |
There was a problem hiding this comment.
Hmm, are we keeping memory by default? Maybe better to do the opposite?
There was a problem hiding this comment.
No, the default value is False. So by default not kwargs.get("keep_memory", True)]) will be True and therefore one requires to give path to metadata. The default value (the secoond arg True) to kwargs.get() is to ensure that if someone is loading old format sxs waveform where "keep_memory" is not a kwarg, not kwargs.get() will evaluate to False, meaning no requirement to provide metadata file.
Add
rational_fitas an alternative method to interpolate the omega at the extrema.This PR introduces a new option in
extra_kwargsforomega_gw_extrema_interpolation_methodwhich defaults to the spline-based interpolation.omega_gw_extrema_interpolation_methodcan be set to either of the following values:InterpolatedUnivariateSplinewithk=3(as default).polyrat.StabilizedSKRationalApproximationrational_fitimproves the fit to theomega_gwat pericenter and apocenters, particularly near the merger wheresplinestruggles to remain monotonic.