skretrieval.core.lineshape.Gaussian

skretrieval.core.lineshape.Gaussian#

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

Bases: LineShape

Gaussian line shape.

Parameters:
  • fwhm (float) – Full width half maximum, only specify one of fwhm or stdev

  • stdev (float) – Standard deviation, only specify one of fwhm or stdev

  • max_stdev (int, optional) – Values farther than max_stdev*stdev are truncated to 0. Default=5

  • mode (string, one of ['constant', 'linear']) – If constant, then the gaussian is sampled at the integration location. If linear, then the gaussian is integrated with a triangular base function representing linear integration across the sample. Linear is much more accurate at the cost of a small performance hit. Default ‘linear’.

__init__(fwhm: float | None = None, stdev: float | None = None, max_stdev=5, mode='linear')[source]#

Gaussian line shape.

Parameters:
  • fwhm (float) – Full width half maximum, only specify one of fwhm or stdev

  • stdev (float) – Standard deviation, only specify one of fwhm or stdev

  • max_stdev (int, optional) – Values farther than max_stdev*stdev are truncated to 0. Default=5

  • mode (string, one of ['constant', 'linear']) – If constant, then the gaussian is sampled at the integration location. If linear, then the gaussian is integrated with a triangular base function representing linear integration across the sample. Linear is much more accurate at the cost of a small performance hit. Default ‘linear’.

Methods

__init__([fwhm, stdev, max_stdev, mode])

Gaussian line shape.

bounds([center])

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

integration_weights(mean, available_samples)

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

zero_centered()

True if the lineshape is centered on 0 rather than the nominal sample

bounds(center=0)[source]#

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

Parameters:

center (float, optional) – Center of the line shape. Default is 0

Return type:

[lower_bound, upper_bound]

integration_weights(mean: float, available_samples: ndarray, normalize=True)[source]#

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