altaz_to_focalplane¶
- specsim.transform.altaz_to_focalplane(alt, az, alt0, az0, platescale=1)[source] [edit on github]¶
Convert local (alt,az) coordinates to focal plane (x,y) coordinates.
A plate coordinate system is defined by its boresight altitude and azimuth, corresponding to the (x,y) origin, and the conventions that +x increases eastwards along the azimuth axis and +y increases towards the zenith along the altitude axis:
>>> scale = 200 * u.mm / u.deg >>> alt0, az0 = 45 * u.deg, 0 * u.deg >>> x, y = altaz_to_focalplane(alt0 + 1 * u.deg, az0, alt0, az0, scale) >>> print('X = %.2f mm, Y = %.2f mm' % (x.to(u.mm).value, y.to(u.mm).value)) X = 0.00 mm, Y = 199.99 mm >>> x, y = altaz_to_focalplane(alt0, az0 + 1 * u.deg, alt0, az0, scale) >>> print('X = %.2f mm, Y = %.2f mm' % (x.to(u.mm).value, y.to(u.mm).value)) X = 141.41 mm, Y = 0.87 mm
This function implements a purely mathematical coordinate transform and does not invoke any atmospheric refraction physics. Use
sky_to_altaz()to convert global sky coordinates (ra,dec) into local (alt,az) coordinates, which does involve refraction.The output shape is determined by the usual numpy broadcasting rules applied to all of the inputs, , so this function can be used to tabulate (x,y) coordinates on a user-specified grid covering different targets and boresights.
- Parameters:
- alt
astropy.coordinates.Angle Target altitude angle(s) above the horizon.
- az
astropy.coordinates.Angle Target azimuthal angle(s) east of north.
- alt0
astropy.coordinates.Angle Boresight altitude angle(s) above the horizon.
- az0
astropy.coordinates.Angle Boresight azimuthal angle(s) east of north.
- platescale
astropy.units.Quantity Conversion from angular separation relative to the boresight to the output focal plane coordinates.
- alt
- Returns:
tuplePair x,y of focal-plane coordinates expressed as
astropy.units.Quantityobjects, with +x along the azimuth direction (increasing eastwards) and +y along the altitude direction (increasing towards zenith). The output arrays have the same shapes, given bynp.broadcast(alt, az, alt0, az0). The output units are determined by the inputplatescaleand will beu.radif the platescale is dimensionless, or otherwise the SI units ofplatescale * u.rad.