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()andaltaz_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()oraltaz_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:
- where
astropy.coordinates.EarthLocation The location(s) on the earth where the sky is being observed.
- when
astropy.time.Time The time(s) of the observations.
- wavelength
astropy.units.Quantity The wavelength(s) of the observations with units of length.
- temperature
astropy.units.Quantity The temperature(s) of the observations with temperature units.
- pressure
astropy.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
Noneis specified, the pressure(s) will be estimated at the telescope elevation using a standard atmosphere model at the specified temperature(s).- relative_humidity
floatornumpy.ndarray Relative humidity (or humidities) of the observations. Value(s) should be in the range 0-1 and are dimensionless.
- where
- Returns:
astropy.coordinates.AltAzAn array of ALT-AZ coordinate frames with a shape given by
np.broadcast(where, when, wavelength, temperature, pressure, relative_humidity).