-
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
TCB to TDB conversion #1531
TCB to TDB conversion #1531
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1531 +/- ##
==========================================
+ Coverage 67.61% 67.72% +0.11%
==========================================
Files 95 97 +2
Lines 22791 22849 +58
Branches 3948 3952 +4
==========================================
+ Hits 15409 15474 +65
+ Misses 6411 6401 -10
- Partials 971 974 +3
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Just FYI, I just pulled this and tried it on a TCB par file and it seemed to work. However, the last warning was a little odd because it is not true. The input par file was TCB:
|
I notice that the roundtrip test is failing. |
@abhisrkckl : can you share the log messages like the ones @paulray showed above? It would be good to see what they look like if they have changed at all. |
@dlakaplan I have fixed this. The log messages now look like this:
|
Improved log messages from
|
I have also updated the Explanation page to reflect these changes. |
I'd like to merge this now. Is that fine? |
@paulray Yes. |
This PR provides a TCB to TDB conversion tool (
tcb2tdb
) which works like thetransform
plugin oftempo2
.See issues #1405 and #37 for more details. There has been a lot of discussion in the PINT community about TCB support, and the consensus is to not provide any TCB support internally. i.e., the internal representation of TOAs, frequencies, delays etc will only use the TDB timescale. However, a TCB to TDB conversion feature is useful because there are a lot of TCB par files in the wild and the only tool for this conversion at present is
tempo2 -gr transform
.Note that this conversion is only approximate and the par files should not be used without re-fitting. Nevertheless, this conversion should retain the phase connection so that the re-fitting is not too painful. The approximate nature of the conversion is also applicable to the
transform
plugin.The following parameters are converted to TDB:
1. Spin frequency, its derivatives and spin epoch
2. Proper motion and the position epoch
3. DM, DM derivatives, DM epoch
4. Keplerian binary parameters and FD1
The following parameters are NOT converted although they in fact affected by the TCB to TDB conversion:
1. Parallax
2. TZRMJD and TZRFRQ
2. DMX parameters
3. Solar wind parameters
5. Binary post-Keplerian parameters including Shapiro delay parameters (except FD1)
6. Jumps and DM Jumps
7. FD parameters
8. EQUADs
9. Red noise parameters including FITWAVES, powerlaw red noise powerlaw DM noise
It is pretty easy to implement TCB conversion on read if people think that is appropriate.
Edit 23-03-2023:
The
get_model
,get_model_and_toas
, andModelBuilder.__call__
functions now have an option (allow_tcb
) to convert TCB par files to TDB on read. Ifallow_tcb=False
, these functions will throw an error upon encountering TCB. Ifallow_tcb=True
, they will convert the model upon read and emit a warning about the approximate nature of the conversion. Ifallow_tcb="raw"
, the functions will simply create a malformed TimingModel object with TCB units that cannot be used for anything other than converting to TDB. Thetcb2tdb
script simply calls theget_model
function and writes the converted model into a par file.