[gradsusr] Regridding data and output using fprintf

Wayne Gibson gibson at nacse.org
Mon Oct 4 15:03:33 EDT 2010


  I'm attempting to convert NWS NDFD temperature forecast grid from a 
Lambert projection to Geographic and output as ASCII data.  The steps are:

1) Read in the GRIB2 format data
2) Regrid using the "re" function
3) Output using the "fprintf" function.

The commands I'm using are

define 
transdata=re(xdata,498,linear,-128.854166666667,0.0416666666666666666,266,linear,39.4791666666667,0.0416666666666666666,bl)
fprintf transdata temp.1.asc %g 498 1

It appears that "transdata" is correctly created as I can display the 
data and query the values.  When I output the data using "fprintf" and 
import the data into another GIS package, it appears as though there is 
some type of offset in the data that output that progressively gets 
worse with each row of data output.  For example, the 498 data value in 
row 1 is actually the 1st data value from row 2.

Perhaps I'm not understanding how to use GRADS to achieve my desired 
result, or what I'm attempting is not possible.  Can someone please advise?

Wayne Gibson
Oregon State University


The GRADS ctl file contains
--------------------------------------
dset ^temp.pacnwest.2010100121.grb
index ^temp.pacnwest.2010100121.grb.idx
undef -9.99e+08\ntitle temp.pacnwest.2010100121.grb
*  produced by g2ctl v0.0.4o
* griddef=1:80:(313 x 212):grid_template=30: Lambert Conformal: (313 x 
212) input WE|EW:SN output WE:SN res 0 Lat1 39.494510 Lon1 234.116882 
LoV 265.000000 LatD 25.000000 Latin1 25.000000 Latin2 25.000000 LatSP 
-90.000000 LonSP 0.000000 North Pole (3
dtype grib2
pdef 313 212 lcc 39.494510 -125.883118 1 1 25.000000 25.000000 -95 
5079.406000 5079.406000
xdef 348 linear -128.870536 0.059838388193742
ydef 241 linear 39.494510 0.0461764181818182
tdef 18 linear 21Z01oct2010 3hr
zdef 1 linear 1 1
vars 1
TMPsfc   0,1,0   0,0,0 ** surface Temperature [K]
ENDVARS

Command "q dims" yields
------------------------------------
Default file number is: 1
X is varying   Lon = -128.871 to -108.107   X = 1 to 348
Y is varying   Lat = 39.4945 to 50.5769   Y = 1 to 241
Z is fixed     Lev = 1  Z = 1
T is fixed     Time = 21Z01OCT2010  T = 1
E is fixed     Ens = 1  E = 1




More information about the gradsusr mailing list