Skip to content
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

Include polar angle motion correction in erfa LST calculation? #1315

Closed
bhazelton opened this issue Jul 6, 2023 · 2 comments · Fixed by #1331
Closed

Include polar angle motion correction in erfa LST calculation? #1315

bhazelton opened this issue Jul 6, 2023 · 2 comments · Fixed by #1331
Labels

Comments

@bhazelton
Copy link
Member

I am a little concerned that the erfa calculation is not quite right because it doesn't include correction for polar motion in the TIO locator (see https://github.com/astropy/astropy/blob/073d359ebd31c6a3cd10755a9717ac6243da7dd5/astropy/time/core.py#L2329). It seems to be a very small effect (~8.4 microarcseconds for the times I tested with) but I think we should probably include it.

This plot shows the difference between the astropy & erfa calculation without the TIO correction:
Screen Shot 2023-07-06 at 9 59 17 AM

And this is with that correction included (basically copied it from astropy, we might want a fix that is more pure erfa). I added this block to the erfa LST calculation:

        # Correct for TIO
        from astropy.coordinates.builtin_frames.utils import get_polar_motion
        from astropy.coordinates.matrix_utilities import rotation_matrix
        sp = erfa.sp00(times.tt.jd1, times.tt.jd2)
        xp, yp = get_polar_motion(times)
        # Form the rotation matrix, CIRS to apparent [HA,Dec].
        r = (
            rotation_matrix(longitude, "z")
            @ rotation_matrix(-yp, "x", unit=units.radian)
            @ rotation_matrix(-xp, "y", unit=units.radian)
            @ rotation_matrix(gast_array + sp, "z", unit=units.radian)
        )
        # Solve for angle.
        angle = np.arctan2(r[..., 0, 1], r[..., 0, 0]) << units.radian

        lst_array = np.mod(angle.value, 2.0 * np.pi)[reverse_inds]
Screen Shot 2023-07-06 at 10 04 21 AM
@bhazelton bhazelton added the bug label Jul 6, 2023
@bhazelton
Copy link
Member Author

@kartographer Interested in your thoughts here.

@bhazelton
Copy link
Member Author

I think we should also reconsider our defaults for the astrometry library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant