act.corrections.correct_mpl

act.corrections.correct_mpl(ds, co_pol_var_name='signal_return_co_pol', cross_pol_var_name='signal_return_cross_pol', co_pol_afterpuls_var_name='afterpulse_correction_co_pol', cross_pol_afterpulse_var_name='afterpulse_correction_cross_pol', overlap_corr_var_name='overlap_correction', overlap_corr_heights_var_name='overlap_correction_heights', range_bins_var_name='range_bins', height_var_name='height', ratio_var_name='cross_co_ratio')[source]

This procedure corrects MPL data: 1.) Throw out data before laser firing (heights < 0). 2.) Remove background signal. 3.) Afterpulse Correction - Subtraction of (afterpulse-darkcount). NOTE: Currently the Darkcount in VAPS is being calculated as the afterpulse at ~30km. But that might not be absolutely correct and we will likely start providing darkcount profiles ourselves along with other corrections. 4.) Range Correction. 5.) Overlap Correction (Multiply).

If the height variable changes between netCDF files, Xarray will turn the height dimention variables from a 1D to a 2D array. This will cause issues with processing and other data manipulation. To fix this the 2D height will be converted to a 1D array by using the median value for each height value.

Note: Deadtime and darkcount corrections are not being applied yet.

Parameters:
  • ds (xarray.Dataset) – The Xarray Dataset containing data

  • co_pol_var_name (str) – The Co-polar variable name used in Dataset

  • cross_pol_var_name (str) – The Cross-polar variable name used in Dataset

  • co_pol_afterpuls_var_name (str) – The Co-polar after pulse variable name used in Dataset

  • cross_pol_afterpulse_var_name (str) – The Cross-polar afterpulse variable name used in Dataset

  • overlap_corr_var_name (str) – The overlap correction variable name used in Dataset

  • overlap_corr_heights_var_name (str) – The overlap correction height variable name used in Dataset

  • range_bins_var_name (str) – The range bins variable name used in Dataset

  • height_var_name (str) – The height variable name used in Dataset

  • ratio_var_name (str) – The variable name to use for newly created variable of co/cross ratio. Set to None if do not want this new variables created in Dataset.

Returns:

ds (xarray.Dataset) – Xarray dataset containing the corrected values. The original Xarray Dataset passed in is modified.