[Thread Prev][Thread Next][Index]

[ferret_users] How to compute correlations in the averaging



Hello Ferret Users,

Tow days back I posted a question on ferret
list but I did't get any help reply. I fell I
was not very clear in my question. I am
asking the question again in clear way..

I am griding folowing point data


name  title  I    J   K     L
co2         ...  ..  ..  1:119641
ERROR       ...  ..  ..  1:119641


to a following monthly mean 1x1 grid data.


name  title  I       J      K     L
co2         1:360  1:180   ...    ...
ERROR       1:360  1:180   ...    ...

The griding script is attched and it works
perfect.

Now Instead of taking the simple average of
the gridded ERROR data for each gridbox, I
want to compute correlations in the averaging.

Kindly Can any one suggest to change in the
attached script by which I can compute
correlations in the averaging and can save
the variable.

Many thanks,

Regards,
Yogesh


-- 

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

Office   : 0049 3641 576 376
Home     : 0049 3641 223 163
Fax      : 0049 3641 577 300
Cell     : 0049 1520 459 1008

Alternate:
e-mail   : yogesh.mpi@gmail.com
id's
         : yogesh.mpi@rediffmail.com
===========================================
! open datasets

     set data ecmwf_co2_jan2003.nc
     set data CO2_January_2003.nc 

! 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


! for d=2 :  select time "L" points only when nchan=18

     let l_nchan_18 =  IF nchan[d=2] EQ 18 THEN L[GT=nchan,d=2]
     let l_good_all =  COMPRESSL(l_nchan_18)
     let l_good     =  l_good_all[l=1:`l_good_all[l=@NGD]`]

! now sample along these "L" indices

     let lon_good    = SAMPLEL(lon[d=2],l_good)
     let lat_good    = SAMPLEL(lat[d=2],l_good)
     let co2_good    = SAMPLEL(co2[d=2],l_good)

     let error_good  = SAMPLEL(error[d=2],l_good)


! 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_good)
     let lat_1D = XSEQUENCE(lat_good)
     let co2_1D = XSEQUENCE(co2_good)

     let error_1D = XSEQUENCE(error_good)

!define the function to count the observed value in each 1x1 grid

     let obs_count = scatgrid_nobs_xy(lon_1D,lat_1D,x[gx=gcom],y[gy=gcom])

!griding co2 using the mask if there is atleast 10 observations in one grid

     let co2_point = IF obs_count GE 10 THEN\
                     scat2gridgauss_xy(lon_1D,lat_1D,co2_1D,\
                     x[gx=gcom],y[gy=gcom],($radius),($radius),($cutoff),($cutoff))

!griding co2 using the mask if there is atleast 10 observations in one grid

     let error_point = IF obs_count GE 10 THEN\
                       scat2gridgauss_xy(lon_1D,lat_1D,error_1D,\
                       x[gx=gcom],y[gy=gcom],($radius),($radius),($cutoff),($cutoff))



sp rm -f airs_dec_grided_point_data.nc
save/file=airs_dec_grided_point_data.nc/append  co2_point,error_point


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement