(Another) GCRS angular separation behavior
See original GitHub issueThis issue is to report another counter-intuitive behavior of angular separations in the GCRS frame. It follows on similar reports in #5185 and #6633 (and may be of interest to @StuartLittlefair and @adrn).
The basic issue is that an object at fixed ICRS position observed at two different times will have different GCRS coordinates. However, the separation between these GCRS coordinates is calculated to be zero. Here is a MWE:
from astropy.coordinates import SkyCoord, GCRS, ICRS
from astropy.time import Time
obj = SkyCoord(ra=37.0*u.degree,dec=-4.5*u.degree, distance=3*u.au)
obj_t0 = obj.transform_to(GCRS(obstime=Time(57370.0, format='mjd')))
obj_t1 = obj.transform_to(GCRS(obstime=Time(57380.0, format='mjd')))
print(obj_t0)
print(obj_t1)
print("Obj(t0) RA,DEC: ", obj_t0.ra.deg,obj_t0.dec.deg)
print("Obj(t1) RA,DEC: ",obj_t1.ra.deg,obj_t1.dec.deg)
print(obj_t0.separation(obj_t1))
print(obj_t1.separation(obj_t0))
and the output:
<SkyCoord (GCRS: obstime=57370.0, obsgeoloc=(0., 0., 0.) m, obsgeovel=(0., 0., 0.) m / s): (ra, dec, distance) in (deg, deg, AU)
(22.02874564, -14.46782793, 2.49351509)>
<SkyCoord (GCRS: obstime=57380.0, obsgeoloc=(0., 0., 0.) m, obsgeovel=(0., 0., 0.) m / s): (ra, dec, distance) in (deg, deg, AU)
(20.38720594, -13.68925892, 2.64894343)>
Obj(t0) RA,DEC: 22.028745635550386 -14.467827929473025
Obj(t1) RA,DEC: 20.387205935596295 -13.689258920287072
0d00m00s
0d00m00s
My understanding is that the frames of obj_t0
and obj_t1
differ (both are GCRS, but at different obstime
). Thus, separation
is converting the two coordinates to the same obstime
, and thus the angular separation is calculated to be zero.
print("Equivalent frame?",obj_t0.is_equivalent_frame(obj_t1))
While I’m guessing this is the “correct” behavior, it is definitely counter-intuitive (i.e., when trying to compute parallax corrections for solar system objects).
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
@eteq, @adrn and I are wondering if it wouldn’t be best to just raise an exception if the frames are not identical: it can be an origin that is different at the same time or different times with the same origin. Obviously, the exception message could then clarify things. (See also #11388)
I’d be in favour of raising an exception, but we should certainly deprecate this usage first, as this will break a lot of code in the wild, and people should get some warning…