[Thread Prev][Thread Next][Index]

Re: [ferret_users] Ascii and scatteredgridgauss



Hi Françoise,
In this case, you want to read the data as a simple list of triples, (lon, lat, sst) and then use the scat2gridgauss function to put them onto a grid defined by your axes.  So you do not want to define a 2D grid to read in the data.
     ! Read in the data, which will just be on an
     ! abstract 1-dimensional axis
yes? SET DATA/EZ/VARIABLES="lon,lat,sst" scat_test.dat

     ! Define axes for the result of scat2gridgauss_xy 
yes? DEFINE AXIS/x=-24:49:0.5 lons
yes? DEFINE AXIS/y=31:60:0.5 lats

yes? LET gsst = scat2gridgauss_xy(lon,lat,sst, x[gx=lons],y[gy=lats], 1.,1.,2.,0)
yes? SHADE gsst

You could improve on this by adding /UNITS=deg to the axis definitions, and perhaps this before plotting:
yes? SET VAR/units="Deg C"/Title="description of the data" gsst
Then, if you save gsst to a netCDF file, the dataset will be self-documenting.

Another useful command as you're exploring data like this is PLOT/VS which makes a point at each of the locations. It's a good way to see the range of the location data and how the points are arranged.
yes? PLOT/VS/title="PLOT/VS lon,lat" lon, lat
For your general question, the issue with ASCII data is that one has to convey the shape of the underlying grid to the program. This is always a problem to be solved, whether you're using existing software or writing your own code. I would suggest studying how to read ASCII data by working through the examples in Chapter 2 of the Ferret Users Guide, http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/data-set-basics/ASCII-DATA  and build up some example scripts for yourself. Probably the kinds of ascii data you're dealing with will fall into a few categories and you'll soon have several tools to read various ascii files.

We do not have much experience with GRIB files. The libraries Ferret uses for netCDF and OPeNDAP data do not directly read GRIB formatted data, but it's my understanding that Ferret can read GRIB data if it is on a a GrADS/DODS Server (GDS) or THREDDS data Server (TDS).  The server reads the data and sends it to Ferret in the OPeNDAP protocol, and then from Ferret's point of view it's just like a netCDF file.

Ansley

orain wrote:

hello,
I'm a beginner in Ferret for ASCII files

I've a file ASCII lon lat sst , but lon lat are not on regular grid ( Lambert projection from model )
I want to have a lon lat sst regular on a picture , so I thought using scat2gridgauss_xy but I've got some trouble.

I am not sure I well understood the way of using scat2gridgauss, and perhaps it is'nt the answer to my problem .
Could you help me ?

1) Here it is my .jnl

DEFINE AXIS/x=-24:49:0.5 lons
yes? DEFINE AXIS/y=31:60:0.5 lats
yes? DEFINE GRID/X=lons/Y=lats grilles
yes? SET DATA/EZ/VARIABLES="lon,lat,sst"/COLUMNS=3/GRID=grilles test
yes? LET gsst = scat2gridgauss_xy (lon, lat, sst , x[gx=lons], y[gy=lats], 1.,1.,2.,0)
yes? shade gsst

2)
my file is test  the joined piece

sorry for this simple question but we often have to compare netcdf data (easy for Ferret)  ocean file to meteo data  ASCII : lon lat not regular (not easy for ferret ) or GRIB (not simple at all) for me ?

Thanks for your help
Françoise Orain

GIF image

GIF image


[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement