AtmosphericExtinction (module)¶
-
class
ExtinctionModel
(lbda=None, ozoneTemplate=None, lrefAero=10000.0)[source]¶ Extinction model, from:
Parameters: - lbda – wavelength vector [AA] (default to extended optical range)
- ozoneTemplate – name of the ozone template table (see
readOzoneTemplate()
). By default, use the provided ozone template. - lrefAero – aerosol reference wavelength [AA]
-
setParams
(pars, dpars=None)[source]¶ Set physical extinction parameters: pressure, ozone column density [Dobson units], aerosol optical depth at reference wavelength and aerosol angstrom exponent.
Parameters: - pars –
extinction parameters (pr, oi, ai, ap) where:
- pr: surface pressure [mbar]
- oi: ozone intensity [Dobson units]
- ai: aerosol optical depth at reference wavelength
- ap: aerosol angstrom exponent
- dpars – associated standard errors
The total atmospheric extinction will then be the sum of three components:
- Rayleigh extinction:
pr[mbar] * HT74(1 mbar)
- Ozone extinction:
oi[DU] * OzoneTemplate(1 DU)
- Aerosol extinction:
ai/EXT2OPT * (lbda/lRef)**(-ap)
Note
if
ndim(dpars)==2
,dpars
is considered as the covariance matrix of input extinction parameters. Therefore, whenndim(dpars)==1
,self.extinctionErrors(pars, dpars)
is equivalent toself.extinctionErrors(pars, N.diag(dpars)**2)
(note the square power).- pars –
-
setDefaultParams
(location='Mauna Kea')[source]¶ Set default physical extinction parameters from predefined location.
Parameters: location – predefined location. Parameter Value ± Error Mauna Kea Pressure 616 ± 2 mbar Ozone column 257 ± 23 DU Aerosols optical depth @ 1 micron 0.0076 ± 0.0014 Aerosols angstrom exponent 1.26 ± 1.33
-
extinctionComponents
()[source]¶ Compute extinction individual components from extinction parameters (see
setParams()
)Returns: extinction components 2D-array [rayleigh,ozone,aerosols]
-
extinctionErrors
()[source]¶ Compute total extinction (diagonal) standard error from extinction parameters and associated standard errors (see
setParams()
)Returns: total extinction standard error
-
extinction
(pars=None, dpars=None, components=False)[source]¶ Compute total extinction (and associated standard error) from extinction parameters (and associated standard errors).
Parameters: - pars – extinction parameters (see
setParams()
) - dpars – extinction parameter errors (see
setParams()
) - components – return individual extinction components if True
Returns: 2D-array [ext,dext,[components]]
- pars – extinction parameters (see
-
jac
()[source]¶ Jacobian of total extinction with respect to extinction parameters.
Returns: jacobian 2D-array (nparam=4,nlbda)
-
static
rayleigh_HT74
(lbda, pressure)[source]¶ Rayleigh extinction from Hansen & Travis (1974).
Parameters: - lbda – wavelength vector [AA]
- pressure – effective surface pressure [mbar]
Returns: Rayleigh extinction [mag/airmass]
-
write
(outname, ext=None, format='txt')[source]¶ Write extinction curve in output file.
Parameters: - outname – output filename
- ext – explicit extinction curve(s) to be written out
- format – output file format (‘txt’ or ‘fits’)
-
plot
(ext=None, ax=None, components=True, transmission=False)[source]¶ Plot the atmospheric extinction/transmission and its physical components.
Parameters: - ext – extinctions to be plotted (or None)
- ax – matplotlib Axes instance (or None)
- components – display individual components if True
- transmission – display transmission rather than extinction
Returns: matplotlib Axes instance
-
readOzoneTemplate
(ozoneName, lbda, colLbda='LAMBDA', colTrans='OZONE', ext=1)[source]¶ Read ozone transmission template, interpolate over wavelengthes, and convert to extinction [mag/airmass].
Parameters: - ozoneName – input FITS table, with columns colLbda (wavelength in AA) and colTrans (fractional transmission), and key ‘REFO3COL’ specifing the reference ozone column density [DU]
- lbda – output wavelengthes [AA]
- colLbda – name of the wavelength (in AA) column
- colTrans – name of the ozone transmission column
- ext – extension in which to look for wavelength and transmission columns
Returns: ozone extinction [mag/airmass], refO3col
-
createTable
(arrays, names, units=None, formats=None, keywords=(), extname=None)[source]¶ Create a FITS-table from a set of arrays.
Parameters: - arrays – list of input arrays (ncols,)
- names – list of column names (ncols,)
- units – list of column units (ncols,) (‘none’ by default)
- formats – list of column formats (ncols,) (‘1E’ by default)
- keywords – list of keys (key,val[,comment]) to add to table header
- extname – name of the binary table extension
Returns: table HDU