[Thread Prev][Thread Next][Index]

Re: [Fwd: Re: NetCDF Toolbox]



Hi David,

> 
> yes? show data
>      currently SET data sets:
>     1> /home/server/scratch/oxilia/netcdf/posum_test.cdf  (default)
>  name     title          I         J         K         L
>  XC                     1:275     1:2       1:1       1:199
> 
> My question is: How do I define a VARIABLE grid x(j)? 

Actually, what you want is a new VARIABLE xpos(i,j) which can be used with
the new 3 variable version of SHADE (contour or fill)  in Ferret if you want
to contour in the x-y plane.

If you only want to plot in the x-t plane the you can either use the new shade
etc. or define an x-axis using the 'from_data' qualifier. 

You need to treat the x 'axis' as an abstract axis. I'll include the relevant
lines below.

> > % ------------------------------------------------------------
> > % Dimensions
> > nc('one') = 1;
> > nc('latitude') = iymax;
> > nc('t') = 2*m-1;
> > nc('x') = n;

> > 
> > % Axes & Variables
> > nc{'latitude'} = 'latitude';                    % an axis
> > nc{'t'} = 't';                                  % an axis


%Up to here is OK


% Delete this

%> > nc{'x'} = {'one','one','latitude','x'};         % a 4D axis !!

% Forget about x. What we want is a new variable xpos.


nc{'xpos'}={'one','one','latitude','x'};




> > nc{'XC'} = {'t','one','latitude','x'};          % a >4D variable?!

Nope. It's 4-d now.

> > 
> > % Attributes
> > nc{'latitude'}.units = 'degrees';
> > nc{'t'}.units = 'days';

% OK this is now 'xpos' rather than 'x'      



nc{'xpos'}.units = 'km';




> > nc{'XC'}.units = ' ';
> > nc{'XC'}.long_name = 'Time-Longitude Lagged Cross-Correlations';
> > 
> > % Write data
> > nc{'latitude'}(:) = yax;                        % a vector
> > nc{'t'}(:) = tlax;                              % a vector

% Here too.

nc{'xpos'}(:) = XLAX;                              % a 4D array


> > nc{'XC'}(:) = CA;                               % a 4D array
> > % ------------------------------------------------------------
> > 

Now when you do a SHOW DATA in Ferret you should see a new variable
'xpos'

You may need a new version of Ferret to proceed (V4.9 or later), earlier
versions work for the alternative method below.

to contour (shade or whatever)

SHOW DATA

     currently SET data sets:
    1> ./temp.nc  (default)
 name     title                             I         J         K         L
 XPOS                                      1:275     1:2       1:1       1:1
 XC       Time-Longitude Lagged Cross-Cor  1:275     1:2       1:1       1:199
 


! Create x,t grid the same size as XC

let time=t[g=xc]+0*xc
let lat=xpos+0*xc

! Now use 3 variable contour for first latitude

set win 1
contour/i=1:275/j=1/k=1/l=1:199 xc,lat,time

! Now second

set win 2
contour/i=1:275/j=2/k=1/l=1:199 xc,lat,time

! Alternatively, define an axis from the data itself

set win 3
define axis/from_data/x/name=myx1/unit=km xpos[i=1:275,j=1]
contour/i=1:275/j=1/k=1/l=1:199 xc[gi=myx1@asn]

set win 4
define axis/from_data/x/name=myx2/unit=km xpos[i=1:275,j=2]
contour/i=1:275/j=2/k=1/l=1:199 xc[gi=myx2@asn]



Cheers,

Russ Fiedler


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement