If your array is (say) z(time,lat,lon), there are 2 ways
[1]
Z = z ; make a temporary copy
z = 0.0 ; array syntax ... set to zero
z(:,{-45:10},{300:360}) = Z(:,{-45:10},{300:360})
z(:,{-45:10},{0:20}) = Z(:,{-45:10},{0:20})
delete(Z)
[2]
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
z = lonFlip(z)
printVarSummary(z) ; longitudes -180 to +180
Z = z
z = 0.0
z(:,{-45:10},{-60:20}) = Z(:,{-45:10},{-60:20})
z = lonFlip(z) ; original order
delete (Z)
On 9/1/11 2:27 AM, Hyacinth Nnamchi wrote:
> Hello NCL Users,
>
> I have 96 by 48 grids data written from longitude 0 and latitude 90S.
> I'd like to set all data values to zero, except the for the box 60W to
> 20E and from 45S to 10 N. Note that the data origin i.e. longitude 0
> splits my box into do.
>
> Has anyone encountered this kind of problem before, and how do you go
> about it in NCL? Thanks in advance for any suggestions.
>
> Hyacinth
>
>
>
> _______________________________________________
> 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 Thu Sep 1 07:07:09 2011
This archive was generated by hypermail 2.1.8 : Wed Sep 07 2011 - 10:58:58 MDT