[ncl-talk] NCARG_COLORMAPS in conda

Rick Brownrigg brownrig at ucar.edu
Fri Nov 20 09:22:43 MST 2020


Hi Jian,

When you say it is not working, are you getting messages such as this when
you try to reference your custom colormap:

fatal:CvtStringToCmap:Unable to convert string "foo" to ColorMap
warning:Error retrieving resource wkColorMap from args - Ignoring Arg

I don't know where the OLD_NCARG_COLORMAPS setting would be coming from in
your environment. I would note that the second path in it --
/lib/ncarg/colormaps -- would be incorrect. I don't know that it would
break things if the first path is correct however.

I have a stock ncl installation from conda. I copied an arbitrary colormap
from $NCARG_ROOT/lib/colormaps into /tmp, renamed it "foo.rgb", and set
NCARG_COLORMAPS=/tmp. Then when I run this little script, everything works:

ncl 1>   wks = gsn_open_wks("x11","test")
ncl 2>   gsn_define_colormap(wks,"foo")
ncl 3> gsn_draw_colormap(wks)

if I unset NCARG_COLORMAPS, and re-run, then I get the fatal/warning errors
mentioned above.

So I would have to conclude something is not quite right in your
environment. Perhaps before trying to set envvars via .bash_profile,
perhaps try setting them on the command line. Are you certain your colormap
is in the directory you cite? Are you certain its format is valid for NCL?
Perhaps try what I did -- copying a known colormap into your custom
directory, rename it to something that does not collide with NCL's colormap
names, and see if you  can get the little scriptlet above to work.

I hope that helps...
Rick


On Fri, Nov 20, 2020 at 8:54 AM Jian Zheng <jzheng8606 at gmail.com> wrote:

> Hi Rick,
>
> When I ran "env | grep NCARG", I got
>
>
> OLD_NCARG_COLORMAPS=/Users/jzheng/Documents/nclcolormap:/lib/ncarg/colormaps
>
> NCARG_ROOT=/Users/jzheng/opt/miniconda3
>
>
> Does it show you more information?
>
>
> On Fri, Nov 20, 2020 at 12:49 PM Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi Jian,
>>
>> Offhand that all looks reasonable. Only you can verify the custom path.
>> Did you "source" your .bash_profile after you modified it?  I'm not sure
>> what else to suggest.
>>
>> Rick
>>
>> On Thu, Nov 19, 2020 at 9:34 PM Jian Zheng <jzheng8606 at gmail.com> wrote:
>>
>>> Hi Rick,
>>>
>>> NCARG_COLORMAPS (export
>>> NCARG_COLORMAPS=/Users/jzheng/Documents/nclcolormap:$NCARG_ROOT/lib/ncarg/colormaps)
>>> contains the directory where I put my user-defined colormap files. When I
>>> run ncl, it doesn't see these colormaps.
>>>
>>> Thanks,
>>> Jian
>>>
>>> On Thu, Nov 19, 2020 at 9:33 PM Rick Brownrigg <brownrig at ucar.edu>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> What do you mean "it does not work"?  What happens?  Normally one
>>>> should not need to set that environment variable unless there's something
>>>> unusual about the way the code is installed.  It is common however to set
>>>> NCARG_ROOT, and that should point to the directory containing the NCL
>>>> installation; i.e., the directory with the bin/ lib/ include/ and man/
>>>> directories belonging to NCL.  I don't recall offhand where a stock conda
>>>> install places those directories.
>>>>
>>>> Rick
>>>>
>>>>
>>>> On Thu, Nov 19, 2020 at 1:47 AM Jian Zheng via ncl-talk <
>>>> ncl-talk at mailman.ucar.edu> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I installed ncl6.6.2 in conda root environment. When I set NCARG_COLORMAPS
>>>>> in my ~/.bash_profile file, it did not work. How should I set NCARG_COLORMAPS
>>>>> with conda correctly?
>>>>>
>>>>> Thanks,
>>>>> Jian
>>>>> _______________________________________________
>>>>> ncl-talk mailing list
>>>>> ncl-talk at mailman.ucar.edu
>>>>> List instructions, subscriber options, unsubscribe:
>>>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20201120/fb8428e7/attachment.html>


More information about the ncl-talk mailing list