                    <span class="n">M</span> <span class="o">=</span> <span class="n">WsM</span>
            
            <span class="c1"># calculate achromatic signal, A from Q and M:</span>
            <span class="n">A</span> <span class="o">=</span> <span class="n">Q</span><span class="o">/</span><span class="n">cA</span> <span class="o">-</span> <span class="n">cHK</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">M</span><span class