1 # Copyright (C) 2009-2012 Massimo Sandal <devicerandom@gmail.com>
2 # W. Trevor King <wking@drexel.edu>
4 # This file is part of Hooke.
6 # Hooke is free software: you can redistribute it and/or modify it under the
7 # terms of the GNU Lesser General Public License as published by the Free
8 # Software Foundation, either version 3 of the License, or (at your option) any
11 # Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
16 # You should have received a copy of the GNU Lesser General Public License
17 # along with Hooke. If not, see <http://www.gnu.org/licenses/>.
19 """General utilities for TCCD stuff
22 class generaltccdCommands(object):
24 def plotmanip_threshold(self, plot, current, customvalue=False):
26 Cuts from the plot everything below the threshold.
27 Set the threshold with "set tccd_threshold"
30 if current.curve.experiment != 'smfluo':
33 if not self.config['tccd_threshold'] and (not customvalue):
39 thresh=self.config['tccd_threshold']
41 for set in plot.vectors:
44 if abs(value) < thresh:
54 def plotmanip_coincident(self,plot,current, customvalue=False):
56 Shows only coincident events
58 if current.curve.experiment != 'smfluo':
61 if not self.config['tccd_coincident'] and (not customvalue):
66 for index in range(len(plot.vectors[0][1])):
67 if abs(plot.vectors[0][1][index])>self.config['tccd_threshold'] and abs(plot.vectors[1][1][index])>self.config['tccd_threshold']:
68 newred.append(plot.vectors[0][1][index])
69 newblue.append(plot.vectors[1][1][index])
74 plot.vectors[0][1]=newred
75 plot.vectors[1][1]=newblue