[gradsusr] use 'const' only over a specific region

pr romero619 at hotmail.com
Sat Jan 15 02:28:17 EST 2011


Hi,

I don't know if the following is possible, and I need help.

I need to use the 'const' function for a variable, but ONLY over a specific
region.

 

Here's the problem:

I have two variables, A & B

Variable A is from a dataset with a global 0.5x0.5 grid, yet it has all
undefined values over the region covering the Mediterranean Sea.

Variable B is from a separate dataset with a 0.167x0.167 resolution that
covers the Med. Sea area and also a small portion of the Atlantic (over the
Bay of Biscay near France).

What I want to do is:

1)      First plot variable A from the global dataset using const to fill in
all undefined areas

'd const(A,0,-u)'

2)      Overlay variable B from the regional dataset onto the global plot of
A & ALSO use const to fill in areas with undefined values.

'd const(B,0,-u)' , plot 'const(B) only over the Mediterranean region

 

The problem is that the 2nd display command, 'd const(B,0,-u)', overwrites
the plotting from the first display command, so everything outside variable
B's region is set to a value of '0'.

I thought about trying to somehow 'merge' or 'add' the two variables, such
as 'display const(A+B,0,-u)', but this doesn't work since the datasets have
different sized grids & different resolutions.

(I'd really like to avoid having to over-complicate things by having to use
regrid and create new grids  or merge datasets.)

 

.Although I know that this is currently not supported, ideally, I'd like to
do something like the following:

* plot const(A) over entire grid (i.e.,globally)

'display const(A,0,-u)'

 

* now display const(B), overlaying onto previous plot of 'const(A)' 

* cropping results of 'const(B)' so that it ONLY covers the Med. Sea region

'display const(B,0,-u,lon1=-5.6,lat1=30,lon2=42,lat2=47)

 

* Now, handle 'Bay of Biscay' region, since it was overwritten by 'const(B)'

* So, re-plot const(A) over this small region

'display const(A,0,-u,lon1=-5.6,lat1=43,lon2=0,lat2=47)

 

Would it be feasible to modify the source code for 'const' in order to
achieve the 'regional cropping' of const that Ive shown in the example
above?

Or, Can my goal be achieved using some combination of 'const', 'maskout',
'set clip', or some other function(s)?

 

Please help,

Thanks,

Pablo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110114/f875fe42/attachment-0003.html 


More information about the gradsusr mailing list