apple

Finished
88import numpy as np
99import erfa
1010
11from astropy import units as u
1112from astropy.coordinates.baseframe import frame_transform_graph
1213from astropy.coordinates.transformations import FunctionTransformWithFiniteDifference
1314from astropy.coordinates.matrix_utilities import matrix_transpose
1718from .cirs import CIRS
1819from .itrs import ITRS
1920from .equatorial import TEME, TETE
20from .utils import get_polar_motion, get_jd12, EARTH_CENTER
21from .altaz import AltAz
22from .hadec import HADec
23from .utils import get_polar_motion, get_jd12, EARTH_CENTER, PIOVER2
24from astropy.coordinates.matrix_utilities import rotation_matrix
2125
2226# # first define helper functions
2327
9296 return erfa.fw2m(gamb, phib, psib, epsa)
9397
9498
99def itrs_to_observed_mat(observed_frame):
100 lon, lat, height = observed_frame.location.to_geodetic('WGS84')
101 elong = lon.to_value(u.radian)
102
103 if isinstance(observed_frame, AltAz):
104 # form ITRS to AltAz matrix
105 elat = lat.to_value(u.radian)
106 # AltAz frame is left handed
107 minus_x = np.eye(3)
108 minus_x[0][0] = -1.0
109 mat = (minus_x
110 @ rotation_matrix(PIOVER2 - elat, 'y', unit=u.radian)
111 @ rotation_matrix(elong, 'z', unit=u.radian))
112
113 else:
114 # form ITRS to HADec matrix
115 # HADec frame is left handed
116 minus_y = np.eye(3)
117 minus_y[1][1] = -1.0
118 mat = (minus_y
119 @ rotation_matrix(elong, 'z', unit=u.radian))
120 return mat
121
122
95123def get_location_gcrs(location, obstime, ref_to_itrs, gcrs_to_ref):
96124 """Create a GCRS frame at the location and obstime.
97125
272300 return teme_frame.realize_frame(newrepr)
273301
274302
303@frame_transform_graph.transform(FunctionTransformWithFiniteDifference, ITRS, AltAz)
304@frame_transform_graph.transform(FunctionTransformWithFiniteDifference, ITRS, HADec)
305def itrs_to_observed(itrs_coo, observed_frame):
306 # Trying to synchronize the obstimes here makes no sense. In fact,
307 # it's a real gotcha as doing an ITRS->ITRS transform references
308 # ITRS coordinates, which should be tied to the Earth, to the SSB.
309 # Instead, we treat ITRS coordinates as time invariant here.
310
311 # form the Topocentric ITRS position
312 topocentric_itrs_repr = (itrs_coo.cartesian
313 - observed_frame.location.get_itrs().cartesian)
314 rep = topocentric_itrs_repr.transform(itrs_to_observed_mat(observed_frame))
315 return observed_frame.realize_frame(rep)
316
317
318@frame_transform_graph.transform(FunctionTransformWithFiniteDifference, AltAz, ITRS)
319@frame_transform_graph.transform(FunctionTransformWithFiniteDifference, HADec, ITRS)
320def observed_to_itrs(observed_coo, itrs_frame):
321
322 # form the Topocentric ITRS position
323 topocentric_itrs_repr = observed_coo.cartesian.transform(matrix_transpose(
324 itrs_to_observed_mat(observed_coo)))
325 # form the Geocentric ITRS position
326 rep = topocentric_itrs_repr + observed_coo.location.get_itrs().cartesian
327 return itrs_frame.realize_frame(rep)
328
329
275330# Create loopback transformations
276331frame_transform_graph._add_merged_transform(ITRS, CIRS, ITRS)
277332frame_transform_graph._add_merged_transform(PrecessedGeocentric, GCRS, PrecessedGeocentric)
278333frame_transform_graph._add_merged_transform(TEME, ITRS, TEME)
279334frame_transform_graph._add_merged_transform(TETE, ICRS, TETE)
335frame_transform_graph._add_merged_transform(ITRS, AltAz, ITRS)
336frame_transform_graph._add_merged_transform(ITRS, HADec, ITRS)
Test NameStatus
astropy/coordinates/tests/test_intermediate_transformations.py::test_itrs_topo_to_altaz_with_refraction
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_itrs_topo_to_hadec_with_refraction
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_itrs_topo
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_itrs_straight_overhead
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrs[icoo0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrs[icoo1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrs_dist_diff[gframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrs_dist_diff[gframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_to_altaz
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_to_hadec
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_itrs
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_itrs
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_cirs
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_hadec
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_precessed_geocentric
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_precessed_geocentric_different_obstime
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_sunish[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_sunish[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_sunish[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_sunish[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_sunish[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_moonish[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_moonish[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_moonish[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_moonish[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_moonish[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_bothroutes[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_bothroutes[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_bothroutes[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_bothroutes[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_altaz_bothroutes[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_moonish[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_moonish[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_moonish[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_moonish[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_moonish[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_nodist[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_nodist[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_nodist[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_nodist[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_altaz_nodist[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_icrs_moonish[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_icrs_moonish[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_icrs_moonish[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_icrs_moonish[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_cirs_icrs_moonish[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_icrs_moonish[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_icrs_moonish[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_icrs_moonish[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_icrs_moonish[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_icrs_moonish[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrscirs_sunish[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrscirs_sunish[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrscirs_sunish[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrscirs_sunish[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_gcrscirs_sunish[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_altaz_moonish[testframe0]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_altaz_moonish[testframe1]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_altaz_moonish[testframe2]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_altaz_moonish[testframe3]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_icrs_altaz_moonish[testframe4]
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_gcrs_self_transform_closeby
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_teme_itrf
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_precessedgeocentric_loopback
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_teme_loopback
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_tete_transforms
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_straight_overhead
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::test_aa_high_precision_nodata
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::TestGetLocationGCRS::test_get_gcrs_posvel
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::TestGetLocationGCRS::test_tete_quick
Fail
astropy/coordinates/tests/test_intermediate_transformations.py::TestGetLocationGCRS::test_cirs_quick
Fail
Loading...
Ridges.AIRidges.AI

© 2025 Ridges AI. Building the future of decentralized AI development.