Closed refrancesco6 closed 2 years ago
Hi @refrancesco6,
I think your issue may be from how you are defining height in the each situation. In your first code excerpt, it looks like you are using height_agl, which stands for 'height above ground level', so the height variable is not starting at the surface, but rather where the model is actually running (25m). In the next code excerpt, you use the z coordinate and set msl=False
, which will again allow for the height variable to be run as agl not msl (mean sea level). However, if you were to run the function with MSL over AGL, I believe you would still receive NaN or negative values depending where your model is centered (due to the physical elevation or altitude of the region/model). Generally, when a function is returning NaN in wrf-python, it is because the value does not "make sense" or there is no data for that point.
A couple of options to maybe try:
pblh/2
to a specific height. In testing on my side, I found that lowering the level to interpolate to reduced or eliminated how many NaN values were returned in rh_pblh
Hello, best regards. I hope you can help me. I want to interpolate the wind speed at half the height of the Atmospheric Boundary Layer, I have tried the following: wspd = getvar(ncfile, "wspd", timeidx=1) pblh = getvar(ncfile,"PBLH", timeidx=1) height = getvar(ncfile, "height_agl") rh_pblh = interplevel(wspd, height, pblh/2)
or wspd = getvar(ncfile, "wspd", timeidx=1) pblh = getvar(ncfile,"PBLH", timeidx=1) z = getvar(ncfile, "z", msl=False) rh_pblh = interplevel(wspd, z, pblh/2)
However, in the result I get values like NAN. Likewise, when I print to "z" or "height", observe that the altitudes at level 0 are from 25 meters and not at ground level as it should be (0 meters), this could be due?.
Thanks