nenupy.astro.astro_tools.altaz_to_radec
- nenupy.astro.astro_tools.altaz_to_radec(altaz, fast_compute=False)[source]
Converts a celestial object horizontal coordinates to equatorial coordinates.
If
fast_compute=Trueis selected, the computation is accelerated using Local Sidereal Time approximation (seelocal_sidereal_time()). The right ascension \(\alpha\) and declination \(\delta\) are computed as follows:\[\begin{split}\cases{ \delta = \sin^(-1) \left( \sin l \sin \theta + \cos l \cos \theta \cos \varphi \right)\\ h = \cos^{-1} \left( \frac{\sin \theta - \sin l \sin \delta}{\cos l \cos \delta} \right)\\ \alpha = t_{\rm{LST}} - h }\end{split}\]with \(\theta\) the object’s elevation, \(\varphi\) the azimuth, \(l\) the
observer’s latitude and \(h\) the Local Hour Angle (seehour_angle()). If \(\sin(h^{\prime}) \geq 0\), then \(h = - (h^{\prime} - \pi)\). Otherwise,transform_to()is used.- Parameters:
altaz – Celestial object horizontal coordinates.
fast_compute (
bool) – If set toTrue, it enables faster computation time for the conversion, mainly relying on an approximation of the local sidereal time. All other values would lead to accurate coordinates computation. Differences in coordinates values are of the order of \(10^{-2}\) degrees or less.
- Returns:
Celestial object’s equatorial coordinates.
- Return type:
- Example:
from nenupy.astro import altaz_to_radec from nenupy import nenufar_position from astropy.time import Time from astropy.coordinates import SkyCoord, AltAz radec = altaz_to_radec( altaz=SkyCoord( 300, 45, unit="deg", frame=AltAz( obstime=Time("2022-01-01T12:00:00"), location=nenufar_position ) ), fast_compute=True )