[Thread Prev][Thread Next][Index]

[ferret_users] modify argument list of a variable (e.g. SSH)



Dear ferreters,

Here I use a simple example to describe my problem. A netcdf dataset OLD.nc contains:
------------------------------------------------------------
dimensions:
       Longitude = 271 ;
       Latitude = 193 ;
variables:
       float Longitude(Longitude) ;
       float Latitude(Latitude) ;
       float SSH_OLD(Latitude, Longitude) ;
------------------------------------------------------------
yes? use OLD.nc
yes? show data
    currently SET data sets:
   1> ./iarchv.2011_001_00_2d.nc  (default)
name     title       I         J         K         L
SSH      SSH         1:271     1:193     ...       ...


Now I wanna use ferret to generate a new netcdf file NEW.nc with a new list of arguments for the variable SSH. I mean I want to simply express SSH as a function of iaxis (1,2,3,...,271) and jaxis(1,2,3,...193) to replace SSH_OLD(Latitude, Longitude):
------------------------------------------------------------
dimensions:
       iaxis = 271 ;
       jaxis = 193 ;
variables:
       int iaxis(iaxis) ;
       int jaxis(jaxis) ;
       float SSH(jaxis, iaxis) ;
------------------------------------------------------------

I tried to use the section below but it doesn't work and gives me a file with wrong data.
yes? define axis/x=1:271:1 iaxis
yes? define axis/y=1:193:1 jaxis
yes? define grid/x=iaxis/y=jaxis new_grid
yes? let SSH=SSH_OLD[d=1,g=new_grid]
yes? save/file="NEW.nc" SSH

Can anyone show me a few ferret scripts that might be able to get the expected NEW.nc?

Many thanks!

Haoping


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

Privacy Policy | Disclaimer | Accessibility Statement