python - How do you convert from AltAz coordinates to equatorial coordinates in Astropy -


i have been trying figure out how convert set of altaz coordinates equatorial coordinates, , far have been able find how convert equatorial altaz (but not reverse) using following method:

c = skycoord('22h50m0.19315s', '+24d36m05.6984s', frame='icrs') loc = earthlocation(lat = 31.7581*u.deg, lon = -95.6386*u.deg, height = 147*u.m) time = time('1991-06-06 12:00:00') caltaz = c.transform_to(altaz(obstime = time, location = loc)) 

however want rotate azimuth of mpaltaz increment , figure out corresponding equatorial coordinates of new point.

i.e. want this:

newaltazcoordiantes = skycoord(alt = caltaz.alt.deg, az = caltaz.az.deg + x*u.deg, obstime = time, frame = 'altaz') newaltazcoordiantes.transform_to(icrs) 

the problem im having though not seem can build skycoord object in altaz coordinate system

i hope clear enough, first time posting on stackoverflow.

i don't know astronomy, seems there's plenty of documentation:

for me, caltaz.icrs works , returns original c. needed tweak bunch of stuff make work on newaltazcoordiantes (need define x, stop calling deg on attributes have units, add location):

>>> x = 5 # why not? >>> newaltazcoordiantes = skycoord(alt = caltaz.alt, az = caltaz.az + x*u.deg, obstime = time, frame = 'altaz', location = loc) >>> newaltazcoordiantes.icrs <skycoord (icrs): (ra, dec) in deg     (341.79674062, 24.35770826)>