# Re: one question plot zoom plot

Date: Wed, 03 Jun 2009 12:31:21 -0600

Hi Hui,
I was just made aware of a useful function, region_ind, that will subset
2D latitude/longitude data.
http://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml
Expanding/modifying the example:

glat2d = a->XLAT(0,:,:)
glon2d = a->XLONG(0,:,:)

printMinMax(LAT2D, True)
printMinMax(LON2D, True)

latS = 30 ; California [*rough*]
latN = 43
lonL = -125
lonR = -113

ji = region_ind (glat2d,glon2d, latS, latN, lonW, lonE)

iStrt = ji(0) ; lat start
jLast = ji(1) ; lat last
iStrt = ji(2) ; lon start
iLast = ji(3) ; lon last

LAT2D = glat2d(jStrt:jLast,iStrt:iLast)
LON2D = glon2d(jStrt:jLast,iStrt:iLast)

printMinMax(LAT2D, True)
printMinMax(LON2D, True)

; read data just for the region of interest
x = f->T2(:,jStrt:jLast,iStrt:iLast)
x_at_lat2d = LAT2D
x_at_lon2d = LON2D

If neither of the two methods that I originally sent you seem to work,
you can try using region_ind..

Hui Liu wrote:
> Dear consultants:
>
> I have a wrfinput data for a large domain and these data are read in.
> I can make plots over the entire domain without problem.
> I wonder is there a easy way do some plot over a zoom area (smaller)
> without regenerating the input data?
> Thanks.
> hui
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

```--
--------------------------------------------------------------