astronomyastropy

Convert from ITRS to ICRS using astropy


Say pleases is it possible using AstroPy to transform ITRS(International Terrestrial Reference System) to ICRS(International Celestial Reference System)? I have read the documentation and understand how to do ICRS to ITRS conversions, but not sure how to go the other way.


Solution

  • All of the transformations implemented in Astropy are bi-directional (see, e.g., the transform graph that visualizes the possible transformations). So, yes, it is possible to transform from the ITRS to the ICRS frame. You have to create an instance of the ITRS class by specifying the Cartesian coordinates of the point of interest. For example:

    import astropy.coordinates as coord
    import astropy.units as u
    itrs = coord.ITRS(x=150*u.km, y=300*u.km, z=-210*u.km)
    

    Then you can transform to the ICRS frame with:

    icrs = itrs.transform_to(coord.ICRS())