Changeset 13131


Ignore:
Timestamp:
03/16/12 08:56:45 (13 years ago)
Author:
neise
Message:
NOTE: included use of ImageExtractor classes, not yet testet 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/tools/cleaning/area_vs_size.py

    r13104 r13131  
    1414import time as t
    1515from cleaners import AmplitudeCleaner
     16from image_extractors import SimpleArea, SimpleSize
    1617confirm_next_step = False# this is for user interaction
    1718
     
    3031extract = GlobalMaxFinder(40,200)
    3132cleaner = AmplitudeCleaner(45,18)
     33area = SimpleArea()
     34size = SimpleSize()
    3235
    3336#plotA = CamPlotter('amplitudes')
     
    4750        data = smooth(data)
    4851        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
    6856        if confirm_next_step:
    6957            user_input = raw_input("'q'-quit, 'r'-run, anything else goes one step")
Note: See TracChangeset for help on using the changeset viewer.