[AstroPy] Confused by coordinate transforms ICRS/ITRS/GCRS

Jeffrey Brent McBeth mcbeth at broggs.org
Fri Aug 28 08:13:48 EDT 2015


I've been working on a personal project figuring out where stars are from the point of view of the ISS (after reading about the difficulty of the transform in a paper on the Hubble).

So, I have a catalog in ICRS, and location of the ISS in ITRS.  All fine and good, now I want calculate orientations, and take into account some of the weirdness like parallax and velocity aberration.

I have some code below that shows some of the things I've tried and the various ways I see things going "wrong".  I'm perfectly willing to admit the wrong is more likely to be me, but in that case I would like to be educated.

Thanks for your time and patience,
 Jeff

#+name: confusingTransforms
#+begin_src: python
import astropy
import astropy.coordinates
import astropy.time
import astropy.units as u

# For now, lets just talk about the center of the earth
# You may complain "this isn't in the sky", but I get similar results
# even when I'm well away from the earth, this keeps things simple, and since
# I'm ultimately trying for orientation transforms, doesn't matter
earth = astropy.coordinates.SkyCoord(x=0,y=0,z=0,frame='itrs',unit=u.m)
# And a spot one meter away
# This goes wrong with larger distances too, so it isn't simply precision
almostEarth = astropy.coordinates.SkyCoord(x=0,y=0,z=1,frame='itrs',unit=u.m)

# I would expect _most_ prints below to be 1 meter
print 'ITRS/ITRS:',earth.separation_3d(almostEarth)
print 'ICRS/ITRS:',earth.icrs.separation_3d(almostEarth)
print 'ICRS/ICRS:',earth.icrs.separation_3d(almostEarth.icrs)

print 'GCRS/ITRS:',earth.gcrs.separation_3d(almostEarth)
print 'GCRS/GCRS:',earth.gcrs.separation_3d(almostEarth.gcrs)

now = astropy.time.Time.now()
later = now+1*u.second

# A notional ISS, I have the real numbers, but this keeps it simple
platform = astropy.coordinates.GCRS(obsgeoloc=[0,0,400]*u.km,obsgeovel=[0,0,7.5]*u.km/u.s,obstime=now)

platformLater = astropy.coordinates.GCRS(obsgeoloc=[0,0,400]*u.km,obsgeovel=[0,0,7.5]*u.km/u.s,obstime=later)

print 'GCRS(Now  )/GCRS(Now  ):',earth.transform_to(platform).separation_3d(almostEarth.transform_to(platform))
print 'GCRS(Later)/GCRS(Later):',earth.transform_to(platformLater).separation_3d(almostEarth.transform_to(platformLater))

# These two, due to earth motion should probably be around 30km
print 'GCRS(Now  )/GCRS(Later):',earth.transform_to(platform).separation_3d(almostEarth.transform_to(platformLater))
print 'GCRS(Later)/GCRS(Now  ):',earth.transform_to(platformLater).separation_3d(almostEarth.transform_to(platform))
#+end_src
-- 
"The man who does not read good books has no advantage over 
 the man who cannot read them."
 -- Mark Twain



More information about the AstroPy mailing list