#NEWLINE# def __get_mca0( self , chan_min = 2 , min_counts = 2 ) : #NEWLINE# #INDENT# " find first good detector for alignment\n        'good' is defined as at least min_counts counts\n        above channel chan_min\n        " #NEWLINE# if ( self . __mca0 is None ) : #NEWLINE# #INDENT# for ( imca , mca ) in enumerate ( self . mcas ) : #NEWLINE# #INDENT# if ( mca . counts [ chan_min : ] . sum ( ) > min_counts ) : #NEWLINE# #INDENT# self . __mca0 = mca #NEWLINE# self . offset = mca . offset #NEWLINE# self . slope = mca . slope #NEWLINE# self . quad = mca . quad #NEWLINE# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( imca not in self . bad ) : #NEWLINE# #INDENT# self . bad . append ( imca ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( self . __mca0 is None ) : #NEWLINE# #INDENT# self . __mca0 = mca = imca . mcas [ 0 ] #NEWLINE# self . offset = mca . offset #NEWLINE# self . slope = mca . slope #NEWLINE# self . quad = mca . quad #NEWLINE# #UNINDENT# #UNINDENT# return self . __mca0