[Thread Prev][Thread Next][Index]

Re: [ferret_users] how to set a discontinuous region



You could use a mask to do this. The trick is to figure out a way to setup
an array with 1's where you want values and missing values where you don't.
Then, multiply your data arrays by the mask before plotting or doing
statistics.

Here is an example with a terrain file that comes with Ferret...

use etopo120
let lat = y[g=rose] + rose*0

let mask_north1 = if lat gt 20 then 1 else 0
let mask_north2 = if lat lt 40 then 1 else 0
let mask_north  = if mask_north1 eq mask_north2 then 1 else 0

let mask_south1 = if lat lt (-20) then 1 else 0
let mask_south2 = if lat gt (-40) then 1 else 0
let mask_south  = if mask_south1 eq mask_south2 then 1 else 0

let mask_with0 = mask_north + mask_south
let mask = if mask_with0 eq 1 then 1

let masked_data = rose*mask
shade masked_data



-Bill


On 8/21/07 7:54 AM, "igaratza@xxxxxxxxxxxxxxxxxxxx"
<igaratza@xxxxxxxxxxxxxxxxxxxx> wrote:

> Hi,
> 
> I want to define a region for mid-latitudes of both hemispheres, let's say
> between 20-40 S and 20-40 N.
> I guess should be easy, but I don't find a way to do it. For ploting is no
> problem, I define first one hemisphere and after the other:
> 
> set region/y=-40:-20/x=-180:180
> shade temp[d=1,l=1]
> set region/y=40:20/x=-180:180
> shade/ov temp[d=1,l=1]
> 
> But I need some statistic of this two regions together, and this way does not
> work.
> Any suggestion?
> 
> Thanks

--------------------------------------------------------------------
William I. Gustafson Jr.
Atmospheric Science and Global Change Division
Pacific Northwest National Laboratory
3200 Q Ave., MSIN K9-30
Richland, WA 99352
(509)372-6110


[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement