[Thread Prev][Thread Next][Index]

Re: [ferret_users] creating, shading, wrting a data subset



Something like this:

let xx=x[gx=data1]; let yy=y[gy=data1]
! make a mask function that is 2 over a rectangle encompassing S America, else zero or 1
let x1=if xx gt (-80) then 1 else 0; let y1=if yy gt (-60) then 1 else 0
let x2=if xx lt (-30) then 1 else 0; let y2=if yy lt 10 then 1 else 0
let mask=x1*y1+x2*y2
let southamericaonly=if mask eq 2 then data1 else 0 ! only S America, else 0

Now do the opposite for your other data set, then add them.

Billy K

let southamerica

On 8May 2008, at 2:15 PM, Pierre Sepulchre wrote:

Hi Ferreters,

I have an easy question.

I have two datasets defined over the same grid (the entire globe).
I would like to take the values of dataset A for a defined region (let's say South America) and "paste" them to replace the values of dataset B for the region considered.

[ Then I would like to write the new composite variable in a netcdf file. ]

I might have missed something in the documentation, because I tried something like :

------------------------------------
LET varA = [d=Adata.nc, l=1]
LET varB = [d=Bdata.nc, l=1]

DEFINE region/x=-100:-30/y=-60:20 mysubregion

let varC = varA[@mysubregion] !Here I try to define the new variable with values of varA over the region I am intersted in, and "novalues" everywhere else. let varD = if varC GT 0 then varC else varB ! Then, through a quick test, I create the ultimate variable with varA values over the subregion and varB values everywhere else.
-------------------------------------
... but it doesn't work. I guess it's not the proper way to do it.

Any clues ?

Thanks a lot,
Pierre


<pierrese.vcf>



[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement