Re: avoiding loops

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon, 05 Mar 2007 11:41:49 -0700

Hi Mateus,

I believe the answer is no, you cannot assign an array to gsMarkerIndex.
   It would be nice to be able to assign arrays to various gs resources
though, I wonder if that functionality could be added to NCL in the
future...

And while it is usually recommended that users avoid do loops in NCL, in
my experience it is usually not worth the extra coding effort to avoid
single and (shorter) double do loops. This is assuming you are not on a
slow machine, or are calling the code many many times in a row...
Good luck,
Adam

Mateus da Silva Teixeira wrote:
> Dear NCL users,
>
> Is it possible to pass to gsMarkerIndex resource an array with marker
> indexes? I'm trying to avoid loop like below
>
> pontos = new(nrows,graphic)
> do i=0,nrows-1
> posRes = True
> posRes_at_gsMarkerIndex = grupos(i)+1
> posRes_at_gsMarkerColor = "black"
> posRes_at_gsMarkerThicknessF = 0.2
> pontos(i) =
> gsn_add_polymarker(wks,mapa,estacoes(i,2),estacoes(i,1),posRes)
> end do
>
>
> doing like
>
> pontos = new(nrows,graphic)
> posRes = True
> posRes_at_gsMarkerIndex = grupos
> posRes_at_gsMarkerColor = "black"
> posRes_at_gsMarkerThicknessF = 0.2
> pontos = gsn_add_polymarker(wks,mapa,estacoes(:,2),estacoes(:,1),posRes)
>
>
> where grupos is an array with the group indexes of each point, starting
> at 1 up to highest group (cluster analysis). So I use the group number
> as a marker indexes. When I trying to use the second approach, the
> markers are all the same. Am I doing something wrong?
>
> Thanks
> Mateus
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Mar 05 2007 - 11:41:49 MST

This archive was generated by hypermail 2.2.0 : Tue Mar 06 2007 - 17:59:11 MST