<div dir="ltr">Hi Alan,<div><br></div><div>I think its fairly straightforward to decree that, at least as far as NCL is concerned, that colormaps will be comprised of either RGB 3-tuples, or RGBa 4-tuples, one tuple per line, with the individual components on a line separated by whitespace, and with whitespace defined to be space, tab, or comma.  Let someone else get rid of the commas if they find them a problem  ;-)</div><div><br></div><div>my $0.02,</div><div>Rick</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 16, 2015 at 6:21 PM, Alan Brammer <span dir="ltr">&lt;<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Looking at the man page for ncview I see they require space separated columns. Elsewhere it seems to be a free for all on format. <br>
In retrospect, I&#39;m happy for this to not be included if a space separated file is the preferred input and the inclusion of comma and spaces may cause issues down the line.  Easy enough to get rid of the commas. </p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On 16 Sep 2015 5:11 p.m., &quot;David Brown&quot; &lt;<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The original colormap reader for NCL was built to be reasonably<br>
permissive in the format of the file. It ignores lines that start with<br>
non-numeric characters, allows any amount of whitespace and/or a comma<br>
in between numbers, and figures out from the range of the numbers<br>
encountered whether the rgb components are represented as 8 bit or 16<br>
bit integers or as 0-1 floating point values. Also it doesn&#39;t care<br>
whether there are 1 or 3 or N components to a line. It will stop<br>
reading the file once it has encountered 3 * 256 valid numbers.<br>
The code was tested using files containing native NCL format floating<br>
point rgb triplets in the 0-1 range, as well as .gp files from the<br>
GIST plotting package, and .ncmap files from ncview.<br>
 -dave<br>
<br>
<br>
On Wed, Sep 16, 2015 at 1:09 PM, Rick Brownrigg &lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>&gt; wrote:<br>
&gt; Hi Alan,<br>
&gt;<br>
&gt; That&#39;s a good suggestion, and I&#39;ll make sure it gets into 6.3.1.<br>
&gt;<br>
&gt; FWIW, I don&#39;t know of any formal spec for these file; the current version of<br>
&gt; read_colormap_file() was written to accommodate all the variations we had at<br>
&gt; the time.<br>
&gt;<br>
&gt; Thanks for the suggestion!<br>
&gt; Rick<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Sep 16, 2015 at 12:49 PM, Alan Brammer &lt;<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.edu</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; line 199 $NCARG_ROOT/lib/ncarg/nclscripts/utilities.ncl  (v6.3.0)<br>
&gt;&gt;<br>
&gt;&gt;     tokens = str_split(lines(i), &quot; &quot;)<br>
&gt;&gt;<br>
&gt;&gt; This only allows for space separated rgb files.  I can&#39;t find any true<br>
&gt;&gt; specifications on rgb file format but I have csv rgb files that work with<br>
&gt;&gt; the other NCL functions but not read_colormap_file().<br>
&gt;&gt;<br>
&gt;&gt; If the above line is edited to the below it allows both space and comma<br>
&gt;&gt; delimiters.<br>
&gt;&gt;<br>
&gt;&gt;     tokens = str_split(lines(i), &quot; ,&quot;)<br>
&gt;&gt;<br>
&gt;&gt; Side note, there&#39;s no documentation that str_split accepts multiple<br>
&gt;&gt; delimiters.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Alan.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; ncl-talk mailing list<br>
&gt;&gt; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
&gt;&gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
</blockquote></div>
</div></div></blockquote></div><br></div>