-
I am trying to do some calculation between two iris cubes (GRIB files), here it is what I'm trying to achieve: First cube:
Then, I have a series of sampling points at gives coordinates:
The other cube (GRIB file) is a 2D cube ("timeless") of elevation: I've downloaded ERA-Land geopontential GRIB2 file from here:
Then, to convert the geopotential to elevation, I've divided by 9.80665 m/s^2
The resulting cube has been cropped to the same lat and lon as air temperature above (probably not necessary):
Now here is the point: having these two cubes, I have to calculate a new temperature value at every sample points given the linear equation: where: How could I achieve this? I have this error: To double check, both cubes have same CS:
Thank you so much for helping |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
What are the points of the latitude for each of these cubes? i.e. what do you get when you call:
I suspect that if your cubes are not defined on the same grids, it may be appropriate to interpolate onto sample points before doing your calculations so that your cubes are defined on the same coordinates. See this interpolation function https://scitools-iris.readthedocs.io/en/latest/generated/api/iris/analysis/trajectory.html#iris.analysis.trajectory.interpolate . I'm also curious where your two different elevation values |
Beta Was this translation helpful? Give feedback.
Ah, I think I didn't read the whole spec, but was only talking about the the problem with nearly-equal lat+lon coordinates.
So I missed the need to extract at specific (non-grid) station locations anyway... Interpolation makes perfect sense for that, so you may as well apply the same to both the inputs, and not worry about the slight difference.
So I think you now have a suitable Zgb cube, with 18 points corresponding to the station locations.
In order to do arithmetic, you need this and the other two cubes to all share a "station dimension" (length 18).
That means also interpolating the other gridded data inputs (air-temperature and surface-elevation) from lats and lons onto the fixed st…