[Thread Prev][Thread Next][Index]

Re: [ferret_users] problem to convert ASCII file to netcdf



Dear Mishra

try this

file/var="xpoints,ypoints" temp.dat
let xdif = xpoints[I=@DDF]
let xcross = xdif[I=@EVNT:0.0415]
list/i=1:5  xpoints,xdif,xcross

LET npts = `xcross[I=@LOC:1]`

DEFINE AXIS/X/UNITS=degrees_east  xaxis = xpoints[I=1:`npts`]

LET total = `ypoints,RETURN=isize`

DEFINE AXIS/Y/UNITS=degrees_south/npoints=`npts` yaxis=ypoints[I=1:`total`]
 

sh axis y/yaxis

! Works try this

def grid/x=xaxis/y=yaxis mygrid

sh g mygrid

- Akshay Hegde




On Thu, May 2, 2013 at 1:38 PM, surja kanta Mishra <surmat84@xxxxxxxxx> wrote:
Dear all,
 
 while I am trying to convert an ASCII file to Netcdf file  for contour plot of temperature.  I have tried as an example is in the following link :
 http://ferret.pmel.noaa.gov/Ferret/faq/reading-ascii-data-representing-a-grid

The error is coming as

 yes?  file/var="xpoints,ypoints" temp.dat 
 yes? let xdif = xpoints[I=@DDF]
 yes? let xcross = xdif[I=@EVNT:0.0415]
 yes? list/i=1:5  xpoints,xdif,xcross

Column  1: XPOINTS
 Column  2: XDIF is XPOINTS[I=@DDF]
 Column  3: XCROSS is XDIF[I=@EVNT:0.0415]
          XPOINTS   XDIF  XCROSS
1    /  1:   86.67  0.042  0.000
2    /  2:   86.71  0.042  0.000
3    /  3:   86.75  0.042  0.000
4    /  4:   86.79  0.042  0.000
5    /  5:   86.83  0.375  0.000

yes?  LET npts = `xcross[I=@LOC:1]`
 !-> DEFINE VARIABLE npts = 55
yes?  DEFINE AXIS/X/UNITS=degrees_east  xaxis = xpoints[I=1:`npts`]
 !-> DEFINE AXIS/X/UNITS=degrees_east  xaxis = xpoints[I=1:55]
yes? LET total = `ypoints,RETURN=isize`
 !-> DEFINE VARIABLE total = 3049
yes? DEFINE AXIS/Y/UNITS=degrees_south yaxis=ypoints[I=1:`total`:`npts`]
 !-> DEFINE AXIS/Y/UNITS=degrees_south yaxis=ypoints[I=1:3049:55]
 **ERROR: improper grid or axis definition: data for DEFINE AXIS/FROM_VARIABLE is not monotonic

temperature data in ascii format is in attached file.

Please help me.
Surja
--
Surja...
...........................................................................................
Surja Kanta Mishra
Junior Research Fellow (CSIR-NET, Funded by UGC)
School of Oceanographic Studies
Jadavpur University
Kolkata - 700032
India.

Contacts: +91 9681091928
Alternate E-mail: sur_km@xxxxxxxxxxx 


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement