[Thread Prev][Thread Next][Index]

Re: [ferret_users] Reading data from netcdf file and wirting data into ascii file for required region

     Basically, Ferret was writing out data for x-coordinates at
0.25 interval (to confirm, please check the total number of lines
in the final ascii output), but there was some precision issue,
which resulted in rounded up numbers.

  Ok. To get the desired ascii file, you don't have to use a 
repeat loop. Just set the desired region and use list command. The
advantage with this method is that, in the ascii file, the lon values
will vary faster than that of lat, which is appropriate. Here is an

      set data 501.nc
      set reg/x=60:90/y=-6:26/l=1/k=1
      sp rm -f text.dat ! remove previous versions
      list/format=(3F10.3)/file=text.dat/nohead/append x[gx=u10], y[gy=u10], u10

 Ok. If you are specific about using repeat loop, then note that,
inside the repeat loop over X, at each step, X will have only one 
value and hence you don't have to specify it explicitly like var[x=`x`].
In this set up, the lat will vary faster than lon in the ascii file,
which is not convinient to read-back. Here is an example

      set data 501.nc
      sp rm -f junk.dat
      repeat/x=60:90:0.25 (list/format=(3F10.3)/file=junk.dat/nohead/append
x[gx=u10], y[gy=u10], U10) 

Please let me know, if you have any questions,

Wish you all a happy new year 2008.....


On Sat, 29 Dec 2007 17:23:05 +0530, M.V.Ramana Murthy wrote
> Dear Members,
> we want to read netcdf file containing wind (U10 and V10) and write 
> to grid  and xyz format.  we could read and write the file but we 
> see some errors in writing.
> The original data is at 0.25 deg grid with  an extent (  long 29.9E 
> to 120.1E and Lat 60.1S to 30.1 N) and we would like to get ascii 
> data for the region (  long 60Eto 90Eand Lat -6 to 26 N) at 0.25 
> deg. The output file gives long at 1 deg and Lat at 0.25 deg . The 
> *.jnl file  and data file , we used is enclosed.
> Could you suggest how to get the data at 0.25 deg for both longand 
> lat and to write the data in marix format .
> Thanks in advance.
> N.T.Reddy
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement