altaz_to_sky

specsim.transform.altaz_to_sky(alt, az, observing_model, frame='icrs')[source] [edit on github]

Convert (alt,az) to sky coordinates for specified observing conditions.

Transformations between sky coordinates such as RA,DEC and ALT,AZ involve two steps. First, define the atmosphere through which the sky is being observed with a call to create_observing_model(). Next, call this function. For example, to map a North pointing at 60 degrees altitude from Kitt Peak onto the sky, observing at a wavelength of 5400 Angstroms:

>>> where = observatories['KPNO']
>>> when = astropy.time.Time('2001-01-01T00:00:00')
>>> obs_model = create_observing_model(where, when, 5400 * u.Angstrom)
>>> radec = altaz_to_sky(60*u.deg, 0.*u.deg, obs_model)
>>> print('ra = %.3f deg, dec = %.3f deg' %
... (radec.ra.to(u.deg).value, radec.dec.to(u.deg).value))
ra = 349.106 deg, dec = 61.963 deg

Setting a pressure value of zero disables the atmospheric refraction model, so that returned coordinates are topocentric. The atmospheric refraction model becomes inaccurate for altitudes below 20 degrees so a UserWarning will be issued to flag this condition.

The output shape is determined by the usual numpy broadcasting rules applied to the input coordinates and the observing model input parameters.

Parameters:
altastropy.coordinates.Angle

Altitude angle(s) above the horizon to convert to sky coordinates.

azastropy.coordinates.Angle

Azimuthal angle(s) east of north to convert to sky coordinates.

observing_modelastropy.coordinates.AltAz

The ALT-AZ coordinate frame(s) that specify the observing conditions, normally obtained by calling create_observing_model().

framestr or astropy.coordinates.BaseCoordinateFrame instance

The sky coordinate frame that the input alt-az observations should be transformed to. The default 'icrs' corresponds to J2000 RA,DEC. Some other useful frames are 'fk5' and 'galactic'. See the astropy docs for details.

Returns:
astropy.coordinates.AltAz

An array of ALT-AZ coordinates with a shape given by np.broadcast(sky_coords, observing_model).