[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20030528: IDV questions - pressure grid from other grid



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
****************************************************************************