Skip to content

Commit

Permalink
Fix Pandas 3.0 deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
siiptuo committed Feb 26, 2024
1 parent 89442ee commit ed4eef1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mwrpy/level2/lwp_offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ def correct_lwp_offset(
lwp_mn = lwp_offset.rolling(
pd.tseries.frequencies.to_offset("60min"), center=True, min_periods=100
).min()
lwp_offset["Lwp"][
(lwp_mx["Lwp"][:] - lwp_mn["Lwp"][:]) / tb_max["Tb"] > (tb_max["Tb"] * 0.002)
lwp_offset.loc[
(lwp_mx["Lwp"][:] - lwp_mn["Lwp"][:]) / tb_max["Tb"] > (tb_max["Tb"] * 0.002),
"Lwp",
] = np.nan
lwp_offset = lwp_offset.interpolate(method="linear")
lwp_offset = lwp_offset.bfill()
lwp_offset["Lwp"][(np.isnan(lwp_offset["Lwp"])) | (lwp_org == -999.0)] = 0.0
lwp_offset.loc[(np.isnan(lwp_offset["Lwp"])) | (lwp_org == -999.0), "Lwp"] = 0.0
lwp_org -= lwp_offset["Lwp"].values
return lwp_org, lwp_offset["Lwp"].values

0 comments on commit ed4eef1

Please sign in to comment.