act.retrievals.generic_sobel_cbh

act.retrievals.generic_sobel_cbh(obj, variable=None, height_dim=None, var_thresh=None, fill_na=None, return_thresh=False)[source]

Function for calculating cloud base height from lidar/radar data using a basic sobel filter and thresholding. Note, this was not initially based on any published work, but a lit review indicates that there have been similar methods employed to detect boundary layer heights.

Parameters:
  • obj (ACT Object) – ACT object where data are stored.

  • variable (string) – Variable on which to process.

  • height_dim (string) – Height variable to use for CBH values.

  • var_thresh (float) – Thresholding for variable if needed.

  • fill_na (float) – What to fill nans with in DataArray if any.

Returns:

new_obj (ACT Object) – ACT Object with cbh values included as variable.

Examples

In testing on the ARM KAZR and MPL data, the following methods tended to work best for thresholding/corrections/etc.

kazr = act.retrievals.cbh.generic_sobel_cbh(
    kazr, variable="reflectivity_copol", height_dim="range", var_thresh=-10.0
)

mpl = act.corrections.mpl.correct_mpl(mpl)
mpl.range_bins.values = mpl.height.values[0, :] * 1000.0
mpl.range_bins.attrs["units"] = "m"
mpl["signal_return_co_pol"].values[:, 0:10] = 0.0
mpl = act.retrievals.cbh.generic_sobel_cbh(
    mpl,
    variable="signal_return_co_pol",
    height_dim="range_bins",
    var_thresh=10.0,
    fill_na=0.0,
)

ceil = act.retrievals.cbh.generic_sobel_cbh(
    ceil,
    variable="backscatter",
    height_dim="range",
    var_thresh=1000.0,
    fill_na=0,
)