ppcpy.qc.overlapEst#

Functions

load

read the overlap function from files into a structure similar to the others.

overlapCalc

Calculate overlap function.

overlapCalcRaman

Calculate overlap function from Polly measurements based on Wandinger and Ansmann 2002 https://doi.org/10.1364/AO.41.000511

run_frnr_cldFreeGrps

Estimate overlap function using far-range-near-range method.

run_raman_cldFreeGrps

Estimate overlap function using Raman method.

ppcpy.qc.overlapEst.run_frnr_cldFreeGrps(data_cube, collect_debug: bool = True) list[source]#

Estimate overlap function using far-range-near-range method.

Parameters:
  • data_cube (object) – Main PicassoProc object.

  • collect_debug (bool) – If true, collect debug information. Default is True.

Returns:

overlap – Per channel per cloud free period: - overlap : ndarray

Overlap function.

  • overlapStdndarray

    Standard deviation of overlap function.

  • sigRatiofloat

    Signal ratio between near-range and far-range signals.

  • normRangelist

    Height index of the signal normalization range.

Return type:

list of dicts

Notes

  • The matlab version preforms some convertio from PC to PCR after calculating the overlap function (this might just be relevent at all)

  • The matlab version also uses calculates 1 overlap function for each channel while we calculate 1 per clFreeGrp per channel…

  • The frnr overlap calculations are very unstable and frequently results in values outside the range [0,1].

ppcpy.qc.overlapEst.overlapCalc(height: ndarray, sigFR: ndarray, bgFR: ndarray, sigNR: ndarray, bgNR: ndarray, hFullOverlap: float = 600, collect_debug=False) dict[source]#

Calculate overlap function.

Parameters:
  • height (ndarray) – Height above ground (m).

  • sigFR (ndarray) – Far-field signal (photon count).

  • bgFR (ndarray) – Background of far-field signal (photon count).

  • sigNR (ndarray) – Near-field signal (photon count).

  • bgNR (ndarray) – Background of near-field signal (photon count).

  • hFullOverlap (float, optional) – Minimum height with full overlap for far-range signal (default: 600 m).

Returns:

  • overlap (ndarray) – Overlap function.

  • overlapStd (ndarray) – Standard deviation of overlap function.

  • sigRatio (float) – Signal ratio between near-range and far-range signals.

  • normRange (list) – Height index of the signal normalization range.

  • History

  • ——-

  • - 2021-05-18 (First edition by Zhenping)

ppcpy.qc.overlapEst.run_raman_cldFreeGrps(data_cube, collect_debug: bool = True) list[source]#

Estimate overlap function using Raman method.

Parameters:
  • data_cube (object) – Main PicassoProc object.

  • collect_debug (bool) – If true, collect debug information. Default is True.

Returns:

overlap – Per channel per cloud free period: - olFunc : ndarray

Overlap function.

  • olStdfloat

    Standard deviation of overlap function.

  • olFunc0ndarray

    Overlap function with no smoothing.

Return type:

list of dicts

ppcpy.qc.overlapEst.overlapCalcRaman(Lambda_el: float, Lambda_Ra: float, height: ndarray, sigFRel: ndarray, sigFRRa: ndarray, molExt: ndarray, molBsc_r: ndarray, molExt_r: ndarray, aerBsc: ndarray, hFullOverlap: float = 600, smoothbins: float = 1, AE: float = 1, hres: float = 150, collect_debug=False) dict[source]#

Calculate overlap function from Polly measurements based on Wandinger and Ansmann 2002 https://doi.org/10.1364/AO.41.000511

Parameters:
  • Lambda_el (float) – Elastic wavelength.

  • Lambda_Ra (float) – Raman wavelength.

  • height (ndarray) – Height above ground [m].

  • sigFRel (ndarray) – Far-field elastic signal.

  • sigFRRa (ndarray) – Far-field Raman signal.

  • molExt (ndarray) – Molecular extinction (elastic).

  • molBsc_r (ndarray) – Molecular Backscatter (inelastic).

  • molExt_r (ndarray) – Molecular extinction (inelastic).

  • aerBsc (ndarray) – Particle backscattering derived with the Raman method [m^{-1}].

  • hFullOverlap (float, optional) – Minimum height with complete overlap [m]. Default is 600.

  • smoothbins (int, optional) – Number of bins for smoothing. Default is 1.

  • AE (float, optional) – Angstroem exponent. Default is 1.

  • hres (float, optional) – Instrument height resolution [m]. Default is 150.

Returns:

  • olFunc (ndarray) – Overlap function.

  • olStd (float) – Standard deviation of overlap function.

  • olFunc0 (ndarray) – Overlap function with no smoothing.

  • History

  • ——-

  • - 2023-06-06 (First edition by Cristofer)

Notes

  • TODO: What is returned by the function and what is described in the docstring does not corresponed.

  • TODO: This function uses a mix of ppcpy.misc.helper.unifrom_filter and scipy.ndimage.uniform_filter1d

    for smoothing. This is done to avoid NaN-value related errors. A better more cohesive solution should be precude in the future.

  • TODO: Be cearfull with NaN values! scipy.ndimage.uniform_filter1d used for smoothing in this module

    will propagate any NaN values present in the signal throughot the rest of the smoothed signal. Additionaly, here we are using mode ‘reflect’ for padding (see scipy.ndimage.uniform_filter1d documentation). This might not be the most optimal mode, the other availabel mode should also be considered. Optimally, should we designe our own filter for this purpuse that do not have the issue with propagating NaN values, Like what is used in the rest of the modules. However, without reducing dimension or filling in NaN values.

ppcpy.qc.overlapEst.load(data_cube) list[source]#

read the overlap function from files into a structure similar to the others.

Parameters:

data_cube (object) – Main PicassoProc object.

Returns:

overlap

Return type:

list of dicts