Re: How to extract a region of particular interest and average it for that region

From: Jatin Kala <jatin.kala.jk_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 22 2014 - 17:24:46 MDT

Try this:
x = sce(jStrt:jLast,iStrt:iLast,:,:)






On 23/07/14 9:18 AM, Ipshita Majhi wrote:

> Dear All,
>
> I have written a code to extract a region for particular latitude and
> longitude and it gives me error in the end asking me what is x. Can
> you guide me on this . Thank you
>
> ;*******************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> a
> =addfile("~/Documents/Snow_cover_IMS/nhsce_v01r01_19661004_20140602.nc
> <http://nhsce_v01r01_19661004_20140602.nc>","r")
>
> sce=a->snow_cover_extent(:,:,:)
> lat=a->latitude
> lon=a->longitude
>
>
> ;Attaching latitude and longitude to sce
> sce@lat2d=lat
> sce@lon2d=lon
>
>
> printMinMax(lat, True)
> printMinMax(lon, True)
>
> latN = 60 ; Western Eurasia [*rough*]
> latN = 40
> lonW = 10
> lonE = 30
>
> ji = region_ind (lat,lon, latS, latN, lonW, lonE)
>
> jStrt = ji(0) ; lat start
> jLast = ji(1) ; lat last
> iStrt = ji(2) ; lon start
> iLast = ji(3) ; lon last
>
> LAT2D = lat(jStrt:jLast,iStrt:iLast)
> LON2D = lon(jStrt:jLast,iStrt:iLast)
>
> printMinMax(LAT2D, True)
> printMinMax(LON2D, True)
>
> ; read data just for the region of interest
> x = sce->(jStrt:jLast,iStrt:iLast,:,:)
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk



_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


Received on Tue Jul 22 11:24:58 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:47 MDT