_photon_stats(data,fit_offset,display_progress)

    <span class="keyword">if</span> nargin &lt; 2
        fit_offset = true;
    <span class="keyword">end</span>

    <span class="keyword">if</span> nargin &lt; 3
        display_progress = false;
    <span class="keyword">end</span>

    figure();
    ax = axes();

    <span class="comment">% Number of points we will use to calculate the variance</span>
    n_req = 100;

    <span class="comment">% Number of time to repeat the calculation at diffent histog