-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moved get_derived_params
to timing_model
#1692
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1692 +/- ##
==========================================
+ Coverage 68.41% 68.50% +0.09%
==========================================
Files 104 104
Lines 24339 24345 +6
Branches 4346 4342 -4
==========================================
+ Hits 16651 16678 +27
+ Misses 6600 6588 -12
+ Partials 1088 1079 -9 ☔ View full report in Codecov by Sentry. |
get_derived_params
to timing_model
get_derived_params
to timing_model
Example:
|
It is slightly clumsy that the dictionary returns a mix of |
Yeah, maybe a bit clumsy. But looks super useful, though! Thanks for doing this! |
Would it make sense to change the dictionary output to more like:
this would allow for easy serialization that could even be extended to the whole timing model. But it may also be overly complex for this case which is just mean for humans to read. |
This looks good. Shall I merge this? |
Probably. Depends if there is any thought about if/how to change the dict output. But that could also be a separate PR. |
I think that can be done separately. |
OK, then I think you can go ahead and merge if it looks OK. |
Previously
get_derived_params()
was part of aFitter
object. This meant you had to load in a set of TOAs just to compute various quantities. As far as I could tell the only rationale for this was needing the RMS and number of TOAs to check for the ELL1 validity: everything else was only using the timing model parameters.So I moved the function to
timing_model
, and it can accept optional inputs with the RMS and number of TOAs to do the ELL1 check. There is then a stub in theFitter
to maintain the same API.I also simplified the function a bit and made better use of
uncertainties
. Some quantities like period and binary period are only determined once (rather than in multiple places) and almost all calculations use the uncertainties module.It can also optionally output a dictionary of the parameters that it computed.
The
get_derived_params()
function is now tested on all par files in the test directory that are readable. If we add more types (more binary models) then there will be additional tests.