[AstroPy] Calculating alt/az or zenith angle/parallactic angle

Tim Cornwell realtimcornwell at gmail.com
Fri Jan 27 05:56:42 EST 2017


Hi Tim,

I can see how that works bit what I want is to be able to calculate from the local hour angle i.e. a relative time (LST-RA) instead of starting with an absolute time. For context, I’m writing some simulation code and don’t need to work with absolute time. From what I see, it’s not possible in astropy to start with hour angle instead of some form of absolute time. I can work around this but it seems to be a hole in either the package or more likely in the documentation.

Thanks,
Tim

-- 
Tim Cornwell
Sent with Airmail

On 27 January 2017 at 10:51:42 am, Tim Staley (tim.staley at physics.ox.ac.uk) wrote:

Hi Tim,  

you want something like the following:  

from astropy.coordinates import SkyCoord, AltAz, EarthLocation  

from astropy.time import Time  
import astropy.units as u  

obs_time = Time('2017-01-01T18:00')  

sky_posn = SkyCoord(0 * u.deg, 30 * u.deg)  
earth_location = EarthLocation.from_geodetic(0*u.deg, 35*u.deg)  

altaz = sky_posn.transform_to(  
AltAz(obstime=obs_time,  
location=earth_location))  

print(altaz.alt.deg, altaz.az.deg)  


Cheers,  
Tim  

On 27/01/17 10:34, Tim Cornwell wrote:  
> Hi  
>  
> I am given an hour angle and wish to calculate alt/az or zenith  
> angle/parallactic angle for a given SkyCoord and Location. After  
> reading the documentation and many tries, I cannot see how to do this  
> with the current Astropy Time/Angle classes. It is possible?  
>  
> Thanks,  
> Tim  
>  
> --  
> Tim Cornwell  
> Sent with Airmail  
>  
>  
> _______________________________________________  
> 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  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20170127/90e52925/attachment.html>


More information about the AstroPy mailing list