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 - 19:48:02 MDT

In this case, you need to print ji and see if the values make sense.




On 23/07/14 9:33 AM, Ipshita Majhi wrote:
> It says jstart is undefined so is lat 2D
>
>
> On Tue, Jul 22, 2014 at 3:24 PM, Jatin Kala <jatin.kala.jk@gmail.com
> <mailto:jatin.kala.jk@gmail.com>> wrote:
>
> 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
>
>



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


Received on Wed Jul 23 01:48:13 2014

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