[Thread Prev][Thread Next][Index]

Re: [ferret_users] Extract gridded SST data on space-time scatteredbuoy SST data



Hi Theodor,
Just to restate what you said, your variable SST_AMSRE_T has as its x axis a list of indices corresponding to the locations: i=1 is point 1, i=2 is point 2, and so on. It keeps the time axis from the SST variable. When you apply the SAMPLET_DATE function, the result is location 1 at each time, location 2 at each time, and so on. So I see what you mean that you want the diagonal -- location1at time1, location2 at time 2 and so forth.

You are right to think that anytime you find yourself writing a loop in Ferret, there may be a more direct way to do it with Ferret variables. To get the diagonal of the varible you can create a new variable (the concept that you can look up in the Users Guide is masking: IF-THEN-ELSE logic)

! Create variables for the indices of the variable's grid. We will look for I-index = L-index

LET i_index = i[g=sst_amsre_t]
LET L_index = L[g=sst_amsre_t]

LET diag = if (i_index EQ L_index) THEN sst_amsre_t

This variable "diag" has the value of the variable on its diagonal and is missing everywhere else. To turn it into a simple list, use a COMPRESS function. COMPRESSL will put the value from each time at L=1

LET diag_list = COMPRESSL(diag)
LIST diag_list[L=1]


Dr. Theodor Yemenis wrote:

I thank you very much,

I am starting now to undertand what the functions SAMPLEXY, SAMPLET_DATE are doing.
The variable SST_AMSRE_T is still a 2-dim array of space points and time points. What I need is a line.
This line consist of the SST values at the different points where the buoy was at diffent times. This line
must be the diagonal of the SST_AMSRE_T variable. Is this correct? It seems to work.


How can I extract quickly the diagonal of a 2-dim array in ferret? I have done it as follows but
I thinik it is not a good style. I write the diagonal of the SST_AMSRE_T field in a separate file:

REPEAT/i=1:`(IEND)` LIST/FILE=SST_EXTRACTED_BUOY_($BUOY_NR).dat/NOHEAD/APPEND SST_AMSRE_T[i=`i`,l=`i`], SST_REYNOLDS_T[i=`i`,l=`i`]

many thanks again for the help
Theodor


Ansley Manke wrote:

Hi Theodor,
In your definition,

LET SST_AMSRE_T = SAMPLET_DATE(SST_AMSRE_XY,2005,MONTH[D=3],DAY[D=3],12,0,0)

The arguments year, month, day, hour, minute, and second should all have the same length. Set up variables year, hour, minute, day with the same number of points as MONTH and DAY:

let year = 2005 + 0*month[d=3]
let hour = 12 + 0*month[d=3]
let minut = 0*month[d=3]
let secnd = 0*month[d=3]

and then

LET SST_AMSRE_T = SAMPLET_DATE(SST_AMSRE_XY,year,MONTH[D=3],DAY[D=3],hour,minut,secnd)

I realize that the example in the Users Guide probably led you to call the function with the single 0's in some of the arguments. I have changed the Users Guide to reflect what the function does.

Ansley

Dr. Theodor Yemenis wrote:

Hi Ferreters,

I want to compare BUOY-SST data with satellite SST data.

The buoy data are in ascii format. I read them in FERRET with:

! -------------------------------------------------------------------------
! -------------------------------------------------------------------------
! -------------------------------------------------------------------------
! READ BUOY VARIABLES ( SST )

set data/ez/skip=10/var="No, Buoy, Deziday, Year, Month, Day, Hour, Minute, Se, P, TEMP, SST, Lat, Lon, UW, VW" argos_lofzy05_000($BUOY_NR).dat

SET VARIABLE/BAD=8192.0/UNITS="grad C" SST[d=3]
! -------------------------------------------------------------------------

sh da

3> ./argos_lofzy05_00009.dat
name title I J K L
NO NO 1:4967 ... ... ...
BUOY BUOY 1:4967 ... ... ...
DEZIDAY DEZIDAY 1:4967 ... ... ...
YEAR YEAR 1:4967 ... ... ...
MONTH MONTH 1:4967 ... ... ...
DAY DAY 1:4967 ... ... ...
HOUR HOUR 1:4967 ... ... ...
MINUTE MINUTE 1:4967 ... ... ...
SE SE 1:4967 ... ... ...
P P 1:4967 ... ... ...
TEMP TEMP 1:4967 ... ... ...
SST SST 1:4967 ... ... ...
LAT LAT 1:4967 ... ... ...
LON LON 1:4967 ... ... ...
UW UW 1:4967 ... ... ...
VW VW 1:4967 ... ... ...


The satellite data are defined in a regular .25 degree grid.
My region is the norwegian sea and the time interval FEB-AUG 2005: SET REGION/X=10W:26E/Y=60N:76N/T=1-FEB-2005:10-AUG-2005


! -------------------------------------------------------------------------
! READ THE SST TMI/AMSR-E DATA

USE sst.tmi_amsre.LOFZY05.long.cdf
! -------------------------------------------------------------------------

sh da
2> ./sst.tmi_amsre.LOFZY05.long.cdf
name title I J K L
SST TMI/AMSR-E SST 1:144 1:64 ... 1:1180


Now I want to extract the satellite data to the irregular space and
time positions of the buoy data.

I tried:

LET SST_AMSRE_XY = SAMPLEXY(SST[D=2],LON[D=3],LAT[D=3])
LET SST_AMSRE_T = SAMPLET_DATE(SST_AMSRE_XY,2005,MONTH[D=3],DAY[D=3],12,0,0)

but it doesn't work.

The variable SST_AMSRE_XY is a two dimensional array (time,points),
the second variable SST_AMSRE_T is a one-dimensional array, but the
extracted values belong all to the first time-point MONTH[D=3,i=1],DAY[D=3,i=1].

I would very much appreciate if someone can help me to extract the
satellite data correctly in space and time?

Theodor





[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement