Hello,
I have a grib file with temperatures and dew point temperatures at various levels. I try to plot K-index by creating new formula, but error came out as in the attached figure. May I know how to solve it or how to calculate K-index in another way? Thanks.
K-index = (Temp at 850hPa) - (Temp at 500hPa) + (Dew point at 850hPa) - ( (Temp at 700hPa - Dew point at 700hPa) )
Regards,
Sim
K index
Re: K index
Hi Sim,
I think this is the same problem that Rick Kohrs addressed in this post.
viewtopic.php?f=14&t=872&hilit=kindex
You will need to make a 2D slice first. Please see the link.
Hopefully that helps,
Joleen
I think this is the same problem that Rick Kohrs addressed in this post.
viewtopic.php?f=14&t=872&hilit=kindex
You will need to make a 2D slice first. Please see the link.
Hopefully that helps,
Joleen
Re: K index
Hi Sim...
While I do not have the formula you are trying to use, the error message is a symptom of this: when you slice out a 2D grid from a 3D grid, the data are indeed 2D...however, the spatial domain is still 3D so that the "level" information is still available. In order to do the type of computation you want, you must then "flatten" those sliced grids into a simple 2D domain.
For example, this formula achieves what you want:
The "getSliceAtLevel()" function will slice out the 2D grid, but keeps the 3D spatial domain. You then must use the "make2D()" function to convert that to a simple 2D grid so you can then do the arithmetic operations.
Hope that helps.
tom
While I do not have the formula you are trying to use, the error message is a symptom of this: when you slice out a 2D grid from a 3D grid, the data are indeed 2D...however, the spatial domain is still 3D so that the "level" information is still available. In order to do the type of computation you want, you must then "flatten" those sliced grids into a simple 2D domain.
For example, this formula achieves what you want:
Code: Select all
make2D(getSliceAtLevel(T, 850)) - make2D(getSliceAtLevel(T, 500)) + make2D(getSliceAtLevel(TD,850)) -
( make2D(getSliceAtLevel(T,700)) - make2D(getSliceAtLevel(TD,700)) ) - 273.16
The "getSliceAtLevel()" function will slice out the 2D grid, but keeps the 3D spatial domain. You then must use the "make2D()" function to convert that to a simple 2D grid so you can then do the arithmetic operations.
Hope that helps.
tom