# print( len( channels[0][0][0][0] ) )
# print( channels[0][0].shape )

# sys.exit(0)

if peak_indices is not None:
    for d in range(num_dbs):
        for i in range(num_sources):

            channels[d][i] = [channels[d][i][x] for x in peak_indices[i]]

# peak_indices = [ [1,2], [1,2], [2] ]

# READ IN THE ANGLES AND DO SOME FILTERING

secant_matrices = geom.get_secant_matrices(compute_source_sectheta=1, reset=1)

# REFORMAT THE ANGLES FOR PROCESSING

pu_240_sources = [
    dl_estimator.source_geom_data(secant_matrices['pu_240'][0],
                                  secant_matrices['pu_240'][1], 0)
] * len(peak_indices[0])

pu_238_sources = [
    dl_estimator.source_geom_data(secant_matrices[pu238_geoms[name]][0],
                                  secant_matrices[pu238_geoms[name]][1],
                                  1 if name == 'angled' else 0)
    for name in db_names
]
# params_guesses = np.array( [ [ [ 3.0e7, 87.10, -9.31, 58.35 ] ],
#                              [ [ 3.0e7, 32.95, -31.45, 58.72 ] ],
#                              [ [ 3.0e7, 85.35, -46.06, 57.74 ] ] ] )
# extra_data_to_remove = [ [3,7], [3,7], [11,6] ]
# name = 'det1_moved'

group_ranges = [[[-55, 20]], [[-60, 20]], [[-55, 28]]]

num_peaks_to_detect = 6

if cut_strips:
    hitmap_label = None
else:
    hitmap_label = 'no_cuts'

exp1_secant_matrices = exp1_geometry.get_secant_matrices()
peak_group_ranges = [[-np.inf, 2700], [2700, 2900], [2900, np.inf]]

thresholds = [20, 20, 20]

# for name in [ 'centered', 'moved', 'flat', 'angled' ] : # , 'det3_moved', 'det3_cent' ] :

analysis_mgr = spec.dssd_analysis_manager(name, '../../../storage/', (32, 32),
                                          [1, 1, 1])

# primary_peaks = spec.write_peakdetect( analysis_mgr, primary_peak_detector, data_retriever,
#                                        num_peaks_to_detect )

primary_peaks = analysis_mgr.compute_primary_peaks(
    group_ranges,
    primary_peak_detector,
Example #3
0
# pu238_probs /= np.sum( pu238_probs )


pu240_energies = np.array( [ 5123.68, 5168.17 ] ) 
pu240_probs = np.array( [ 0.2710, 0.7280 ] )
pu240_probs /= np.sum( pu240_probs ) 

actual_energies = [  [ np.dot( pu240_energies, pu240_probs ) ],
                     [ np.dot( cf249_energies, cf249_probs ) ] ]
                               


channels = analysis_mgr.load_dill( 'means' )
channels = spec.dssd_data_container( [ channels[0], channels[2] ] )

det_sectheta = exp1_geometry.get_secant_matrices()[ data_name ] 
det_sectheta = np.delete( det_sectheta, 1, axis = 0 )






peak_indices = [ [0], [0] ]

print( 'actual_energies', actual_energies ) 


# channels = analysis_mgr.load_dill( 'peaks' )
# del channels[1]
# actual_energies = [ np.array( [ 3182.690 ] ),