From b7efd66aaa84647e183254b3719e20f4c20cabc6 Mon Sep 17 00:00:00 2001 From: tobiasmarke Date: Fri, 1 Dec 2023 14:32:37 +0100 Subject: [PATCH] Exclude scans in LWP offset correction --- mwrpy/level2/lwp_offset.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mwrpy/level2/lwp_offset.py b/mwrpy/level2/lwp_offset.py index c6bc0df..ad615c1 100644 --- a/mwrpy/level2/lwp_offset.py +++ b/mwrpy/level2/lwp_offset.py @@ -24,20 +24,16 @@ def correct_lwp_offset( lwcl_i = lev1["liquid_cloud_flag"][index] ind = utils.time_to_datetime_index(lev1["time"][index]) - lwp_df = pd.DataFrame({"Lwp": lwp_org}, index=ind) + lwp = np.copy(lwp_org) + lwp[elevation_angle[index] < 89.0] = np.nan + lwp_df = pd.DataFrame({"Lwp": lwp}, index=ind) lwp_std = lwp_df.rolling( pd.tseries.frequencies.to_offset("2min"), center=True, min_periods=10 ).std() lwp_max = lwp_std.rolling( pd.tseries.frequencies.to_offset("20min"), center=True, min_periods=100 ).max() - lwp = np.copy(lwp_org) - lwp[ - (lwcl_i != 0) - | (lwp > 0.06) - | (elevation_angle[index] < 89.0) - | (lwp_max["Lwp"][:] > 0.003) - ] = np.nan + lwp[(lwcl_i != 0) | (lwp > 0.06) | (lwp_max["Lwp"][:] > 0.003)] = np.nan lwp_df = pd.DataFrame({"Lwp": lwp}, index=ind) lwp_offset = lwp_df.rolling( pd.tseries.frequencies.to_offset("20min"), center=True, min_periods=100