[Thread Prev][Thread Next][Index]

Re: (corrected mail)....use of scat2grid command(help)



Hello Jaison,

Many thanks for help.

The attched script wrote by you solved the problem and works fine.

Regards,
Yogesh


 Kurian wrote:
Hi Tiwari,
Your mail serves as a good reminder. It seems that
the scattered or point data is defined over 2-3 days. So the
only way possible is take all the scattered data assuming the
mean time.

Have a look at the attached jnl file (regrid2reg.jnl). If it
is working fine and you are through, then post a summary to the
mailing list for the reference of other users. Or if you have
any problem, let me know.

with regards
Jaison

On Wed, 29 Dec 2004, Yogesh K. Tiwari wrote:


Hello,

This question once I asked in the list but could NOT
solve my problem.

I would be happy if you can help me.

I want to use scat2grid command to convert 1-d point data in to
2-d grided data,

################################
The point data looks like :-

     currently SET data sets:
    1> ./CO2_January_2003.nc  (default)
 name     title       I         J         K         L
 YEAR                ...       ...       ...       1:186039
 MONTH               ...       ...       ...       1:186039
 DAY                 ...       ...       ...       1:186039
 HOUR                ...       ...       ...       1:186039
 MINUTE              ...       ...       ...       1:186039
 LON                 ...       ...       ...       1:186039
 LAT                 ...       ...       ...       1:186039
 CO2_T                 ...       ...       ...     1:186039


###########################
The grided data which I want to convert from above
should be like:-

     currently SET data sets:
    1> ./ecmwf_co2_jan2003.nc  (default)

 name     title        I         J         K         L
 LON                  1:360     ...       ...       ...
 LAT                  1:180     ...       ...       ...
 CO2_T                1:360     1:180     ...


Many thansk for your help.

Regards,
Yogesh



------------------------------------------------------------------------

\ cancel mode verify
!
! dataset 1 contains the gridded data(ecmwf_co2_jan2003.nc)
! dataset 2 contains the scattered/point data (CO2_January_2003.nc)
! ! grid for dataset 1 is 360x180
! lat and lon is given in seperate variables for the dataset 1.
! !
!---------------------------------------------------------

! open datasets

set data ecmwf_co2_jan2003.nc ! keep the order of datasets
set data CO2_January_2003.nc ! unchanged

! define destination axes from lat and lon in ecmwf_co2_jan2003

define axis/x/units=longitudes/from_data xlon=lon[d=1]
define axis/y/units=latitudes/from_data ylat=lat[d=1]
define grid/x=xlon/y=ylat gcom

! regrid the variable co2_t in ecmwf_co2_jan2003 to regular lat-lon grid

let co2_ecmwf = co2_t[d=1,g=gcom@ASN]
set var/title="CO2 from ECMWF"/units="ppmv" co2_ecmwf

! regrid the co2_t in CO2_January_2003.nc to the above grid using scat2grid

! define the radius and cutoff values for scat2grid function

define symbol radius = 0.25 ! ideal values for a 0.25 grid define symbol cutoff = 2.0 ! with possible minimum interpolation errors
let lon_1D = XSEQUENCE(lon[d=2])
let lat_1D = XSEQUENCE(lat[d=2])
let co2_1D = XSEQUENCE(co2_t[d=2])
let co2_obs = scat2gridgauss_xy(lon_1D,lat_1D,co2_1D,\
x[gx=gcom],y[gy=gcom],($radius),($radius),($cutoff),($cutoff))
set var/title="CO2 from Obs."/units="ppmv" co2_obs

! now the variables co2_ecmwf & co2_obs will be on the same grid and
! you can compare both. If you want to save this to a new NetCDF file
! (strongly recommended)

! sp rm -f co2_ecmwf_obs.nc
! save/file=co2_ecmwf_obs.nc/append co2_ecmwf,co2_obs


--

===========================================
Yogesh K. Tiwari,
Max-Planck Institute for Biogeochemistry,
Beutenberg Campus, Hans-Knoell-Strasse 10,
D-07745 Jena,
Germany

Office   : 0049 3641 576376
Home     : 0049 3641 223163
Fax      : 0049 3641 577300
Handy    : 0049 173 698 8789
e-mail   : yogesh.tiwari@bgc-jena.mpg.de
===========================================




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement