This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Charlie,
> 1. I'm doing a calculation of kinetic energy using
> the u and v wind fields from the ETA model,
> but I need to calculate the air density and for that I need
> the temperature which is no problem but also the pressure.
> Is there any way to access pressure value of an isobaric
> surface to include it as a variable in the calculation?
use this Jython method.
def extractPressureFromNWPGrid(fieldimpl):
"""get pressure coordinate grid from a VisAD FieldImpl
(a time series of one or more FlatFields);
user must be sure input is a suitable FlatField. """
#import methods from ucar code
from ucar.unidata.data.grid.DerivedGridFactory import *
#import FlatField and FieldImpl class from visad code
from visad.FlatField import *
from visad.FieldImpl import *
# get the first grid from the FieldImpl
ff = fieldimpl.getSample(0)
return DerivedGridFactory.createPressureGridFromDomain(ff)
The input grid "fieldimpl" can be any model output grid from
say Eta or RUC that has the grid x-y-pressure structure you are using.
It could be the same grid you get temperature from.
Stu
--
****************************************************************************
Unidata User Support UCAR Unidata
Program
303 497 8643 P.O. Box
3000
address@hidden Boulder, CO
80307
----------------------------------------------------------------------------
Unidata WWW Service
http://my.unidata.ucar.edu/content/support
****************************************************************************