Re: help with using shapefile to mask an array

From: mark collier <Mark.Collier_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 17 2012 - 22:08:00 MDT

Hi,
I have reworked the logic and got rid of my bug which referenced the wrong array (p instead of pr), I don't understand why inout is a scalar and not a vector to match the product of the shape of dlat2d,dlon2d or pr?

Inside the polygon drawing loop I now have:

if(isdefined("plat"))then delete(plat) end if
if(isdefined("plon"))then delete(plon) end if
plat=lat(startPT:endPT)
plon=lon(startPT:endPT)

dlat=p&lat
dlon=p&lon

nlat=dimsizes(dlat)
nlon=dimsizes(dlon)
  
dlat2d=ndtooned(conform_dims((/nlat,nlon/),dlat,0))
dlon2d=ndtooned(conform_dims((/nlat,nlon/),dlon,1))

if(isdefined("inout"))then delete(inout) end if
inout=gc_inout(dlat2d,dlon2d,plat,plon)
print(inout)

I was hoping to have a 2d mask from which I can apply to 2d variable pr and form a polygon average.

Many thanks,
Mark.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Apr 17 22:08:15 2012

This archive was generated by hypermail 2.1.8 : Fri Apr 20 2012 - 16:21:18 MDT