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
7 # under the terms of the GNU Lesser General Public License as
8 # published by the Free Software Foundation, either version 3 of the
9 # License, or (at your option) any later version.
11 # Hooke is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14 # Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with Hooke. If not, see
18 # <http://www.gnu.org/licenses/>.
20 """General utilities for TCCD stuff
23 class generaltccdCommands(object):
25 def plotmanip_threshold(self, plot, current, customvalue=False):
27 Cuts from the plot everything below the threshold.
28 Set the threshold with "set tccd_threshold"
31 if current.curve.experiment != 'smfluo':
34 if not self.config['tccd_threshold'] and (not customvalue):
40 thresh=self.config['tccd_threshold']
42 for set in plot.vectors:
45 if abs(value) < thresh:
55 def plotmanip_coincident(self,plot,current, customvalue=False):
57 Shows only coincident events
59 if current.curve.experiment != 'smfluo':
62 if not self.config['tccd_coincident'] and (not customvalue):
67 for index in range(len(plot.vectors[0][1])):
68 if abs(plot.vectors[0][1][index])>self.config['tccd_threshold'] and abs(plot.vectors[1][1][index])>self.config['tccd_threshold']:
69 newred.append(plot.vectors[0][1][index])
70 newblue.append(plot.vectors[1][1][index])
75 plot.vectors[0][1]=newred
76 plot.vectors[1][1]=newblue