<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CLASS &#8211; Matthew Petroff</title>
	<atom:link href="https://mpetroff.net/tag/class/feed/" rel="self" type="application/rss+xml" />
	<link>https://mpetroff.net</link>
	<description>mpetroff.net</description>
	<lastBuildDate>Tue, 09 May 2023 00:39:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>An Improved CMB Map Colormap</title>
		<link>https://mpetroff.net/2023/05/an-improved-cmb-map-colormap/</link>
					<comments>https://mpetroff.net/2023/05/an-improved-cmb-map-colormap/#respond</comments>
		
		<dc:creator><![CDATA[Matthew Petroff]]></dc:creator>
		<pubDate>Tue, 09 May 2023 00:38:44 +0000</pubDate>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[CLASS]]></category>
		<category><![CDATA[CMB]]></category>
		<category><![CDATA[color vision deficiency]]></category>
		<category><![CDATA[colormap]]></category>
		<category><![CDATA[map]]></category>
		<guid isPermaLink="false">https://mpetroff.net/?p=3640</guid>

					<description><![CDATA[Although a variety of colormaps have previously been specifically developed for displaying cosmic microwave background (CMB) maps, none of these have been designed with perceptual uniformity or color-vision-deficiency (CVD) accessibility in mind. To improve upon this status quo, in support &#8230; <a href="https://mpetroff.net/2023/05/an-improved-cmb-map-colormap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="dropcap">A</span>lthough a variety of colormaps have <a href="https://ui.adsabs.harvard.edu/abs/1994ApJ...436..423B/abstract">previously</a> <a href="https://ui.adsabs.harvard.edu/abs/1996ApJ...464L...1B/abstract">been</a> <a href="https://ui.adsabs.harvard.edu/abs/2013ApJS..208...20B/abstract">specifically</a> <a href="https://ui.adsabs.harvard.edu/abs/2020A%26A...641A...1P/abstract">developed</a> for displaying cosmic microwave background (CMB) maps, none of these have been designed with perceptual uniformity or color-vision-deficiency (CVD) accessibility in mind. To improve upon this status quo, in support of <a href="https://arxiv.org/abs/2305.01045">publications</a><sup id="rf1-3640"><a href="https://mpetroff.net/2023/05/an-improved-cmb-map-colormap/#fn1-3640" title=" Y. Li et al., &#8220;CLASS Data Pipeline and Maps for 40&thinsp;GHz Observations through 2022&#8221;, &lt;a href=&quot;https://arxiv.org/abs/2305.01045&quot;&gt;arXiv:2305.01045&lt;/a&gt;. " rel="footnote">1</a></sup> for the 2022 data release for the <a href="https://sites.krieger.jhu.edu/class/">Cosmology Large Angular Scale Surveyor (CLASS)</a>, I used Matplotlib&#8217;s <a href="https://github.com/matplotlib/viscm">Viscm</a> tool to develop a new diverging colormap that resembles the <em>Planck</em> colormap but is mostly perceptually uniform and is perceived similarly by both individuals with typical color vision and those with red or green color-vision deficiencies. The Q-band Stokes <em>U</em> map from the CLASS paper, which uses the new colormap, is shown below.</p>
<p><a href="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-u-map.png" title="CLASS Q-band U Map with New Colormap" data-sbox="3640"><img loading="lazy" decoding="async" src="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-u-map-640x320.png" alt="A CMB map in equatorial coordinates is shown under Mollweide projection. Data are shown for around 70% of the sky, and the Galactic plane is visible. The new colormap discussed in this blog post is used, starting from blue to a warm light gray and then to red." width="640" height="320" class="aligncenter size-large wp-image-3655" srcset="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-u-map-640x320.png 640w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-u-map-300x150.png 300w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-u-map.png 1280w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a><span id="more-3640"></span></p>
<p>Starting with prior art, the <em>Planck</em> colormap is a diverging colormap, but it has discontinuities in its perceptual derivative, causing visible banding issues. Here is the output for it from Viscm.</p>
<p><a href="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/planck.png" title="Viscm output for the Planck colormap" data-sbox="3640"><img loading="lazy" decoding="async" src="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/planck-640x384.png" alt="A visualization shows abrupt changes in the perceptual derivative of the Planck colormap, which goes from blue to red, and visible banding in test images." width="640" height="384" class="aligncenter size-large wp-image-3647" srcset="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/planck-640x384.png 640w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/planck-300x180.png 300w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/planck-1536x922.png 1536w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/planck-1280x768.png 1280w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/planck.png 2000w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
<p>And here is how it performs by <a href="/2019/08/discernibility-of-rainbow-colormaps/">the CVD metric I previously developed</a> to evaluate the <em>Turbo</em> colormap (which performs poorly by it). Along with the cusps from the issues with the perceptual derivative, there is a clear imbalance in the metric around the center of the colormap for red and green color-vision deficiencies.</p>
<p style="text-align: center;"><img decoding="async" src="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/planck.svg" alt="A plot shows lines with cusps for the CVD metric as a function of colormap position. For deuteranopia and protanopia, there is a clear imbalance around the center of the colormap." /></p>
<p>As a first attempt to improve upon this, I fit splines to the color values and applied various levels of smoothing. With small amounts of smoothing, this rounded off the perceptual discontinuities&mdash;fixing the worst of the issues&mdash;but left much room for improvement; applying more aggressive smoothing further improved the perceptual issues but also more significantly changed the colormap in a manner that my colleagues did not like aesthetically.</p>
<p>For my second attempt, I started by trying to replicate the <em>Planck</em> colormap in Viscm. In the process, I solicited feedback from my colleagues, resulting in tweaks such as moving the mid point from a neutral gray to a slightly warmer color temperature. While this resolved the perceptual uniformity issues, parts of the colormap were less than uniform for individuals with color vision deficiencies. I then iteratively made changes and ran the results through the CVD metric, until the results roughly matched between typical color vision and red and green color-vision deficiencies. Here is the output of Viscm for the new colormap.</p>
<p><a href="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class.png" title="Viscm output for new CLASS colormap" data-sbox="3640"><img loading="lazy" decoding="async" src="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-640x384.png" alt="A visualization shows the uniformity of the perceptual derivative of the CLASS colormap, which goes from blue to red, and test images do not show banding." width="640" height="384" class="aligncenter size-large wp-image-3650" srcset="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-640x384.png 640w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-300x180.png 300w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-1536x922.png 1536w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class-1280x768.png 1280w, https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class.png 2000w" sizes="auto, (max-width: 640px) 100vw, 640px" /></a></p>
<p>And here is how it performs by my previously-developed metric.</p>
<p style="text-align: center;"><img decoding="async" src="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/class.svg" alt="A plot shows relatively smooth and consistent lines for the CVD metric as a function of colormap position for the new CLASS colormap for typical color vision, deuteranopia, and protanopia. The metric for tritanopia diverges a bit from the other values." /></p>
<p>While a significant improvement upon the status quo, the new colormap is not perfect, and I think other diverging colormaps such as Peter Kovesi&#8217;s <a href="https://colorcet.com/gallery.html">CET-D07 colormap</a> (<code>cet_bjy</code> in Python&#8217;s <a href="https://colorcet.holoviz.org/">Colorcet package</a>), which is both linear and diverging, or some of <a href="https://www.fabiocrameri.ch/colourmaps/">Fabio Crameri&#8217;s colormaps</a> are better choices for most applications. However, the new colormap is probably good enough for CMB maps, where exact values do not need to be read off of the maps by eye, while keeping a similar aesthetic to existing publications.</p>
<p>A <a href="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/colormap.py">Python file</a> that can be imported to use the colormap with Matplotlib or Healpy and the <a href="https://cdn0.mpetroff.net/wp-content/uploads/2023/05/colormap.jscm">JSCM output</a> from Viscm are available.</p>
<hr class="footnotes"><ol class="footnotes" style="list-style-type:decimal"><li id="fn1-3640"><p > Y. Li et al., &#8220;CLASS Data Pipeline and Maps for 40&thinsp;GHz Observations through 2022&#8221;, <a href="https://arxiv.org/abs/2305.01045">arXiv:2305.01045</a>. &nbsp;<a href="https://mpetroff.net/2023/05/an-improved-cmb-map-colormap/#rf1-3640" class="backlink" title="Return to footnote 1.">&#8617;</a></p></li></ol>]]></content:encoded>
					
					<wfw:commentRss>https://mpetroff.net/2023/05/an-improved-cmb-map-colormap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: cdn0.mpetroff.net
Minified using Disk

Served from: mpetroff.net @ 2026-03-31 01:27:19 by W3 Total Cache
-->