[Thread Prev][Thread Next][Index]

Re: [ferret_users] regriding problem



Hi Yogesh,
If the data is already regridded to a 1x1 degree grid, then you do not need to do anything else but redefine the X and Y axes of the first dataset to have units of degrees longitude and latitude. But what you sent looks as if the FGCO2 variable and the LON and LAT coordinate variables in the second dastaset form a variable on a curvilinear grid.  So  you might want to ask more about this.


First, in your call to curv_to_rect_map, the longitude and latitude curvilinear coordinates are in the second dataset.

   yes? let lonin = lon[d=2]
   yes? let latin = lat[d=2]
   yes?  let map = curv_to_rect_map ( lonin,latin,lonlatout,0.5)


One can use the SCAT2GRID functions to regrid data of this kind onto a rectilinear grid. This treats all the points as if they are just scattered locations and doesn't take into account that they are on a grid.  But it will work.

The first 3 arguments sent to SCAT2GRIDGAUSS_XY are XPTS, YPTS, F  where XPTS and YPTS are 1-D lists of points and F has as its X dimension a list of points in the horizontal direction and can be a function of Z and/or T.

So you would set  up variables that unravel the xy dimensions of lon[d=2], lat[d=2], and fgco2[d=1] into 1D lists in the x direction, and use those in the regridding.  The x dimension is length 182 and y dimension is 149 so this new 1D list is 182*149.

yes? let nxy = 182*149
yes? define axis/x=1:`nxy`:1 xaxis
yes? let xx = x[gx=xaxis]

yes? let xpts = RESHAPE(lon2[d=2], xx)
yes? let ypts = RESHAPE(lat[d=2], xx)

! Define a variable that  is a 1D list the length of xy  and the same as FGCO2 in t
yes? let xtvar = x[gx=xaxis]  +  t[gt=fgco2] 
yes? let fpts  = RESHAPE(fgco2[d=1], xtvar)

... define the axes for the destination grid
yes? let regridded_fgco2 = SCAT2GRIDGAUSS_XY(xpts, ypts, fpts, ...



Yogesh Tiwari wrote:
Hi Ansley,
Thanks,
I think the data is not on a curvilinear grid because the person who sent me the data
mentioned that he has regridded the data onto a 1x1 degree grid with the Ferret function
SCAT2GRIDGAUSS_XY(). Please let me know how I to use this?

Also, when I tried the CURV_TO_RECT_MAP, this is what I get.

currently SET data sets:
   1> ./IPSL_HIST_A2_fgCO2_1980_
2009_2D.nc  (default)
 name     title                             I         J         K         L
 FGCO2    air-to-sea CO2 flux              1:182     1:149     ...       1:360

yes? define axis/x=40:110:1/modulo/units=degrees xax
yes? define axis/y=0:30:1/modulo/units=degrees yax
yes? let lonlatout = y[gy=yax] + x[gx=xax]
yes? let lonin = lon_fgco2[d=1]
yes? let latin = lat_fgco2[d=1]
yes?  let map = curv_to_rect_map ( lonin,latin,lonlatout,0.5)
yes? save/clobber/file=io_map.nc map
 **ERROR: variable unknown or not in data set: LAT_FGCO2[D=1]

Thanks,
Aparna



On Fri, Apr 30, 2010 at 9:38 PM, Ansley Manke <Ansley.B.Manke@xxxxxxxx> wrote:
Hi Yogesh,
If I understand correctly, the model data is on the curvilinear grid defined by the second dataset you open in your example . Is that correct? To work with data on a curvilinear grid you can either regrid it to a rectilinear grid using the CURV_TO_RECT_MAP and CURV_TO_RECT functions; or to find the index ranges corresponding to longitude/latitude regions, use the methods in this FAQ. How can I plot a subset of my curvilinear data?
at http://ferret.pmel.noaa.gov/FERRET_17sep07/FAQ/custom_plots/subsetting_curvi_data.html

Looking back, the curvilinear regridding functions became available in Ferret v5.8, so you will have these; however there have been some more recent improvements such as the /MODULO qualifier on the SHADE and FILL commands so you might do well to upgrade to a more recent version of Ferret.

Ansley

 
Yogesh Tiwari wrote:
Hello Ferret Users,
I am using Ferret 5.81 on RedHat Linux

I am trying to get output data from a model where the results are in an irregular grid.
After following the method explained below, when I try to get the dataset for my region of
interest (40E:110E/0-30N) ferret keeps looking for data in the irregular grid. I want to
plot the time series, climatology etc for the dataset in the regular grid

use "http://dods.extra.cea.fr/cgi-bin/nph-
dods/data/p48bopp/CARBOOCEAN/IPSL/HIST_A2/fgCO2/IPSL_HIST_A2_fgCO2_1980_2009_2D.nc"
show data
fill fgCO2[x=1:182,y=1:149,l=1]
use "http://dods.extra.cea.fr/cgi-bin/nph-dods/data/p48bopp/CARBOOCEAN/GRID/IPSL_grid.nc"
let lon2 = if lon gt 360 then (lon-360.) else lon
shade/key/hlim=40E:100E/vlim=0:30N fgco2[x=1:182,y=1:149,l=1,d=1],lon2[d=2],lat[d=2]

So after this how do I
1. list the basin averaged values for certain time period of the data in the regular grid?
2. get time-series/climatology for particular region and time period of the data in the
regular grid?

Thanks for the help,
Yogesh




--
Yogesh K. Tiwari (Dr.rer.nat),
Scientist,
Indian Institute of Tropical Meteorology,
Homi Bhabha Road,
Pashan,
Pune-411008
INDIA

Phone: 0091-99 2273 9513 (Cell)
        : 0091-20-25904350 (O)
Fax    : 0091-20-258 93 825

[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement