-
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
Test cleanup and simplify special_locations #1305
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1305 +/- ##
==========================================
+ Coverage 62.00% 62.22% +0.22%
==========================================
Files 89 89
Lines 20273 20215 -58
Branches 3658 3650 -8
==========================================
+ Hits 12570 12579 +9
+ Misses 6918 6849 -69
- Partials 785 787 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. |
Nice to see all this cleanup! |
The newly added FIXMEs are waiting on #1287 and the plumbing that comes with it (so you can temporarily create an observatory without polluting the registry of observatories) |
This revealed a problem with SpecialLocations.
Outcome of PINT meeting discussion:
|
There is an additional layer of confusion. PINT Observatory objects have a The problem is that TopoObs by default report "utc", Barycenter reports "tdb" , Goecenter reports "utc", and T2SpacecraftObs report "utc". This timescale is passed to Astropy for further conversion, including in particular leap second removal for UTC. I think satellite observations should probably be assumed to be in TDB? But things are working now so maybe that is ignored? |
For NICER, non-barycentered photon event files have times natively in TT. Here are the relevant header keywords in the FITS file:
Now,
So, TOAs from spacecraft just come in as TT times and should never go through a UTC to TT conversion. |
Oh, I should add that we only use |
One other note is that our |
Aha, thanks! I haven't touched PINT allows for the possibility that special locations specified in .tim files could be in other timescales; or with a bit of coding, topocentric observatories that gave us non-UTC time scales could be accommodated. But I think that the The corrections applied by I think that prior to my interference, |
I think I can say more: If you give your satellite observatory a reasonable name, you should be able to write out your TOAs to a tim file, and then as long as the satellite observatory was available with the same name, anyone could read in your .tim files and they would be interpreted correctly. At least in tempo2 format, there's some weirdness in Princeton format I've been hesitant to touch, but tempo2 format at least tries to construct the Time object with the observatory's There might be some weirdness with the GPS/BIPM clock corrections as TOAs objects are supposed to apply those when reading in and record their values so they can be removed when writing back out. If you make your TOAs object in a slightly unusual way they might not ever get applied. |
I believe that this PR does not change how any special locations behave, compared to the pre-global-clock-corrections code. |
I concur that I think things are OK for satellites. I checked out the branch and ran some tests with local data, everything was exactly the same. After chatting with Paul, we have an idea to improve test_fermiphase.py (and some others could also benefit!) that would have failed if anything deleterious had happened with this PR. |
I removed the awaiting review label. This can be merged once the conflicts are resolved and the tests pass. |
This PR is meant to remove most of the places where tests are skipped because $TEMPO2 is not (or is) set. For the most part, these were because they depended on clock files in TEMPO2 but not in PINT; this is no longer a concern. There are a few other situations where this sort of thing comes up, but the PINT test suite does not run tempo2 even if it is available - where direct comparisons are made, they are to saved tempo2 output. (It is not always evident how this output can be regenerated.)
This PR also clears up some anomalies in how missing clock files were handled, including some changes to SpecialLocations. This fixes some problems/inconsistencies revealed in the work on #1287. More importantly it returns all SpecialLocations to how they behaved before the global clock corrections were merged (that had disabled GPS and BIPM corrections). Just to be clear: the global clock corrections broke (inadvertently changed) how we handled SpecialLocations, and this PR fixes that.
This PR also cleans up a number (all?) of our tests that are marked
xfail
but actually pass. Mostly this is the results of bug fixes and other improvements resolving what used to be problems, so the tests should now alert us to regressions.Closes #1304