-
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 include_gps and include_bipm out of Observatory objects #1763
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1763 +/- ##
==========================================
- Coverage 69.43% 69.27% -0.16%
==========================================
Files 107 106 -1
Lines 24925 24866 -59
Branches 4430 4429 -1
==========================================
- Hits 17306 17227 -79
- Misses 6510 6525 +15
- Partials 1109 1114 +5 ☔ View full report in Codecov by Sentry. |
Fixes #1766 |
Also made a fix to the |
How does this interact with #1747? Are clock GPS and BIPM corrections disabled when "CLOCK UNCORR" is given in the par file? |
Will most users know how/whether to do that? Should the various wrappers to load spacecraft TOAs have that set explicitly now? |
Should be no problem. #1747 has been merged so is included in this PR. The difference is that the |
Hmm. Most people will hopefully use |
If we remove the defaults that would make it more explicit that users need to set this. Maybe that is a good plan. But need to make sure the upstream uses like |
The problem with removing the defaults is that everyone who has code that calls I also looked at what happens when you call So really BIPM is associated with the model and it makes sense to me that either its setting should be inherited from the model, or it should force the user to specify it explicitly. On the other hand, I'm now re-thinking the GPS correction. That really is a function of the observatory clock. If the observatory clock corrections put you on UTC(GPS), as is the most common case, then you do want to apply the UTC(GPS) to UTC corrections. Since this is site dependent, probably I should not have taken it out of the Observatory class. The difference is that you should NOT use different settings for BIPM between different sites if you have multi-observatory datasets, but you SHOULD use different settings for GPS for each observatory if some use GPS clocks and some don't. Do people agree that I should revert my changes to |
In thinking about I'd like to hear opinions but I don't think we need to make it so easy to turn off the gps2utc corrections in normal code. That setting should be part of observatories.json and that's basically it. Thoughts? |
Ok, question to consider. How easy should it be to not apply the UTC(GPS)->UTC corrections? Or, if you want to be able to do it programmatically, what is acceptable? It is very painful to make sure that every call to |
Ah, the deepcopy was added in #1711. I am going to revert that behavior in this PR. |
Thanks for all the comments! I have pushed updates to all of them. Hopefully it is good to go now, assuming all test pass. |
This is ready to merge. @dlakaplan or @scottransom do you want to give it a look and merge? I addressed @abhisrkckl's comments. |
I'll merge this if it is ready to go. |
It would be great to merge soon. I just had to fix several conflicts caused by adding type hints. |
Are you going to push more commits? If not, I'll merge this once the tests pass. |
I'm done. Please do merge when tests pass. |
This is an attempt to clean up handling of
include_gps
andinclude_bipm
Rather than having those as attributes of an
Observatory
object, they are passed as arguments to thesite.clock_correction()
method. So instead of this:the flow now looks like this:
This has no effect on most users, since
get_TOAs()
still accepts the same arguments, it just passesinclude_bipm
to the clock correction method rather than the observatory constructor.In addition, the
include_gps
andinclude_bipm
arguments now are interpreted as the user wanting UTC times to get the UTC->GPS correction added and TT times to get the TT(BIPM) corrections included. Even if they are True, those corrections will NOT get applied to a time that is already in TDB. This behavior should fix #1691.The one significant thing on the user side that I've seen so far is that a bunch of observatories (mainly TeV and GW) in observatories.json had
include_bipm=False
included in their definition (making it their default). This is now lost. I argue this is a good thing since whether or not BIPM corrections are included is not really a feature of the observatory. So, users will now have to specifyinclude_bipm=False
if that is the behavior they want when loading TOAs from those observatories.