A fix for pre-1962-Jan-20 observations#1144
Conversation
|
Not sure if this PR is ready for review or not. Happy to review if it's ready. Note - the linter check is failing so black needs to be run on the files (I can do that if needed). |
|
I still need to run comparisons with JPL Horizons and add unit tests. |
| m = spice.pxform("IAU_EARTH", "J2000", et) | ||
| mp = spice.pxform("IAU_EARTH", "J2000", et + delta_et) | ||
| mm = spice.pxform("IAU_EARTH", "J2000", et - delta_et) | ||
| # m = spice.pxform("ITRF93", "J2000", et) |
There was a problem hiding this comment.
JOSS review hasn't happened so any new additions will be reviewed - can we remove the commented out rows so we don't get asked to clean up during JOSS review?
|
Okay. Add @bernardinelli back to review to signal when this is ready for review so this is PR not approved prematurely. This branch of sorcha can be pip installed -e so it's not holding up layup development at the moment while those checks are being done and the unit test test is being developed. |
|
Yes, that's fine. I left the old code there just for comparison.
…On Sun, Apr 27, 2025 at 10:43 AM Meg Schwamb ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/sorcha/ephemeris/simulation_geometry.py
<#1144 (comment)>
:
> @@ -195,9 +195,19 @@ def barycentricObservatoryRates(et, obsCode, observatories, Rearth=RADIUS_EARTH_
pos = posvel[0:3]
vel = posvel[3:6]
# Get the matrix that rotates from the Earth's equatorial body fixed frame to the J2000 equatorial frame.
- m = spice.pxform("ITRF93", "J2000", et)
- mp = spice.pxform("ITRF93", "J2000", et + delta_et)
- mm = spice.pxform("ITRF93", "J2000", et - delta_et)
+ # We don't need to compute this repeatedly
+ et_1962 = spice.str2et("1962-Jan-20")
+ if et >= et_1962:
+ m = spice.pxform("ITRF93", "J2000", et)
+ mp = spice.pxform("ITRF93", "J2000", et + delta_et)
+ mm = spice.pxform("ITRF93", "J2000", et - delta_et)
+ else:
+ m = spice.pxform("IAU_EARTH", "J2000", et)
+ mp = spice.pxform("IAU_EARTH", "J2000", et + delta_et)
+ mm = spice.pxform("IAU_EARTH", "J2000", et - delta_et)
+ # m = spice.pxform("ITRF93", "J2000", et)
JOSS review hasn't happened so any new additions will be reviewed - can we
remove the commented out rows so we don't get asked to clean up during JOSS
review?
—
Reply to this email directly, view it on GitHub
<#1144 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5CVWOAAT4CPHOVFR6RG4323TUHLAVCNFSM6AAAAAB34VQOI2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDOOJXGY2TSNJVGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Matthew J. Holman, PhD
Senior Astrophysicist
Center for Astrophysics | Harvard & Smithsonian
60 Garden Street, MS #51
Cambridge, MA 02138
(617) 496-7775
|
remove comment test is incomplete
|
Looks good - thanks @bernardinelli for getting this over then line with the unit test - thanks @matthewholman for starting the fix. |
Fixes #1145
This adds code to use IAU_EARTH rather than ITRF for observations before 1962-Jan-20. Thank you, Rahil!
Review Checklist for Source Code Changes