Field of view (dorado.scheduling.FOV)#
- class dorado.scheduling.FOV(representation)#
Bases:
object
The field of view of an instrument.
Examples
First, some imports:
>>> from astropy.coordinates import ICRS, SkyCoord >>> from astropy import units as u >>> from astropy_healpix import HEALPix
Now, get the footprint for the default pointing:
>>> fov = FOV.from_rectangle(50 * u.deg) >>> fov.footprint().icrs <SkyCoord (ICRS): (ra, dec) in deg [( 25., 25.), ( 25., -25.), (335., -25.), (335., 25.)]>
Get a footprint as HEALPix coordinates.
>>> hpx = HEALPix(nside=4, frame=ICRS()) >>> fov.footprint_healpix(hpx, SkyCoord(0*u.deg, 20*u.deg), 15*u.deg) array([ 57, 41, 25, 24, 70, 55, 39, 38, 23, 120, 104, 105, 88, 73, 119, 103, 102, 87, 72, 56, 71, 40])
Get the footprint for a grid of pointings:
>>> ra = np.arange(0, 360, 45) * u.deg >>> dec = np.arange(-90, 91, 45) * u.deg >>> roll = np.arange(0, 90, 15) * u.deg >>> center = SkyCoord(ra[:, np.newaxis], dec[np.newaxis, :]) >>> footprints = fov.footprint(center[..., np.newaxis], roll) >>> footprints.shape (8, 5, 6, 4)
- classmethod from_rectangle(width, height=None)#
Create a rectangular field of view.
- Parameters:
width (
astropy.units.Quantity
) – The width of the rectangle.height (
astropy.units.Quantity
) – The height of the rectangle. If omitted, then the field of view is a square.
- Return type:
- footprint(center=<SkyCoord (ICRS): (ra, dec) in deg (0., 0.)>, roll=<Quantity 0. deg>)#
Get the footprint of the FOV at a given orientation.
- Parameters:
center (
astropy.coordinates.SkyCoord
) – The center of the field of view. If omitted, the default is RA=0°, Dec=0°.roll (
astropy.coordinates.SkyCoord
) – The roll of the field of view. If omitted, the default is 0°.
- Returns:
vertices – The coordinates of the vertices of the field of view.
- Return type:
- footprint_healpix(healpix, *args, **kwargs)#
Get the HEALPix footprint at a given orientation.
- Parameters:
center (
astropy.coordinates.SkyCoord
) – The center of the field of view.rotate (class:astropy.units.Quantity) – The position angle (optional, default 0 degrees).
- Returns:
An array of HEALPix indices contained within the footprint.
- Return type:
np.ndarray
- footprint_healpix_grid(healpix, center, roll)#
Calculate the HEALPix footprints of all pointings on the grid.
- Returns:
A generator that yields the indices for each pointing center and for each roll.
- Return type:
generator