Changeset 13131
- Timestamp:
- 03/16/12 08:56:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/tools/cleaning/area_vs_size.py
r13104 r13131 14 14 import time as t 15 15 from cleaners import AmplitudeCleaner 16 from image_extractors import SimpleArea, SimpleSize 16 17 confirm_next_step = False# this is for user interaction 17 18 … … 30 31 extract = GlobalMaxFinder(40,200) 31 32 cleaner = AmplitudeCleaner(45,18) 33 area = SimpleArea() 34 size = SimpleSize() 32 35 33 36 #plotA = CamPlotter('amplitudes') … … 47 50 data = smooth(data) 48 51 amplitude, time_of_max = extract(data) 49 clean_mask = cleaner(amplitude) 50 #plotA.name='amplitudes EvtID:' + str(run.event_id.value) + ' TT:' + str(tt) 51 #plotA(amplitude) 52 #plotT(time_of_max) 53 #plotCA(data=amplitude, mask=clean_mask) 54 55 survivors = np.where( clean_mask)[0] 56 size = 0 57 for pixel in survivors: 58 size += amplitude[pixel] 59 60 if len(survivors) > 0: 61 areas.append( len(survivors) ) 62 sizes.append( size ) 63 64 65 #plotArea(areas, 'areas of ' + str(run.event_id.value) + 'events') 66 #plotSize(sizes, 'sizes of ' + str(run.event_id.value) + 'events') 67 52 survivors = cleaner(amplitude, return_bool_mask=False ) 53 areas.append( area(survivors) ) 54 sizes.append( size(survivors) ) 55 68 56 if confirm_next_step: 69 57 user_input = raw_input("'q'-quit, 'r'-run, anything else goes one step")
Note:
See TracChangeset
for help on using the changeset viewer.