In the previous version of the code, we didn't keep into account the live time fraction of the science observation when we estimated the total number of bkg counts in an image. Now, this estimation is performed as follows:
The bkg counts recorded by each pixel are divided by the corresponding live time (to make them count rates, their units being count s^-1)
We multiply the duration of the time integration of the science file by the corresponding live time fraction. In this way, we obtain the total number of seconds in which each pixel was taking measurements. We call this time the duration of the actual observation time
The bkg count rates are multiplied by the duration duration of the actual observation time to get an estimate of the total number of bkg counts recorded by each pixel during the observation time interval
We finally sum the total number of bkg counts recorded by all the pixels
In the previous version of the code, we didn't keep into account the live time fraction of the science observation when we estimated the total number of bkg counts in an image. Now, this estimation is performed as follows: