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.
Hi Bill- > Full Name: bill fingerhut > Email Address: address@hidden > Organization: lyndon state college > Package Version: 2.4 build date:2007-12-20 16:34 UTC > Operating System: Windows XP > Hardware: Java: home: C:\Documents and Settings\waf01060\Program > Files\IDV_2.4\jre version: 1.5.0_11 j3d:1.3.2 fcs (build12) > Description of problem: Hi guys, > > I would like to subtract two grid fields from different data sources, but the > most obvious > method is failing. Rather than try everything I can think of, I thought you > could point me > down the correct path. > > One data source is a netcdf file I created and downloaded from the CDC > website. I'll attach > it. It contains mean geopotential height at 250 mb over the Northern > Hemisphere. > > The second data source is the latest NCEP GFS Northern Hemisphere model run > from > Mothelode, in grib format. I want to use the geopotential heights at 250 mb > at all > available times, in other words, I want to subtract the single mean grid from > several > forecast grids - one for each forecast time. > > The method I attempted to subtract them, is the formula under miscellanous > for a > simple difference a-b. I guess the fields are not similar for some reason, > name or > unit or ... ? > > Anyway, I would think that this is something that other people would find > useful and > would definitely add to the unique abilities of the IDV. So, it would be nice > to be able > to accomplish this task easily and intuitively. Please advise. There are several issues involved here that don't make this as easy as a-b: - the times don't match up. - the standard grid from CDC is a 2D grid (there is Z dimension to indicate that it is at 250 hPa). - the standard grid has units of meter while the GFS data is geopotential meters. So, to make this work, you need to: - make the 250 mb slice from the GFS into a 2D slice. You can do this using the make2D Jython method. - change the units to match. The simplest way would be to just assume that the standard grid is really geopotential meters and use the newUnit Jython method. - since there is only one time in your CDC grid, it will be resampled to the times of the GFS data. So, you could create a formula that would be: make2D(gfs)-newUnit(cdc,"z","gpm") That would work for this case. For gfs, you would use the geopotential height at pressure grid, subsetting for the 250 hPa level. For cdc, select your CDC grid. There's no generic way to do this. Don Ticket Details =================== Ticket ID: BUU-416829 Department: Support IDV Priority: Normal Status: Open