this is the script to calculate the number of scans we still have if we apply a certain threshold to the median spike percentage