hypergas.denoise module

Reduce the radom noise.

class hypergas.denoise.Denoise(scene, varname, method='calibrated_tv_filter', weight=None)[source]

Bases: object

The Denoise Class.

Initialize Denoise.

Parameters:
  • scn (Scene) – Satpy Scene which includes a variable to be denoised.

  • varname (str) – The variable to be denoised.

  • method (str) – The denoising method: “tv_filter” and “calibrated_tv_filter” (default).

  • weight (int) – The weight for denoise_tv_chambolle. It would be neglected if method is “calibrated_tv_filter”. If the weight is None (default) and method is “tv_filter”, the denoise_tv_chambolle will use the default value (0.1) which is too low for hyperspectral noisy gas field.

calibrated_tv_filter(n_weights=50, return_loss=False)[source]

Apply TV filter with auto calibration.

Parameters:
  • n_weights (int) – Number of weights used for auto calibration.

  • return_loss (bool) – Whether return the loss results.

Returns:

  • denoised_calibrated_tv (DataArray) – 2D denoised data field using calibrated parameters.

  • weights (numpy.ndarray, optional) – 1D array of weights tested for calibration. Returned only if return_loss == True.

  • losses_tv (numpy.ndarray, optional) – 1D array of total variation (TV) filter losses. Returned only if return_loss == True.

smooth()[source]

Smooth data by TV filter.

tv_filter()[source]

Call TV filter