Parse MPC Epoch & Tp values as TT instead of UTC#110
Conversation
| /// The Month as an integer, 0 = January etc. | ||
| /// day: | ||
| /// The day as an integer or float. | ||
| /// scaling: |
There was a problem hiding this comment.
Unless you have a strong argument for adding this, this a major footgun for users.
There was a problem hiding this comment.
I don't, it was to maintain the Time.from_ymd() method used in the mpc.py file. I agree with your comment about it being a major footgun.
Upon reflection it would be easier (and far less invasive) to parse the YMD data from the MPC comet file to JD, then create a Time object from that with "TT" scaling.
…etch_known_comet_orbit_data to utilize this to enable proper parsing of tt-scaled peri & epoch times
|
Pushed a new version of the fix, addressing your concerns to do with changes to Also, I want to make it clear it is totally fine with me if you choose to go a completely different route for the fix or not use my changes! Just wanted to try and help if I could. |
| peri_arg=comet["Peri"], | ||
| peri_time=Time.from_ymd(*peri_time).jd, | ||
| epoch=Time.from_ymd(*epoch_time).jd, | ||
| peri_time=Time(_ymd_to_jd(peri_time), scaling="tt").jd, |
There was a problem hiding this comment.
I hate to do this, but do this instead (and please remove the helper function that was added).
obj = dict(
desig=name,
group_name=f"Comet {comet['Orbit_type']}",
peri_dist=comet["Perihelion_dist"],
ecc=comet["e"],
incl=comet["i"],
lon_node=comet["Node"],
peri_arg=comet["Peri"],
# MPC comet files store YMD as TT time.
# Support for this will not be added into kete, so here is a workaround.
peri_time=Time.from_jd(Time.from_ymd(*peri_time).utc_jd, scaling="tt").jd,
epoch=Time.from_jd(Time.from_ymd(*epoch_time).utc_jd, scaling="tt").jd,
)There was a problem hiding this comment.
Still significantly cleaner than the helper function.
I pushed, only change was I used Time() not Time.from_jd() (default Time new function takes in jd).
Fixes #109 .
This PR updates MPC asteroid/comet orbit parsing so that
epochandTpis interpreted as TT, matching the MPC orbit-element specifications.Previously these fields were parsed as UTC, which shifted
epochandperi_timelater by TT−UTC before conversion to kete's internal JD time representation. For current MPCORB rows this is about 69.184 seconds.Changes:
EpochandTpas TT, as documented in the MPCORB manual.Time.from_ymdmethod, to ensure backwards compatibility for previous UTC-only functionality.All tests pass with the command