[Thread Prev][Thread Next][Index]

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



Thanks, Bill. Both work for me. Have a good day! -Haoping

William S. Kessler wrote:
You need to use the @ASN syntax:

let ssh = ssh_old[g=newgrid@asn]

@ASN means "blindly associate" with the new axis.

Actually, I am not sure if the above will work, or perhaps you need to do it axis by axis:

let ssh = ssh_old[gx=iaxis@asn,gy=jaxis@asn]

BK

On 06 Dec 2011, at 9:37 AM, Haoping Yang wrote:

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