Re: reading data with different increment

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 06 2011 - 14:35:22 MDT

[1]=== Use coordinate subscripting

lat1 = -90
lat2 = 90
lon1 = -180
lon2 = 180
nyskip= 20
nxskip= 20

elv = f->z({lat1:lat2:nyskip},{lon1:lon2:nxskip})
printVarSummary(elv)

[2]=== Use 'ind' and avoid looping

lat = f->lat
lon = f->lon
j1 = ind(lat.eq.lat1)
i1 = ind(lon.eq.lon1)
j2 = ind(lat.eq.lat2)
i2 = ind(lon.eq.lon2)

elv = f->z(j1:j2:nyskip,i1:i2:nxskip)
printVarSummary(elv)

+++++++++++++++++++++++++++++++
  lat = z&lat
  lon = z&lon
  nlat = dimsizes(z&lat)
  nlon = dimsizes(z&lon)

resm@mpMinLonF = min(lon(0))
resm@mpMaxLonF = max(lon(nlon-1))
resm@mpMinLatF = min(lat(0))
resm@mpMaxLatF = max(lat(nlat-1))

++++++++++++++++++++
Elvation ==> Elevation
++++++++++++++++++++

Do not use (:,:), it is less efficient

Yes: plot_t =gsn_csm_contour(wks,elv,rest)
No: plot_t =gsn_csm_contour(wks,elv(:,:),rest)

+++++++++++++
If you are doing a cylindrical equidistant plot, we recommens
    gsn_csm_contour_map_ce

On 10/6/11 2:15 PM, Adam Phillips wrote:
> Hi Ahmed,
> There are two ways to subscript: by using coordinate values, or by using
> index values. I believe you are confusing the two methods here.
>
> Coordinate subscripting uses { } to denote that you are specifying
> coordinate values (latitude/longitude values in your case)
>
> elv = f->z({j1:j2:20},{i1:i2:20})
> elv = f->z({j1:j2},{i1:i2})
> elv = f->z({j1:},{:i2})
>
> Index subscripting doe not:
> elv = f->z(0:100:10,5:125:5})
> elv = f->z(::10,::5})
> elv = f->z(5::10,5::5})
>
> Note that in either case, the specified stride value must be an integer..
>
> In your case, I think you want this:
> elv = f->z({j1:j2:20},{i1:i2:20})
>
> Hope that helps..
> Adam
>
> On 10/06/2011 02:04 PM, ahmed lasheen wrote:
>> Hello all
>> I am trying to read and plot elevation data in which it's resolution is
>> 5 minute , and when i plot it keeping in mind maximizing the workstation
>> size and increasing the cnLevelSpacingF .
>> when i use the com elv = f->z(::20,::20) , then it works well but when
>> i use the command elv = f->z(j1:j2:20,i1:i2:20) where j1 is the first
>> lat ,j2 is the second lat , i1 is the first lon and i2 is the second lon
>> , then the image produces is wrong .anybody know why , i
>> have attached the scripts.
>> thanks
>>
>> --
>> ===============
>> Ahmed Lasheen
>> Junior researcher at Cairo Numerical Weather Prediction Center (CNWPC)
>> Egyptian Meteorological Authority(EMA)
>> Cairo,Egypt
>> ===============
>>
>>
>>
>> _______________________________________________
>> 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 Oct 6 14:35:29 2011

This archive was generated by hypermail 2.1.8 : Sun Oct 09 2011 - 13:05:26 MDT