Stream: python-questions

Topic: interp_hybrid_to_pressure


view this post on Zulip Mira Berdahl (Feb 15 2024 at 00:51):

I have some CAM-SE output that I remap to a regular grid and then save as a zarr file. Now I'd like read that zarr file, and then interpolate the Z3 geopotential height field onto the Z500 and Z200 levels. I use the interp_hybrid_to_pressure function from geocat, and it runs, but the output looks weird. I can't figure out what is going wrong here. Any thoughts?

Screenshot-2024-02-14-at-4.49.46-PM.png

The sample script is here:
glade/u/home/mberdahl/FirstLook_LIGruns/DASK_scripts/HistoricalAnalysis/TestHighRes_Z3_interp.ipynb

view this post on Zulip Katelyn FitzGerald (Feb 15 2024 at 02:20):

It looks the data for the top hybrid level might be getting assigned as a surface pressure array. Could that be the issue? Apologies if I'm missing something - still getting familiar with some of these datasets/functionality.

view this post on Zulip Mira Berdahl (Feb 15 2024 at 15:56):

@Katelyn FitzGerald I think the levels are ordered from top of atmosphere, so I'm pulling the last level (lev = -1) to serve as my surface pressure array.

view this post on Zulip Michael Levy (Feb 15 2024 at 16:15):

Is data.isel(lev=-1) the right value for the ps argument? I would expect that argument to be something out of the full dataset rather than values from the data array you are trying to interpolate. @Katelyn FitzGerald or @Brian Medeiros can correct me if I'm wrong, but from the documentation it looks like it should be an array of surface pressures (possibly in units of Pascals), not your data values at the surface

view this post on Zulip Michael Levy (Feb 15 2024 at 16:17):

Similarly, I think you want to multiply new_levels by 100 to convert from hectopascals or millibars to pascals; p0 looks to be in the right units already

view this post on Zulip Mira Berdahl (Feb 15 2024 at 16:37):

Hi @Michael Levy , ok that makes more sense - I was confused about this myself. I will give that a shot and let you know if it works.

view this post on Zulip Mira Berdahl (Feb 15 2024 at 17:45):

OK thanks for alerting me to this --- it works no problem now. Many thanks @Michael Levy .

view this post on Zulip Notification Bot (Feb 15 2024 at 17:46):

Katelyn FitzGerald has marked this topic as resolved.

view this post on Zulip Notification Bot (Feb 15 2024 at 22:35):

Mira Berdahl has marked this topic as unresolved.

view this post on Zulip Mira Berdahl (Feb 15 2024 at 22:41):

After looking at some of the output from the interpolation from hybrid grid onto the 500mb level, it appears the output is still not what I expect. It contains topographic influence, which I believe ought not be there. I've double checked all my pressure field inputs are in Pa.

Here is what Z500 looks like:
Screenshot-2024-02-15-at-2.40.16-PM.png

The sample script is here:
glade/u/home/mberdahl/FirstLook_LIGruns/DASK_scripts/HistoricalAnalysis/TestHighRes_Z3_interp.ipynb

view this post on Zulip Jesse Nusbaumer (Feb 16 2024 at 21:47):

Hi @Mira Berdahl , just checking if you are using the "PS" variable from CAM as the surface pressure (ps) input? That should contain the actual differences in surface pressure/height, and should (I think?) remove the surface signal. Of course if that still doesn't work please let me know. Thanks!

view this post on Zulip Mira Berdahl (Feb 16 2024 at 22:02):

Hi @Jesse Nusbaumer , great question. It looks like I had accidentally been calling PSL instead of PS. This makes WAY more sense to me now. Thanks!


Last updated: May 16 2025 at 17:14 UTC