Skip to content

Commit

Permalink
Make median calculation more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasmarke authored and tukiains committed Apr 24, 2024
1 parent 854ac9d commit 351c3e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mwrpy/atmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def find_lwcl_free(lev1: dict) -> tuple[np.ndarray, np.ndarray]:
tb_rat = tb_rat.rolling(
pd.tseries.frequencies.to_offset("20min"), center=True, min_periods=100
).max()
index[tb_mx["Tb"] < np.median(tb_rat["Tb"]) * 0.1] = 0
index[tb_mx["Tb"] < np.nanmedian(tb_rat["Tb"]) * 0.1] = 0

df = pd.DataFrame({"index": index}, index=ind)
df = df.bfill(limit=120)
Expand Down

0 comments on commit 351c3e5

Please sign in to comment.