enpt.model package

Subpackages

Submodules

enpt.model.srf module

EnPT module for handling spectral response functions.

class enpt.model.srf.SRF(wvl_unit: str = 'nanometers', wvl_min: float = 400, wvl_max: float = 2500, specres_nm: float = 1, format_bandnames: bool = False, v: bool = False)[source]

Bases: object

SRF instance provides SRF functions, wavelength positions, etc..

Parameters:
  • wvl_unit – the wavelengths unit to be used within SRF instance (‘nanometers’ or ‘micrometers)

  • wvl_min

  • wvl_max

  • specres_nm – output spectral resolution of SRFs in nanometers

  • format_bandnames – whether to format default strings from LayerBandsAssignment as ‘B01’, ‘B02’ etc..

  • v – verbose mode

static compute_gaussian_srf(cwl: float, fwhm: float, wvl_min: float, wvl_max: float, wvl_res: float, normalize: bool = True) ndarray[source]

Compute a spectral response function based on center wavelength and bandwidth using on a gaussian curve.

Parameters:
  • cwl – target center wavelength position

  • fwhm – target bandwidth (full width half maximum)

  • wvl_min – minimum wavelength to compute spectral response for

  • wvl_max – maximum wavelength to compute spectral response for

  • wvl_res – spectral resolution at which spectral response is to be computed

  • normalize – whether to normalize the output spectral response to values between 0 and 1

Returns:

2D numpy.ndarray: rows: response per wavelength; columns: wavelength/response

convert_wvl_unit()[source]

Convert the wavelength unit to nanometers if they are in micrometers or vice versa.

classmethod from_cwl_fwhm(cwls: list | ndarray, fwhms: list | ndarray, **kwargs: dict) SRF[source]

Create an instance of SRF based on center wavelength positions and bandwidths (using gaussian responses).

Parameters:
  • cwls – center wavelength positions

  • fwhms – bandwidths

  • kwargs – Keyword arguments to be passed to SRF.__init__().

Returns:

SRF instance

instrument(bands)[source]
plot_srfs(figsize: tuple = (15, 5), band: str | List[str] = None, normalize: bool = True)[source]

Show a plot of all spectral response functions.

Parameters:
  • figsize – figure size of the plot

  • band – band key to plot a single band instead of all bands

  • normalize – normalize SRFs to 0-1 (default: True)

Module contents

EnPT module ‘model’, containing all kinds of data models.