pan class="p">()</span> <span class="o">&lt;</span> <span class="n">prob_P_dP</span> <span class="k">else</span> <span class="n">P_type</span><span class="o">-</span><span class="mi">1</span>

    <span class="c1"># Update the context after changing the type of speckles.</span>
    <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">model</span><span class="o">.</span><span class="n">chr_system</span><span class=