hypergas.retrieve module

Retrieve trace gas enhancements using hyperspectral satellite data.

class hypergas.retrieve.MatchedFilter(scn, wvl_intervals, species='ch4', mode='column', rad_dist='normal', rad_source='model', land_mask=True, land_mask_source='OSM', cluster=False, plume_mask=None, scaling=None)[source]

Bases: object

The MatchedFilter Class.

Initialize MatchedFilter.

Parameters:
  • scn (Satpy Scene) – including at least one variable named “radiance” (Dataset [“bands”, “y”, “x”], units: mW m^-2 sr^-1 nm^-1), and at least two coordinates: [1] “wavelength” (nm) and [2] “fwhm” (nm).

  • wvl_intervals (list) – The wavelength range (nm) used in matched filter. It can be one list or nested list. e.g. [2110, 2450] or [[1600, 1750], [2110, 2450]].

  • species (str) – The species to be retrieved. Only species defined in the config.yaml file. Default: “ch4”.

  • mode (str) – The mode (“column” or “scene”) to apply matched filter. Default: “column”. Be careful of noise if you apply the matched filter for the whole scene.

  • rad_dist (str) – The assumed rads distribution (“normal” or “lognormal”). Default: “normal”.

  • rad_source (str) – The data (‘model’ or ‘lut’) used for calculating rads or transmissions. Default: “model”.

  • land_mask (bool) – Whether apply the matched filter to continental and oceanic pixels seperately. Default: True.

  • land_mask_source (str) – The data source of land mask (“OSM”, “GSHHS”, or “Natural Earth”). Default: “OSM”.

  • cluster (bool) – Whether apply the pixel classification. Default: False.

  • plume_mask (numpy.ndarray) – 2D array, 0: neglected pixels, 1: plume pixels. Default: None.

  • scaling (float) – The scaling factor for alpha to ensure numerical stability.

col_matched_filter(radiance, segmentation, plume_mask, K)[source]

Apply the matched filter by column.

Parameters:
  • radiance (DataArray) – The radiance DataArray for one column.

  • segmentation (DataArray, same shape as radiance) – The segmentation of pixels (e.g., land and water mask).

  • plume_mask (DataArray, same shape as radiance) – Since the matched filter assumes plume signals are sparse (i.e., present in only a small fraction of pixels), it is better to exclude pixels within identified plume masks, so that background statistics are estimated only from non-plume pixels and the sparsity assumption remains valid.

  • K (numpy.ndarray) – The Jacobian K (i.e, the change of the radiance (or its logarithm) for a +1 ppm methane concentration increase).

Returns:

The gas enhancement (DataArray) – Unit: ppm.

smf()[source]

Standard/Robust matched filter.

Compute mean and covariance of set of each column and then run standard matched filter.

Returns:

The gas enhancement (DataArray) – Unit: ppm.