<div dir="ltr">Hi Rick,<div><br></div><div>I find that defining NCARG_COLORMAPS after the conda-initializing part in the .bash_profile can solve the problem.</div><div><br></div><div>Thanks a lot for all your help.</div><div>Jian</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 21, 2020 at 12:22 AM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Jian,</div><div><br></div><div>When you say it is not working, are you getting messages such as this when you try to reference your custom colormap:</div><div><br></div><div>fatal:CvtStringToCmap:Unable to convert string "foo" to ColorMap<br>warning:Error retrieving resource wkColorMap from args - Ignoring Arg</div><div><br></div><div>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.</div><div><br></div><div>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:</div><div><br></div><div>ncl 1> wks = gsn_open_wks("x11","test")<br>ncl 2> gsn_define_colormap(wks,"foo")<br>ncl 3> gsn_draw_colormap(wks)</div><div><br></div><div>if I unset NCARG_COLORMAPS, and re-run, then I get the fatal/warning errors mentioned above. <br></div><div><br></div><div>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.</div><div><br></div><div>I hope that helps...</div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 20, 2020 at 8:54 AM Jian Zheng <<a href="mailto:jzheng8606@gmail.com" target="_blank">jzheng8606@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Rick,<br><br>When I ran "env | grep NCARG", I got<br><br>OLD_NCARG_COLORMAPS=/Users/jzheng/Documents/nclcolormap:/lib/ncarg/colormaps<br><br>NCARG_ROOT=/Users/jzheng/opt/miniconda3<br><br><br>Does it show you more information?<br><div><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(208,239,214)"><span style="font-variant-ligatures:no-common-ligatures"></span></p></div>
</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 20, 2020 at 12:49 PM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Jian,<br></div><div><br></div><div>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.</div><div><br></div><div>Rick<br> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 19, 2020 at 9:34 PM Jian Zheng <<a href="mailto:jzheng8606@gmail.com" target="_blank">jzheng8606@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font face="arial, sans-serif">Hi Rick,</font><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><span style="color:rgb(32,33,36);font-variant-ligatures:no-contextual">NCARG_COLORMAPS (</span><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(208,239,214);color:rgb(0,0,0)">export NCARG_COLORMAPS=/Users/jzheng/Documents/nclcolormap:$NCARG_ROOT/lib/ncarg/colormaps</span><span style="color:rgb(32,33,36);font-variant-ligatures:no-contextual">) contains the directory where I put my user-defined colormap files. When I run ncl, it doesn't see these colormaps.</span></font></div><div><font face="arial, sans-serif"><span style="color:rgb(32,33,36);font-variant-ligatures:no-contextual"><br></span></font></div><div><font face="arial, sans-serif"><span style="color:rgb(32,33,36);font-variant-ligatures:no-contextual">Thanks,</span></font></div><div><font face="arial, sans-serif"><span style="color:rgb(32,33,36);font-variant-ligatures:no-contextual">Jian</span></font></div>
</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 19, 2020 at 9:33 PM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>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.</div><div><br></div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 19, 2020 at 1:47 AM Jian Zheng via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><font face="arial, sans-serif">Hi,</font><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I installed ncl6.6.2 in conda root environment. When I set <span style="color:rgb(0,0,0)">NCARG_COLORMAPS in my ~/.bash_profile file, it did not work. How should I set </span><span style="color:rgb(0,0,0)">NCARG_COLORMAPS with conda correctly</span><span style="color:rgb(0,0,0)">?</span></font></div><div><span style="color:rgb(0,0,0)"><font face="arial, sans-serif"><br></font></span></div><div><span style="color:rgb(0,0,0)"><font face="arial, sans-serif">Thanks,</font></span></div><div><span style="color:rgb(0,0,0)"><font face="arial, sans-serif">Jian</font></span></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>