Changeset 13028 for fact/tools
- Timestamp:
- 03/09/12 10:23:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/pyfact/extractor.py
r12986 r13028 41 41 pass 42 42 43 44 class WindowIntegrator(object): 45 """ Integrates in a given intergration window around the given position 46 """ 47 48 def __init__(self, min=13, max=23 , name = 'WindowIntegrator'): 49 """ initialize integration Window 50 """ 51 self.min = min 52 self.max = max 53 self.name = name 54 55 def __call__(self, data, pos): 56 integral = np.empty( data.shape[0] ) 57 for pixel in range( data.shape[0] ): 58 integral[pixel] = data[pixel, (pos[pixel]-self.min):(pos[pixel]+self.max)].sum() 59 return integral 60 61 def __str__(self): 62 s = self.name + '\n' 63 s += 'window:\n' 64 s += '(min,max) = (' + str(self.min) + ',' + str(self.max) + ')' 65 return s 43 66 44 67 class FixedWindowIntegrator(object):
Note:
See TracChangeset
for help on using the changeset viewer.