Re: beginning and ending index of a certain color table

From: Kai Zhang <kai.zhang_at_nyahnyahspammersnyahnyah>
Date: Wed, 24 Sep 2008 17:07:23 +0200

Thanks a lot! That's exactly what I want.

2008/9/24 Dennis Shea <shea_at_ucar.edu>:
> I don't know how to directly get the number of colors
> without opening a workstation.
>
> If someone does ... please respond.
> ----
>
> Here is one approach:
>
> wks = gsn_open_wks("x11","test1")
> gsn_define_colormap(wks,"BlWhRe")
>
> cmap = gsn_retrieve_colormap(wks)
> dimc = dimsizes(cmap)
> nMax = dimc(0) ; max colors
>
> For BlWhRe, it would be nMax=103
>
> Hence, the start/end indices would be 2,102(=nMax-1)
>
> You could create a function.
>
> function getNumberColors (wks:graphic]
> begin
> cmap = gsn_retrieve_colormap(wks)
> dimc = dimsizes(cmap)
> nMax = dimc(0) ; max colors
> return(nMax)
> end
>
>
>
> Kai Zhang wrote:
>>
>> Dear all,
>>
>> Is there a function which can tell me the beginning and ending index
>> of a certain color table? I know that we can look it up on the NCL web
>> site, but it is always nice to let NCL do it automatically. Thanks!
>>
>> Kai
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
===================================================
Kai Zhang
Max-Planck-Institut fuer Meteorologie
Bundesstrasse 53
20146 Hamburg
http://www.mpimet.mpg.de/en/wissenschaft/ueberblick/atmosphaere-im-erdsystem.html
Tel: +49 040 / 41173-130
E-Mail: kai.zhang_at_zmaw.de
===================================================
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 24 2008 - 09:07:23 MDT

This archive was generated by hypermail 2.2.0 : Mon Sep 29 2008 - 13:35:43 MDT