[Thread Prev][Thread Next][Index]

Re: Outlining grid boxes



 Hi John Krasting,
                   Mick explained a good method using polygon command.
You can also draw the grid boxes using "PPL ALINE" as in
the following example (if you want it for the whole domain). This is 
applicable in the case of non-uniform resolution along X/Y axis.

!------------example.jnl-----------------------
!       works for Ferret 5.6/5.7. Otherwise modify the REPEAT loop.

  set data levitus_climatology
  set reg/x=30:120/y=-30:30/k=1  

  let var = temp

  fill var

  let is =  `var, r=istart`   ;  let ie =  `var, r=iend`  
  let js =  `var, r=jstart`   ;  let je =  `var, r=jend`  
  let xs =  x[gx=var,i=`is`]  ;  let xe =  x[gx=var,i=`ie`]
  let ys =  y[gy=var,j=`js`]  ;  let ye =  y[gy=var,j=`je`]

  REPEAT/RANGE=`js`:`je`:1/NAME=yline ( ;\
           let yy = y[gy=var,j=`yline`]  ;\
           ppl aline 1 `xs`,`yy`, `xe`, `yy` ;\
   )          
 
  REPEAT/RANGE=`is`:`ie`:1/NAME=xline ( ;\
           let xx = x[gx=var,i=`xline`] ;\
           ppl aline 1 `xx`, `ys`, `xx`, `ye` ;\
   ) 

!----------------------end of example------------

Hope This helps

With Regards 

Jaison


On Mon, 1 Nov 2004 Mick.Spillane@noaa.gov wrote:

> 
> On Mon, 1 Nov 2004, John Krasting wrote:
> > I am using GFDL climate model output and I am trying to outline individual
> > grid boxes and areas of grid boxes.
> > The GO BOX script uses latitude and longitude as its inputs.  Is there an
> > easier way to outline individual grid boxes without having to manually
> > compute the coordinates of the box corners?
> 
> Hi John,
> 	I take it you can define a mask that identifies the grid cells
> that you need to outline. If so then the "polygon" command may be a
> way to achieve what you need.
> 	The example below illustrates the case of a grid where the
> interval in uniform in both directions.  If the grid were not regular
> in one or both direction then one would need a more clever way of
> defining the box surrounding each "valid" grid cell. (I suspect there
> may be a cunning way to outline the outermost boundary of a group of
> selected cells too in several passes of left, right, top and bottom
> edges ... )
> 
> 	In the following example I will plot a chart of the Indian
> Ocean, then outline the grid cells in the coarser etopo120 bathymetry
> that are deeper than 3000m and lie between 30S and the equator.
> 
> use etopo20
> region/x=30e:120e/y=40s:20n
> shade/nolab/nokey/pal=black if(rose ge 0)then rose
> 
> use etopo120 ! 2 degree spacing in x and y, centered on odd degrees
> let dx=2 ; let dy=2  ! the uniform intervals
> let bx=zsequence({-0.5,0.5,0.5,-0.5}) ! coords of a unit cell
> let by=zsequence({0.5,0.5,-0.5,-0.5}) !  centered in this case
> 
> ! now define mask for the desired grid cells
> let deep=if(rose lt -3000)then rose
> let deepx=if(deep)then x[g=rose]+0*y[g=rose] ! coords of "valid" grid
> let deepy=if(deep)then y[g=rose]+0*x[g=rose] !    converted to a 2-d field
> 
> show grid/y deep[d=2]
> ! ... use something like this to identify j=31:45 as the zonal
> !        band of interest
> 
> repeat/j=31:45 (polygon/nolab/o/line=1/d=2/coord_ax=z \
>                                      deepx+dx*bx,deepy+dy*by)
> 
> ! adding something like /pal=grey to the last command might further
> ! highlight the valid cells.
> 
> ! another idea to highlight a region of interest (but without the
> ! outlining of individual cells would be to use "shade/pat=..."
> ! as for example
> shade/nolab/nokey/pal=black/d=1 if(rose ge 0)then rose
> shade/o/nolab/pat=lite_up_right_to_left/pal=black/y=30s:0 deep[d=2]
> 
> ! a lite shading like this can allow an underlying filled field to
> ! show through.
> 
> Good Luck,
> Mick Spillane
> 

-- 
___________________________________________________

    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