Skip to content

Commit

Permalink
Exclude scans in LWP offset correction
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasmarke authored and siiptuo committed Dec 1, 2023
1 parent 091bbab commit b7efd66
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions mwrpy/level2/lwp_offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b7efd66

Please sign in to comment.