Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative humidity min/max, clipping and OOL #309

Open
ladsmund opened this issue Oct 14, 2024 · 1 comment
Open

Relative humidity min/max, clipping and OOL #309

ladsmund opened this issue Oct 14, 2024 · 1 comment

Comments

@ladsmund
Copy link
Contributor

The clip_values function currently restricts rh_[uli]_cor to the range of 0 to 100.

Is this approach valid, given that the allowable range for these values was initially set between 0 and 150%, accommodating supersaturated states?

Would it be more appropriate to validate and filter the inferred values before computing the corrected humidity variables? Clipping might be overly restrictive in cases where supersaturation is expected or meaningful.

#307 (review)

@ladsmund ladsmund added v3 (IDL) Something related to the old v3 IDL/GDL code OOL Data validation and removed v3 (IDL) Something related to the old v3 IDL/GDL code labels Oct 14, 2024
@BaptisteVandecrux
Copy link
Member

To me there is no doubt that

if var in ["rh_u_cor", "rh_l_cor"]:
# Nan inputs should stay nan
was_nan = ds[var].isnull()
if ~np.isnan(row.lo):
ds[var] = ds[var].where(ds[var] >= row.lo, other=0)
if ~np.isnan(row.hi):
ds[var] = ds[var].where( ds[var] <= row.hi, other=100)
ds[var] = ds[var].where(~was_nan)

Would it be more appropriate to validate and filter the inferred values before computing the corrected humidity variables?

I am not sure what you are suggesting here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants