[AstroPy] Hour Angle from location and alt/az

Thomas Robitaille thomas.robitaille at gmail.com
Sat Nov 5 05:16:44 EDT 2016


Hi John,

It seems like this is something you may be able to do with astroplan:

http://astroplan.readthedocs.io/en/latest/api/astroplan.Observer.html?highlight=hour%20angle#astroplan.Observer.target_hour_angle

(this is the Astropy affiliated package for observation planning)

Cheers,
Tom


On 5 November 2016 at 00:04, 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



More information about the AstroPy mailing list