Internal classes

Here are the internal classes used. You are welcome to browse.

FOVManager

class FOVManager

An array of .FOV objects. This is the container class and provides management of the field of views for radiative transfer calculations etc.

add(fov: skimpy.instrument.fov.FOV)int

Adds a field of view to the current list of field of views. This will clear any internal caches unti the next access of property lines_of_sight

Parameters

fov (FOV) – A field of view. An instance of a class derived from FOV

Returns

  • The index of this field of view in the FOVManager. This can be used to index the field of view object.

  • The FOVManager implements a simple list that starts at 0 and increases by 1 each time you add a new field of view.

fov_indices_into_unique(fov: skimpy.instrument.fov.FOV)List[int]

Demangles the line of sights from the unique list of lines of sight. Returns a list of indices into the lines of sight (for one exposure) of the FOV object. This is used when demangling the radiances returned from the Sasktran engine

Returns

The list of indices of the lines of sight from the fovs * object. The *fovs object must be in this FOVManagers list of fovs

Return type

List[int]

index_of_entry(fov: skimpy.instrument.fov.FOV)
property lines_of_sight_in_icf
Returns

Returns the 2-D array (3,N) of lines of sight for all of the field of view objects being considered.

Return type

np.ndarray


QuadratureBase

class QuadratureBase

Base class for implementing quadrature. Quadrature objects are typically used to integrate over fields of view and wavelength ranges. One quadrature object may be shared between hundreds of different sensor pixels. This is achieved by mapping the “normalized” units of the quadrature object to the actual units in the actual integral.

integrate(Fx: Union[float, numpy.ndarray])float
quadrature_points()numpy.ndarray

Returns the location of the quadrature points along the x axis. The user will supply a tabulated function at each of these points when calling integrate

quadrature_weights()numpy.ndarray

Returns the weights of the quadrature points used by this weighted integral. This is used to evaluate the integral.

set_points_and_weights(xpoints: Union[numpy.ndarray, Sequence], weights: Union[numpy.ndarray, Sequence], bounds: Tuple[float, float])

Sets the x-abscissa locations and the weights for this quadrature object. The user will ensure that any tabulated function integrated by this object will have values evaluated at the xpoints location. The weights array must sum to unity.

Parameters
  • xpoints (np.ndarray) – The array of x abscissa points where a tabulated function will be evaluated

  • weights (np.ndarray) – The weights used to perform the integral over the given range

  • bounds (Tuple[float,float]) – The bounds of the integral. For example [-1,+1] or [-infinity, +infinity]


Quadrature_Gaussian_Hermite

class Quadrature_Gauss_Hermite(norders: int, x0: float, sigma: float)

Implements weighted quadrature of the form

\[` I_{T} = \int_{-\infty}^{\infty} F(x) e^{-(x)^2} dx\]

The technique uses Gauss-Hermite quadrature and it decides where the quadrature points are located. The upside is that the technique is efficient and fast. The downside is that neighbouring pixels on a spectrograph will probably not share the same quadrature points. So this weighted_integral is good for high resolution studies of one pixel spectrally isolated from others.

set_num_orders(N: int, x0: float, sigma: float)

Sets the number of points used in the integral plust the central peak of the guass in user units and the \(\sigma\) of the gaussian distribution


Quadrature_Gauss_Legendre

class Quadrature_Gauss_Legendre(Norders: int)

Implements Gaussian-Legendre weighted quadrature of the form

\[` I_{T} = \int_{-1}^{+1} F(x) dx\]

The technique uses Gauss-Legendre quadrature and it decides where the quadrature points are located. It has limited application for UVIS-NIR integrals in radiance as it requires too many points to capture the high variability of the solar irradiance

set_num_orders(N: int)

Sets the number of points/orders used


Quadrature_Trapezoidal

class Quadrature_Trapezoidal(range: Optional[Tuple[int, float, float]] = None, user_x_values: Optional[numpy.ndarray] = None)

Implements trapezoidal integration. I have not used the numpy/scipy methods as they do not provide the weights they simply do the integral summation which is not what I want. The trapezoidal integration is setup so the sum of weights is unity:

set_from_abscissa_values(x: numpy.array)

Uses the user provided x values as the integration abscissa values

set_from_range(N: int, a: float, b: float)

Sets N evenly spaced points along the abscissa


Quadrature_Delta_Function

class Quadrature_Delta_Function(x0: float)

A class that implements a delta function for the quadrature. This is typically used for low resolution integrals that are only using one point

integrate(Fx: Union[float, numpy.ndarray])float

Overrides the base class implementation (but gives the same answer). Its a delta function with one element so we can just immediately return the first element of the function rather than call summation over the elements.


SolarIrradiance

class SolarIrradiance(name='SAO2010')

A class to provide the solar spectral irradiance at high spectral resolution. The default implementation uses the SAO210 solar spectral irradiance model which has a sampling spacing of 0.01 nm across most of the UVIS-NIR. The SAO2010 is only available from 200.07 nm to 1000.99 nm. The other, non-default, choice is the FONTELA UVIS 3-MICRON spectrum which extends out to 3 microns but at lower spectral resolution than SAO2010.

apply_solar_irradiance(wavelen_definition: skimpy.instrument.wavelengthdefinition.WavelengthDefinition, toa_albedo_to_radiance_method: str, mjd0: float, rtm_toa_albedo: numpy.ndarray, rtm_wf: numpy.ndarray, option_make_toa_albedo_wf: bool)

Applies the solar irradiance to the toa albedo and weighting function. The exact interpolation technique used is determined by the value stored in wavelength_definition, see rtm_tuning_parameter.

Parameters
  • wavelen_definition (WavelengthDefinition) – The object with the definition of wavelengths used for the radiative transfer model.

  • toa_albedo_to_radiance_method (str) – The method used to process the high resolution solar measurements.

  • mjd0 (float) – The Modified Julian Date for this set of calculations. It is used to find the distance of the Sun from Earth

  • rtm_toa_albedo (np.ndarray) – The toa albedo array (wavelength, los, time, …) calculated by the skimpy radiative transfer model. The radiance array returned to the user is this array times the solar spectral irradiance.

  • rtm_wf (np.ndarray) – The weighting function array calculated by the skimpy radiative transfer model. The weighting function returned to the user is this array times the solar spectral irradiance if option_make_toa_albedo_wf is false otherwise it returns this array unmodified. No calculation is performed if the array is None.

  • option_make_toa_albedo_wf (bool) – A flag to indicate if the weighting function array is for the toa albedo rather than the radiance. If True then the weighting function passed in is unmodified. If False then the weighting function passed in is multipled by the

  • rtm_toaalbedo

  • rtm_wf

  • rtm_wavelen

Returns

is_valid_processing_method(processing_method_name: str)bool

Internal function that verifies the requested processing mode is valid.

wavelengths_at_intrinsic_sampling(wavelen: numpy.ndarray)

Fetches the array of wavelengths at the spectral sampling density of the solar spectral irradiance that spans the wavelengths in the given array of wavelengths. This is used when interpolating to solar sampling density.

Parameters

wavelen (np.ndarray) – An array or Sequence of wavelengths in nanometers. The bounding range of wavelengths is determined from the min and max values

Returns

An array of wavelengths at the intrinsic sampling of the solar spectral irradiance

Return type

np.ndarray


WavelengthManager

class WavelengthManager

An internal class that stores a list of wavelength regions used in this instrument. This provides a simplified interface to the FrontEndOptics class. It only exposes the unique wavelengths and updates internal caches as new wavelength regions are added.

add(wavelen_range: skimpy.instrument.wavelengthdefinition.WavelengthDefinition)int

Adds a wavelength range to the current list of wavelength ranges. This will clear any internal caches unti the next access of property unique_rtm_wavelengths

Parameters

wavelen_range – An instance of WavelengthDefinition that defines a wavelength range

Returns

The index of the wavelength region just added in the collection of regions.

Return type

int

index_of_entry(wavelen_range: skimpy.instrument.wavelengthdefinition.WavelengthDefinition)
select_solar_preconvolution_mode(support_solar_preconvolve: bool)

Give each window definition achance to reconfigure itself for solar preconvolution. This typically happens when running UVIS-NIR FrontEndRadianceGenerators.

property size
unique_rtm_wavelengths()numpy.ndarray

The 1-D array of unique wavelengths derived from all of the wavelength regions in this object.

wavelength_indices_into_unique(wavelen: skimpy.instrument.wavelengthdefinition.WavelengthDefinition)

Demangles the wavelengths from the unique list of wavelengths. Returns a list of indices of the wavelengths of the wavelength_Integrator object in the unique arrays used for back_end_radiance calculations. This is used when demangling the back_end_radiance returned from the Sasktran engine