def true_helioecliptic_to_icrs(from_coo, to_frame): if not u.m.is_equivalent(from_coo.cartesian.x.unit): raise UnitsError(_NEED_ORIGIN_HINT.format(from_coo.__class__.__name__)) # first un-precess from ecliptic to ICRS orientation rmat = _true_ecliptic_rotation_matrix(from_coo.equinox) # now offset back to barycentric, which is the correct center for ICRS sun_from_ssb = get_offset_sun_from_barycenter( from_coo.obstime, include_velocity=bool(from_coo.data.differentials)) return matrix_transpose(rmat), sun_from_ssb
def icrs_to_true_helioecliptic(from_coo, to_frame): if not u.m.is_equivalent(from_coo.cartesian.x.unit): raise UnitsError(_NEED_ORIGIN_HINT.format(from_coo.__class__.__name__)) # get the offset of the barycenter from the Sun ssb_from_sun = get_offset_sun_from_barycenter(to_frame.obstime, reverse=True, include_velocity=bool(from_coo.data.differentials)) # now compute the matrix to precess to the right orientation rmat = _true_ecliptic_rotation_matrix(to_frame.equinox) return rmat, ssb_from_sun.transform(rmat)
def icrs_to_true_helioecliptic(from_coo, to_frame): if not u.m.is_equivalent(from_coo.cartesian.x.unit): raise UnitsError(_NEED_ORIGIN_HINT.format(from_coo.__class__.__name__)) # get barycentric sun coordinate # this goes here to avoid circular import errors from astropy.coordinates.solar_system import get_body_barycentric bary_sun_pos = get_body_barycentric('sun', to_frame.obstime) # now compute the matrix to precess to the right orientation rmat = _true_ecliptic_rotation_matrix(to_frame.equinox) return rmat, (-bary_sun_pos).transform(rmat)
def true_helioecliptic_to_icrs(from_coo, to_frame): if not u.m.is_equivalent(from_coo.cartesian.x.unit): raise UnitsError(_NEED_ORIGIN_HINT.format(from_coo.__class__.__name__)) # first un-precess from ecliptic to ICRS orientation rmat = _true_ecliptic_rotation_matrix(from_coo.equinox) # now offset back to barycentric, which is the correct center for ICRS # this goes here to avoid circular import errors from astropy.coordinates.solar_system import get_body_barycentric # get barycentric sun coordinate bary_sun_pos = get_body_barycentric('sun', from_coo.obstime) return matrix_transpose(rmat), bary_sun_pos