skretrieval.core package

Submodules

skretrieval.core.lineshape module

class skretrieval.core.lineshape.DeltaFunction

Bases: skretrieval.core.lineshape.LineShape

bounds()

Boundaries of the line shape. Values outside this range are 0

Returns

Left and right boundaries of the line shape

Return type

(left, right)

integration_weights(mean: float, available_samples: numpy.ndarray, normalize=True, tolerance=1e-07)

Integration weights for the line shape.

Parameters
  • mean (float) – Value to integrate to

  • available_samples (np.ndarray) – Array of sample values that are available to use in the integration.

  • normalize (bool, Optional) – If true, resulting weights are normalized such that np.nansum(weights) = 1

Returns

Integration weights, same size as available_samples.

Return type

np.ndarray

class skretrieval.core.lineshape.Gaussian(fwhm: Optional[float] = None, stdev: Optional[float] = None, max_stdev=5, mode='linear')

Bases: skretrieval.core.lineshape.LineShape

bounds()

If integration_weights is called with mean=0, all values outside the range [lower_bound, upper_bound] are guaranteed to be 0.

Returns

Return type

[lower_bound, upper_bound]

integration_weights(mean: float, available_samples: numpy.ndarray, normalize=True)

The lineshape converts a function at high resolution, H, to one at low resolution, L.

L(mean) = np.dot(H, integration_weights(mean, available_samples))

Parameters
  • mean (float) – value (in the range of available_samples) to integrate to

  • available_samples (np.ndarray) – Values that the high resolution function is available at

  • normalize (bool, optional) – If true, the returned weights will sum to 1

Returns

Weights to use in the high resolution integration

Return type

np.ndarray

class skretrieval.core.lineshape.LineShape

Bases: abc.ABC

Base class for implementing line shapes. A line shape represents integration across a high resolution measurement down to a lower resolution measurement.

bounds()

Boundaries of the line shape. Values outside this range are 0

Returns

Left and right boundaries of the line shape

Return type

(left, right)

abstract integration_weights(mean: float, available_samples: numpy.ndarray, normalize=True)

Integration weights for the line shape.

Parameters
  • mean (float) – Value to integrate to

  • available_samples (np.ndarray) – Array of sample values that are available to use in the integration.

  • normalize (bool, Optional) – If true, resulting weights are normalized such that np.nansum(weights) = 1

Returns

Integration weights, same size as available_samples.

Return type

np.ndarray

class skretrieval.core.lineshape.Rectangle(width, mode='linear')

Bases: skretrieval.core.lineshape.LineShape

bounds()

Boundaries of the line shape. Values outside this range are 0

Returns

Left and right boundaries of the line shape

Return type

(left, right)

integration_weights(mean: float, available_samples: numpy.ndarray, normalize=True)

Integration weights for the line shape.

Parameters
  • mean (float) – Value to integrate to

  • available_samples (np.ndarray) – Array of sample values that are available to use in the integration.

  • normalize (bool, Optional) – If true, resulting weights are normalized such that np.nansum(weights) = 1

Returns

Integration weights, same size as available_samples.

Return type

np.ndarray

class skretrieval.core.lineshape.UserLineShape(x_values: numpy.array, line_values: numpy.array, zero_centered: bool)

Bases: skretrieval.core.lineshape.LineShape

bounds()

Boundaries of the line shape. Values outside this range are 0

Returns

Left and right boundaries of the line shape

Return type

(left, right)

integration_weights(mean: float, available_samples: numpy.ndarray, normalize=True)

Integration weights for the line shape.

Parameters
  • mean (float) – Value to integrate to

  • available_samples (np.ndarray) – Array of sample values that are available to use in the integration.

  • normalize (bool, Optional) – If true, resulting weights are normalized such that np.nansum(weights) = 1

Returns

Integration weights, same size as available_samples.

Return type

np.ndarray

skretrieval.core.lineshape.fasterf3(x)

Fast error function approximation

skretrieval.core.radianceformat module

class skretrieval.core.radianceformat.RadianceBase(ds: xarray.core.dataset.Dataset)

Bases: abc.ABC

Base functionality that every radiance format must support

property data
tangent_locations()

Calculates tangent locations for all lines of sight. If the line of sight does not have a tangent location the ground intersection is returned instead :returns: Dataset containing ‘latitude’, ‘longitude’, and ‘altitude’ of the tangent locations :rtype: xr.Dataset

abstract to_raw()
class skretrieval.core.radianceformat.RadianceGridded(ds: xarray.core.dataset.Dataset)

Bases: skretrieval.core.radianceformat.RadianceBase

to_raw()
class skretrieval.core.radianceformat.RadianceOrbit(data: List[skretrieval.core.radianceformat.RadianceBase], wf: Optional[List[scipy.sparse.base.spmatrix]] = None)

Bases: object

A collection of other RadianceFormats that combine together to create an entire orbit of L1 data

For example an entire orbit of OMPS data can be created either as a single RadianceGridded for the entire orbit or as a List of single RadianceGridded for each image

derived_type()
image_radiance(index, dense_wf=False)
property num_images
property wf
class skretrieval.core.radianceformat.RadianceRaw(ds: xarray.core.dataset.Dataset)

Bases: skretrieval.core.radianceformat.RadianceBase

to_raw()
class skretrieval.core.radianceformat.RadianceSpectralImage(ds, num_columns: Optional[int] = None, num_rows: Optional[int] = None)

Bases: skretrieval.core.radianceformat.RadianceGridded

skretrieval.core.simulator module

class skretrieval.core.simulator.MeasurementSimulator(sensor: skretrieval.core.sensor.Sensor, optical_axis: List[skretrieval.core.OpticalGeometry], atmosphere: sasktran.atmosphere.Atmosphere, options=None)

Bases: skretrieval.retrieval.ForwardModel

A simple measurement simulator which acts as a forward model. This is not a generic class, this is moreso an example of what a MeasurementSimulator should do.

calculate_radiance()

Module contents

class skretrieval.core.OpticalGeometry(observer, look_vector, local_up, mjd)

Bases: tuple

property local_up

Alias for field number 2

property look_vector

Alias for field number 1

property mjd

Alias for field number 3

property observer

Alias for field number 0