[Thread Prev][Thread Next][Index]
Re: subsampling of grided data onto point location and time.
Hi Yogesh,
To find the value of CO2_mod which matches a location from your
CO2_sat data set, assuming CO2_mod is data set 1 and CO2_sat
is data set 2, you can define variables based on data set 2 and use
them to choose values from data set 1. For example if you want the
value of CO2_mod at the longitude, latitude location of the15th of
the second data set,
let lon_x = lon[d=2,L=15]
let lat_y = lat[d=2, L=15]
let sampled_data = CO2_mod[d=1,x=`lon_x`, y=`lat_y`]
The grave accents (or back-tic character) force the evaluation
of lon_x and lat_y to single scalar values.
This would give you CO2_mod at one location, and at all of its
original 100 time steps. You can specify a particular time in the
range of the time steps using one or more date strings or time steps
between 1 and 100, for example, if your data includes dates in 2003,
then
list sampled_data[t="12-jan-2003:12:00"]
list sampled_data[L=1:5]
If you want to sample your gridded data at many point locations,
you can use the SAMPLEXY function. To get CO2_mod at the first
1000 the locations in the second data set, and a single date in the
first data set,
let sampled_data = SAMPLEXY \
(CO2_mod[d=1,t="12-jan-2003:12:00"], \
lon[d=2,L=1000], lat[d=2,L=1:1000])
This will result in 1000 values of CO2_mod. (I have broken up
the command line into 3 lines using the continuation character,
the backslash so it is easier to read.)
Now you can compare the two CO2 data sets:
let sampled_data = SAMPLEXY \
(CO2_mod[d=1,t="12-jan-2003:12:00"], \
lon[d=2,L=1000], lat[d=2,L=1:1000])
plot/L=1:1000 CO2_sat - sampled_data
Yogesh K. Tiwari wrote:
Hello Ferret Users,
How I can do the subsampling of a grided data on a given point
location and time.
Both the grided data and point data are in netcdf format.
The grided data looks like, for example :
title I J K L
CO2_mod 1:360 1:180 -- 1:100
here L is time steps.
And point data looks like :
title I J K L
CO2_sat -- -- -- 1:1860206
lat -- -- -- 1:1860206
lon -- -- -- 1:1860206
here L is number of index.
I could not get much help from ferret users guide.
Many thanks in advance,
Regards,
Yogesh
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement