[Thread Prev][Thread Next][Index]

Re: ASCCII, [Fwd: Lessons about scatter2grid*, ie gridding point data]



Hi Guille,

seems you ran into similar problems Lev had a while ago -
I have appended her mail below.

>From that, I figure, you should try:

DEFINE AXIS/x=1:ndata:1 ndat      ! ndata no of data points
define grid/x=ndat gin
FILE/VAR="long,lat,data" /GRID=gin sourcemodif.txt
gridata=
scatter2gridgauss_xy(long,lat,data,x[gx=40:50:5],y[gy=70:80:5],2.)

I did not test it, though...

Your approach:

yes? DEFINE AXIS/X=40:50:5 xlong
yes? DEFINE AXIS/Y=70:80:5 ylat
yes? DEFINE GRID/X=xlong/Y=ylat gridata
yes? FILE/VAR="long,lat,data"/GRID=gridata sourcemodif.txt

ran into trouble in this line already, because here you tell ferret,
that all the variables, long,lat,data, are on the 2-d grid griddata and
ferret will expect to read them in an appropriate order from the file.

yes? LET gridata= scatter2gridgauss_xy(long,lat,data,xlong,ylat,2.)
yes? CONTOUR gridata
 **ERROR: variable unknown or not in data set: YLAT

ylat is only the name of the new axis you like to use and not a variable
for ferret. 

The original grid your data are on is just one linear axis, as Lev
points
out below.

For the terms x[gx=40:50:5],y[gy=70:80:5] have a look at the sections
about regridding and dynamic axes in the user guide.
http://ferret.wrc.noaa.gov/Ferret/Documentation/Users_Guide/v50/index.html

Good luck,
Joerg


Lev Tarasoff wrote:
> 
> A clarification for those gridding point data with scatter2grid*: make
> sure that your input data is in array (and not matrix) form. The function
> will not reshape matrices into arrays (and the gridding messes up). So to
> grid a set (array, or matrix) of point data, use the following general
> approach:
> 
> yes? define axis/x=1:(number of points):1 x1
> yes? define grid/x=x1 gin
> yes? FILE/VAR="xlong,ylat,data" /GRID=gin my_input_data_file
> !also ensure that longitude is >0. Ferret generally doesn't like
> longitude<0
> 
> yes? Let gridded_data= scatter2gridgauss_xy(xlong,ylat,data,
>      x[gx=new_xaxis], y[gy=new_yaxis], cutoff_parameter)
> !smaller cutoff_parameter => less smoothing
> 
> Also, I've run into memory(?) problems with scatter2gridlaplace_xy
> when gridding a large number of points (at least on RH linux
> 6.0). However, scatter2gridgauss_xy has been quite stable for me.
> 
> cheers
> 
> Lev Tarasoff -  Dept of Physics, University of Toronto,
>                 60 St. George St., Toronto, Ontario, CANADA, M5S 1A7
>                 Tel (416)-946-3019  Fax (416)-978-8905
>                 email: lev@atmosp.physics.utoronto.ca

--
Jörg Kaduk                            Tel.: 1 650 325 1521 x 416
Carnegie Institution of Washington    FAX: 1 650 325 6857
Dept. of Plant Biology
260 Panama Street                     joerg@jasper.stanford.edu
Stanford, CA 94305-1297               http://Jasper.Stanford.EDU/joerg/


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement