[Thread Prev][Thread Next][Index]

Re: POLYGON versus DEFINED REGION



Hi,
         The method described by Mick is the best to get the domain of a 
grid overlayed on a plot on another grid. Ansley pointed out how to deal 
with  -ve values of the longitudes while making the overlay using 
polygon command. We  need to exercise little care while doing this..let us 
see coads_climatology for example...

   x[gx=sst,i=1]   =  21.00
   x[gx=sst,i=170] = 359.00 
   x[gx=sst,i=180] = 379.00 

  ie., western longitudes are +ve and the exact value of longitudes from 
0E-20E  is > 360. Suppose this is our main grid and we need to plot a 
"model domain" of desired shape over this, then

     If the longitude values of the "domain" are +ve for eastern and
             -ve for the western longitudes & the domain region is from
              15W to 15E then we need to modify the longitudes of the
              "domain" (boundaries) as 

               modbx = bx + 360       is sufficient but

              If the "domain" is from..say 30W to 30E then 

               modbx = IF bx LT 21 THEN bx+360 ELSE bx

   So the whole idea is that, to make an overlay over a lat-lon plot using 
plot/vs or polygon commands, the longitude values of the data being 
overlayed should be in the same format as the first plot. If those are 
different then we can fix the problem by making few trials to get right "modbx" 
as described above or by bringing both the grids to a common longitude 
format by regridding. 

  Another approach is to choose a matching specification of the "longitude 
region" for the first plot : 
              
             let   bx = {-35 , 35, 35, -35, -35}
             let   by = { 10 , 10, 30,  30,  10}
        
             set data coads_climatology

             shade/x=-50:50/y=0:45/l=1 sst  ! this will work because reg is 
             polygon/ov/line/color=7  bx,by ! specified in the same format as "bx"  

             shade/x=50W:50E/y=0:45/l=1 sst ! won't work
             polygon/ov/line/color=7  bx,by !
 
             shade/x=310:410/y=0:45/l=1 sst ! won't work
             polygon/ov/line/color=7  bx,by ! 


Hope This Helps

With Regards 

Jaison



On Mon, 13 Sep 2004, Ansley Manke wrote:

> Hi Emile,
> The lists of numbers in bx and by do not tell Ferret that they
> are longitudes and latitudes.  So Ferret does not know to apply
> a "modulo" operation to convert -17 to (360-17) and put it at the
> right location on the plot.  You can easily do the modulo operation
> yourself on the values in bx:
> 
>   let modbx = if bx lt 0 then 360+bx else bx
>   polygon/line/over modbx, by
> 
> Emilie Vanvyve wrote:
> 
> > Hello,
> >
> > Thanks for the answers I got to my Friday questions! With them, I 
> > could finally find an "enough-simple-according-to-me" way to solve my 
> > little problem (I agree it is indeed easier to write to/read from a 
> > file).
> > But I now encounter another one when I use POLYGON when a region has 
> > been defined: the polygon is not plotted as soon as I restrict the x 
> > and/or y-axis values (with: set region, /x=...:..., /y=...:...), 
> > otherwise it is plotted.
> > It may be comprehensible, but I do not know how to put up with that.
> >
> > Briefly, I do within a script:
> >
> > set region/x=31.7W:33.7E/y=32.5N:64.9N !Europe instead of whole world
> > shade my_var
> > polygon/line/over bx,by
> >
> > or
> >
> > shade/x=31.7W:33.7E/y=32.5N:64.9N my_var !Europe instead of whole world
> > polygon/line/over bx,by
> >
> > where bx and by are both 1-D arrays, containing resp. longitude and 
> > latitude values of a shape I wish to draw on the plot.
> > They are e.g. (read from the box.dat file):
> >
> > yes? list bx, by
> > DATA SET: ./box.dat
> > X: 0.5 to 348.5
> > Column 1: BX
> > Column 2: BY
> > BX BY
> > 1 / 1: -17.00 32.53
> > 2 / 2: -17.08 32.87
> > 3 / 3: -17.17 33.21
> > 4 / 4: -17.26 33.55
> > 5 / 5: -17.35 33.89
> > ...
> > 344 / 344: -15.38 32.81
> > 345 / 345: -15.78 32.74
> > 346 / 346: -16.19 32.67
> > 347 / 347: -16.59 32.60
> > 348 / 348: -17.00 32.53
> >
> > I suspect the problem to be directly linked to the restriction I 
> > impose on x and/or y-axis values, when I define the region. Those 
> > restrictions might in fact be also applied to bx and by. Their index 1 
> > to 348 seem to be understood as longitudes.
> > I tried to give the bx and by values according another axis: 
> > polygon/line/over zsequence(bx), zsequence(by)
> > but it did not work.
> >
> > What's the solution...?
> > Thanks in advance for any suggestion!
> >
> > Emilie
> >
> > ____________________________________________________________
> > Emilie VANVYVE
> > Physicist, PhD student
> >
> > Université catholique de Louvain (UCL)
> > Institut d'astronomie et de géophysique G. Lemaître (ASTR)
> > Chemin du Cyclotron, 2
> > 1348 Louvain-la-Neuve (Belgium)
> > Phone : +32-(0)10-473300
> > Fax : +32-(0)10-474722
> > E-mail : vanvyve@astr.ucl.ac.be
> > Web : www.astr.ucl.ac.be
> 
> 

-- 
___________________________________________________

    Jaison Kurian                           
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-3942505
        +91-80-3600450
    Fax:+91-80-3600865
___________________________________________________




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement