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

NaN when desiredlev equal to vert in wrf.interplevel #190

Closed
s-redfern opened this issue Jun 7, 2022 · 2 comments
Closed

NaN when desiredlev equal to vert in wrf.interplevel #190

s-redfern opened this issue Jun 7, 2022 · 2 comments

Comments

@s-redfern
Copy link

I'm not sure if this is expected behavior, but it seems that when the the vertical coordinate array and the desired interpolation levels input to wrf.interplevel are the same, the function will return NaNs at those points.

I can get around it by slightly adjusting my inputs for the desired output levels at places where it's a problem, but wanted to post about this if it actually is an unexpected issue with the wrf-python package.

@Opio-Cornelius
Copy link

Opio-Cornelius commented Jun 21, 2022

I also found NaN values being returned when I use wrf.interplevel. This only affected model layers from the surface, ~ 1013 hPa upto 850 hPa. The problem does not affect the entire domain though, just a few patches, but they are noteworthy. The file attached herein is an early trial example (the data is not as correct), but it shows the problem well.

NO2_wrf_chem.

@michaelavs
Copy link
Contributor

Hi @s-redfern and @Opio-Cornelius,
As a preface, I am under the impression that these layers are from the surface to the top level of you dataset (i.e. your dataset pressure range is from 1013 to 850 hpa, and NaN values are at or around those areas). If that is the case, then the reason you will have values returned as NaN is due to the way an interpolation works mathematically. Interpolations can work up to, but not inclusively of the range of the values, so you could have an interpolation from 1000 to 900 hpa but if a region inside of the domain is at, above, or below the pressure range, they will be returned as NaN (above and below values could be captured through an extrapolation routine, but the exact values would still be NaN in this case too).

Now, if you are doing the interpolation and seeing that every value at every level is being returned as a NaN between the top and bottom levels (i.e. valid range is 1013 to 850, interpolating between 950 and 900, and only NaN values are returned), then that would not be an expected output from wrf-python and I would definitely like to take a further look there.

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

No branches or pull requests

3 participants