units#
Methods related to using units and quantities from astropy.units.
- class hsr4hci.units.InstrumentUnitsContext[source]#
Context manager that allows to provide local, instrument-specific values for the
pixscaleandlambda_over_dto the registry ofastropy.units.In order to convert between pixels and arcseconds, one has to define a pixel scale; this value, however, is instrument-specific. Similarly, the value of \(\lambda / D\) obviously depends both on the wavelength \(\lambda\) of the observation and the diameter \(D\) of the primary mirror.
If we want to use \(\lambda / D\) as a unit (as it is a characteristic scale, e.g., for the PSF size), we need to define its value in terms of other units somewhere. This class provides a context manager that is initialized with values for the pixel scale and \(\lambda / D\), and it then provides a (re-usable!) context inside of which an
astropy.units.Quantitycan be converted freely between units of pixels, arc seconds and \(\lambda / D\).- Parameters:
pixscale โ
An
astropy.units.Quantitywith units arcsec / pixel that defines the pixel scale.Example
For VLT/NACO, the pixscale is typically:
PIXSCALE = 0.0271 arcsec / pixel.lambda_over_d โ
An
astropy.units.Quantitywith units arc seconds that defines the ratio between the wavelength \(\lambda\) of the observation and \(D\), the diameter of the primary mirror.Example
For Lโ-band data (\(\lambda\) = 3800 nm) at the VLT (\(D\) = 8.2 m), this value is:
lambda_over_d = 0.0956 arcsec.
- hsr4hci.units.flux_ratio_to_magnitudes(flux_ratio)[source]#
Convert a given flux ratio to magnitudes.
Example
>>> flux_ratio_to_magnitudes(1e-5) 12.5