[Thread Prev][Thread Next][Index]

Re: [ferret_users] Transform grid



The only thing to add about RESHAPE is that it only works where no reordering of the axes is needed. In this case the change is from (x,y,z) to (x,y,t), and RESHAPE is appropriate. Consider the data values listed out as a single vector of numbers. RESHAPE only works where a new grid can be imposed on those values without changing their position in the list.

Billy

On Feb 26, 2007, at 2:40 AM, Jaison Kurian wrote:

Hi All,
         Sorry, there was a typo in earlier mail. Please change
the following line

       let sst_mon = RESHAPE(sst_mon,dest_grid)
 as
       let sst_mon = RESHAPE(sst[d=1],dest_grid)

Thanks,

Jaison

On Mon, 26 Feb 2007, Jaison Kurian wrote:

Hi Yun,
The easy way to achieve this is by using RESHAPE function. For
details about this function, please have a look at the user manual,
Ch3 Sec2.3.23.

  RESHAPE function takes two arguments : first one is the original
variable (to be reshaped) and second one is a variable on the destination grid (after reshaping). In your case the Z-axis to be changed to T- axis,
so a procedure as follows will work.

     use HADISST_1_1_SST_2004.nc
     define axis/t=16-JAN-2004:15-DEC-2004:`365.2425/12`/units=days\
/T0=31-DEC-2003 tmonth ! monthly time axis for 2004
     ! now define a variable on the destination grid.
let dest_grid = x[gx=sst,d=1]*0 + y[gy=sst,d=1]*0 + t [gt=tmonth]*0
     ! RESHAPE it....
     let sst_mon = RESHAPE(sst_mon,dest_grid)
     ! assign proper title and units
     set var/title="Hadi Monthly SST 2004"/units="Deg_C" sst_mon
     ! save to a NetCDF file for future use
     sp rm -f Hadi_mon_sst_2004.nc
     save/file=Hadi_mon_sst_2004.nc/APPEND sst_mon

Hope this helps..if you find any problem with this method, please let me know.

Regards,

Jaison

On Mon, 26 Feb 2007 Yun.Li@xxxxxxxx wrote:


Dear All,

I have a copy of monthly HADISST_1_1_SST_2004.nc as follows.

yes? use HADISST_1_1_SST_2004.nc
yes? show data
     currently SET data sets:
    1> ./HADISST_1_1_SST_2004.nc  (default)
 name     title                             I         J         K
L
 T        Fake time                        1:12      ...       ...
...
 LON      Longitude                        1:360     ...       ...
...
 LAT      Latitude                         1:180     ...       ...
...
 SST      SST                              1:360     1:180     1:12
...


Ferret cannot draw the plots properly due to the incorrect grid settings (K =1:12). Could you please help me to transform the grid as the correct
format (L=1:12)? That is,

show data
     currently SET data sets:
    1> ./HADISST_1_1_SST_2004.nc  (default)
 name     title                             I         J         K
L
 SST      SST                              1:360     1:180     ...
1:12


Regards,

Yun Li
CSIRO, Australia





[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement