[AstroPy] Hour Angle from location and alt/az

Pim Schellart p.schellart at princeton.edu
Mon Nov 7 07:23:07 EST 2016


Also see https://github.com/pschella/tmf. I’m not completely surprised, as this conversion is tricky ;)
> On 5 Nov 2016, at 21:40, Tim Jenness <tim.jenness at gmail.com> wrote:
> 
> PAL (also palpy and SLALIB) has https://github.com/Starlink/pal/blob/master/palDh2e.c but that routine hasn't made it to SOFA/ERFA. I'm surprised astropy.coords does not support azel to hadec.
> 
> -- 
> Tim Jenness
> 
> On Fri, Nov 4, 2016 at 5:04 PM, John K. Parejko <parejkoj at uw.edu> wrote:
> Hello astropythians,
> 
> I’m trying to work around a distinct lack of UT1 and LST in some telescope file headers, and was wondering if there’s a straight-forward astropy way to get a source’s Hour Angle from the alt/az, ra/dec, and telescope location. I can build an altaz SkyCoord, but I’m not sure what to do with it from there:
> 
> loc = coord.EarthLocation.from_geodetic(long, lat, elevation)
> sky = coord.SkyCoord(az, alt, location=loc, frame='altaz', unit='deg’)
> 
> I can’t transform this to ICRS:
> 
> ipdb> sky.transform_to(coord.ICRS)
> *** TypeError: unsupported operand type(s) for -: 'NoneType' and ‘float’
> 
> and there’s not an “hour_angle” method that I can see in either of those.
> 
> Per the internet[1], one should be able to get HA from alt/az and dec directly (modulo refraction corrections):
> 
> HA = asin(- sin(az)*cos(alt) / cos(dec))
> 
> I can do that, but I was hoping for a nice and tidy astropy method.
> 
> Thanks,
> John
> 
> 1: http://star-www.st-and.ac.uk/~fv/webnotes/chapter7.htm
> 
> --
> *************************
> John Parejko
> parejkoj at uw.edu
> http://staff.washington.edu/parejkoj/
> Department of Physics and Astronomy
> University of Washington
> Seattle, WA
> **************************
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy
> 
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> https://mail.scipy.org/mailman/listinfo/astropy



More information about the AstroPy mailing list