def get_cps(self):
        valid = np.where(self.times > 0)[0]
        if len(valid) < 1 or  self.times[valid].ptp() < 0.5:
            return 0
        return self.data[valid].sum() / self.times[valid].ptp()
dataset/ETHPy150Open xraypy/xraylarch/plugins/wx/xrfdisplay_utils.py/ROI_Averager.get_cps/original