[gradsusr] lats4d issues

Matt Brewer mcbrewer83 at yahoo.com
Tue Aug 10 15:07:26 EDT 2010


Thanks for the suggestion Herb. Unfortunately, it does not seem to be the 
solution to my problem. It does change something when I do that, but the problem 
remains that it seems to give me one more array point than I ask for (it gives 
me a 212 x 122 rather than the 211 x 121 matrix that I ask for). As a result, it 
shifts the data around into places it is not suppose to go. I am guessing that 
it has to do with something in the PDEF in my control file, but I really don't 
know what. If anyone else has any ideas....please help!!!!!
Matt Brewer




________________________________
From: "Philbrick, Herb" <Herbert.PhilbrickIII at arcelormittal.com>
To: GrADS Users Forum <gradsusr at gradsusr.org>
Cc: Herb Philbrick <hphilbrick at verizon.net>
Sent: Tue, August 10, 2010 11:09:14 AM
Subject: Re: [gradsusr] lats4d issues

  
I had a similar artifact in grib output from lats4d.
 
My scripts -
1st script downloads  NAM  from Nomads HA and writes flat files with .ctl file
2nd script makes a grib of the flat file.
 
The resulting grib, when re-viewed in grads or commercial programs, had missing 
points on the diagonal from lower left row #2 toward the upper right.  Hence, 
each row was progressively shifted toward the right.
 
The problem was in the lat & lon increments in the .ctl file.     I was using 6 
decimal places.
            Changing the lat & lon increments to 4 decimal places eliminated the 
problem, so far.
 
 
grads-1.9.0-rc1.win32-r3.win32_superpack 
Windows Vista
 
Thank you,
 
Herb Philbrick
 
     voice 219-787-3321
     fax    219-787-2690
     Herb.Philbrick at arcelormittal.com

________________________________
 
From:gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On 
Behalf Of Arlindo da Silva
Sent: Wednesday, August 04, 2010 9:45 PM
To: GrADS Users Forum
Subject: Re: [gradsusr] lats4d issues
 
On Mon, Aug 2, 2010 at 1:59 PM, Matt Brewer <mcbrewer83 at yahoo.com> wrote:
Folks,
>I am using lats4d to convert NCEP's NARR data (grib) to netCDF. It only kind of 
>worked. This is what I type into the command line: 
>
>
>lats4d -i narr-a_221_19790101_0000_000.sub -o narr2009.nc -ftype ctl -lon -160 
>-90 -lat 25 65  -time 0z1jan2009 21z31dec2009 -mxtimes 2920 -levs 925mb -xvars 
>ugrdprs vgrdprs ugrd10m vgrd10m msletmsl prmslmsl
>
>This works fine except for one issue. It seems to be totally messing up the axis 
>dimensions, causing data to be in incorrect lat/lon locations.Notice how I asked 
>for data from 160W to 90W and 25N to 65N, so with the longitude, that is a span 
>of 70 degrees, and for latitude, it is 40 degrees. So I should get back a 
>geopot. height matrix of 121x211 (there are data points every 1/3rd degree). It 
>seems, in matlab at least, that I get an array of 122x212. And so what happens 
>is the first point on the second array actually gets saved in the 212th place in 
>the first array, so the second line starts out with what is supose to be the 
>second point in the array. Make sense? When I put the nc file into grads, it has 
>similar issues as well....so something wierd is going on when I run the lats4d 
>script....I just don't know what. So if anyone has any ideas of what is goin on, 
>please help!!!
 
The first step is to make sure GrADS is reading your GRIB file correctly. Go 
ahead, start GrADS, open your GRIB file, plot it and see if it is doing it 
correctly:
 
ga-> open narr-a_221_19790101_0000_000.sub
ga-> d something
 
If this is pre-projected data, make sure your PDEF is correct. Once you sort 
this out, the netcdf version should produce the same results. (Our regression 
tests do just that: reads a GRIB file, converts to netcdf, then reads the netcdf 
file back and checks if it gets exactly the same values.)
 
One important detail: when asking for help, you need to let us know the 
particular version of grads, lats4d, and your operating system; basically, the 
otput of "q config".
 
   Arlindo
 
 
 
Matt
> 
>
>_______________________________________________
>gradsusr mailing list
>gradsusr at gradsusr.org
>http://gradsusr.org/mailman/listinfo/gradsusr



-- 
Arlindo da Silva
dasilva at alum.mit.edu


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100810/06e429c2/attachment-0003.html 


More information about the gradsusr mailing list