create_observing_model

specsim.transform.create_observing_model(where, when, wavelength, temperature=<Quantity 15. deg_C>, pressure=None, relative_humidity=0)[source] [edit on github]

Create a model for observations through the atmosphere.

This function encapsulates algorithms for the time-dependent transformation between sky coordinates and ALT-AZ through a specified atmosphere, and models the wavelength-dependent atmospheric refraction.

The model returned by this function can be passed to sky_to_altaz() and altaz_to_sky() to transform sky coordinates such as RA,DEC to and from this model’s ALT,AZ coordinate frame(s).

The output shape resulting from using a model with sky_to_altaz() or altaz_to_sky() is determined by the usual numpy broadcasting rules applied to all of the coordinates and observing model inputs, so this function can be used to tabulate an observing model on a user-specified grid covering location x time x wavelength x temperature x pressure x humidity. For example, to model a grid of observing times and wavelengths:

>>> where = observatories['KPNO']
>>> when = astropy.time.Time([56382.9, 56383.1], format='mjd')
>>> wlen = np.linspace(4000., 10000., 7) * u.Angstrom
>>> obs_model = create_observing_model(where, when[:, np.newaxis], wlen)
>>> sky_in = astropy.coordinates.ICRS(ra=45*u.deg, dec=45*u.deg)
>>> sky_to_altaz(sky_in, obs_model).shape
(2, 7)
Parameters:
whereastropy.coordinates.EarthLocation

The location(s) on the earth where the sky is being observed.

whenastropy.time.Time

The time(s) of the observations.

wavelengthastropy.units.Quantity

The wavelength(s) of the observations with units of length.

temperatureastropy.units.Quantity

The temperature(s) of the observations with temperature units.

pressureastropy.units.Quantity

The atmospheric pressure(s) of the observations with appropriate units. These should be pressures at the telescope, rather than adjusted to equivalent sea-level pressures. When None is specified, the pressure(s) will be estimated at the telescope elevation using a standard atmosphere model at the specified temperature(s).

relative_humidityfloat or numpy.ndarray

Relative humidity (or humidities) of the observations. Value(s) should be in the range 0-1 and are dimensionless.

Returns:
astropy.coordinates.AltAz

An array of ALT-AZ coordinate frames with a shape given by np.broadcast(where, when, wavelength, temperature, pressure, relative_humidity).