Commit 8de06362 authored by Moritz Huetten's avatar Moritz Huetten
Browse files

Merge branch 'dev-aberti-pipeline-fixes' into 'master'

Pipeline fixes

Closes #7, #6, #5, #4, and #1

See merge request ievo/icrr-mpp-pipe!2
parents 58184324 8f196ca1
data_files:
mc:
train_sample:
train_sample:
magic1:
input_mask: "../../../MCs/MAGIC/ST.03.07/za05to35/Train_sample/1.Calibrated/GA_M1*root"
hillas_output: "../../../MCs/MAGIC/ST.03.07/za05to35/Train_sample/2.Hillas/iv_hillas_m1.h5"
......@@ -8,7 +8,7 @@ data_files:
input_mask: "../../../MCs/MAGIC/ST.03.07/za05to35/Train_sample/1.Calibrated/GA_M2*root"
hillas_output: "../../../MCs/MAGIC/ST.03.07/za05to35/Train_sample/2.Hillas/iv_hillas_m2.h5"
test_sample:
test_sample:
magic1:
input_mask: "../../../MCs/MAGIC/ST.03.07/za05to35/Test_sample/1.Calibrated/GA_M1*root"
hillas_output: "../../../MCs/MAGIC/ST.03.07/za05to35/Test_sample/2.Hillas/iv_hillas_m1.h5"
......@@ -19,7 +19,7 @@ data_files:
reco_output: "../../../MCs/MAGIC/ST.03.07/za05to35/Test_sample/3.Reco/iv_reco_m2.h5"
data:
train_sample:
train_sample:
magic1:
input_mask: "../../../Data/MAGIC/Off/Train_sample/1.Calibrated/20*_M1_*root"
hillas_output: "../../../Data/MAGIC/Off/Train_sample/2.Hillas/iv_hillas_m1.h5"
......@@ -27,7 +27,7 @@ data_files:
input_mask: "../../../Data/MAGIC/Off/Train_sample/1.Calibrated/20*_M2_*root"
hillas_output: "../../../Data/MAGIC/Off/Train_sample/2.Hillas/iv_hillas_m2.h5"
test_sample:
test_sample:
magic1:
input_mask: "../../../Data/MAGIC/CrabNebula/1.Calibrated/20*_M1_*root"
hillas_output: "../../../Data/MAGIC/CrabNebula/ctapipe/2.Hillas/iv_hillas_m1.h5"
......@@ -38,7 +38,7 @@ data_files:
reco_output: "../../../Data/MAGIC/CrabNebula/ctapipe/3.Reco/reco_m2.h5"
image_cleanining:
image_cleaning:
magic:
charge_thresholds:
picture_thresh: 6
......@@ -47,25 +47,25 @@ image_cleanining:
time_thresholds:
# 1.5 slices x 1.64 GHz
time_limit: 2.46
max_time_diff: 2.46
# 4.5 slices x 1.64 GHz
max_time_off: 7.38
min_number_neighbors: 1
energy_rf:
save_name: "RFs/energy_rf.joblib"
cuts: "(multiplicity > 1) & (intensity > 30) & (length > 0.0) & (leakage1_intensity < 0.15)"
cuts: "(multiplicity > 1) & (intensity > 30) & (length > 0.0) & (intensity_width_1 < 0.15)"
settings:
n_estimators: 100
min_samples_leaf: 10
n_jobs: 3
features:
['slope', 'length', 'width', 'intensity', 'skewness', 'kurtosis', 'x', 'y', 'psi', 'leakage1_intensity', 'leakage2_intensity']
['slope', 'length', 'width', 'intensity', 'skewness', 'kurtosis', 'x', 'y', 'psi', 'intensity_width_1', 'intensity_width_2']
direction_rf:
save_name: "RFs/direction_rf.joblib"
cuts: "(multiplicity > 1) & (intensity > 30) & (length > 0.0) & (leakage1_intensity < 0.15)"
cuts: "(multiplicity > 1) & (intensity > 30) & (length > 0.0) & (intensity_width_1 < 0.15)"
settings:
n_estimators: 100
min_samples_leaf: 10
......@@ -77,7 +77,7 @@ direction_rf:
classifier_rf:
save_name: "RFs/classifier_rf.joblib"
cuts: "(multiplicity > 1) & (intensity > 30) & (length > 0.0) & (leakage1_intensity < 0.15)"
cuts: "(multiplicity > 1) & (intensity > 30) & (length > 0.0) & (intensity_width_1 < 0.15)"
settings:
n_estimators: 100
min_samples_leaf: 10
......@@ -89,5 +89,8 @@ classifier_rf:
event_list:
max_time_diff: 6.9e-4
cuts:
l3rate: "80 < value < 1000"
dc: "2.5e3 < value < 3.5e3"
quality:
l3rate: "80 < value < 1000"
dc: "0 < value < 7e3"
selection:
"(multiplicity > 1) & (abs(pos_angle_shift_reco - 0.5) > 0.4) & (event_class_0 > 0.8)"
......@@ -157,7 +157,7 @@ magic_tel_positions = {
magic_optics = OpticsDescription.from_name('MAGIC')
magic_cam = CameraGeometry.from_name('MAGICCam')
magic_tel_description = TelescopeDescription(name='MAGIC',
type='MAGIC',
tel_type='MAGIC',
optics=magic_optics,
camera=magic_cam)
magic_tel_descriptions = {1: magic_tel_description,
......
......@@ -91,7 +91,7 @@ magic_tel_positions = {
magic_optics = OpticsDescription.from_name('MAGIC')
magic_cam = CameraGeometry.from_name('MAGICCam')
magic_tel_description = TelescopeDescription(name='MAGIC',
type='MAGIC',
tel_type='MAGIC',
optics=magic_optics,
camera=magic_cam)
magic_tel_descriptions = {1: magic_tel_description,
......
......@@ -614,8 +614,8 @@ if 'data_files' not in config:
print('Error: the configuration file is missing the "data_files" section. Exiting.')
exit()
if 'image_cleanining' not in config:
print('Error: the configuration file is missing the "image_cleanining" section. Exiting.')
if 'image_cleaning' not in config:
print('Error: the configuration file is missing the "image_cleaning" section. Exiting.')
exit()
# ------------------------------
......@@ -631,7 +631,7 @@ for data_type in config['data_files']:
except:
ValueError(f'Can not recognize the telescope type from name "{telescope}"')
if telescope_type not in config['image_cleanining']:
if telescope_type not in config['image_cleaning']:
raise ValueError(f'Guessed telescope type "{telescope_type}" does not have image cleaning settings')
is_mc = data_type.lower() == "mc"
......@@ -639,11 +639,11 @@ for data_type in config['data_files']:
if is_mc:
process_dataset_mc(input_mask=config['data_files'][data_type][sample][telescope]['input_mask'],
output_name=config['data_files'][data_type][sample][telescope]['hillas_output'],
image_cleaning_settings=config['image_cleanining'][telescope_type])
image_cleaning_settings=config['image_cleaning'][telescope_type])
else:
tel_id = re.findall('.*([_\d]+)', telescope)[0]
tel_id = int(tel_id)
process_dataset_data(input_mask=config['data_files'][data_type][sample][telescope]['input_mask'],
tel_id=tel_id,
output_name=config['data_files'][data_type][sample][telescope]['hillas_output'],
image_cleaning_settings=config['image_cleanining'][telescope_type])
image_cleaning_settings=config['image_cleaning'][telescope_type])
......@@ -283,7 +283,7 @@ for tel_id in tel_ids:
# === Plotting ===
# ================
pyplot.style.use('presentation')
#pyplot.style.use('presentation')
pyplot.figure(figsize=(20, 10))
......
......@@ -153,7 +153,7 @@ magic_tel_positions = {
magic_optics = OpticsDescription.from_name('MAGIC')
magic_cam = CameraGeometry.from_name('MAGICCam')
magic_tel_description = TelescopeDescription(name='MAGIC',
type='MAGIC',
tel_type='MAGIC',
optics=magic_optics,
camera=magic_cam)
magic_tel_descriptions = {1: magic_tel_description,
......@@ -222,9 +222,9 @@ info_message('Training the RF\n', prefix='DirRF')
direction_estimator = DirectionEstimatorPandas(config['direction_rf']['features'],
magic_tel_descriptions,
**config['direction_rf']['settings'])
#direction_estimator.fit(shower_data_train)
#direction_estimator.save(config['direction_rf']['save_name'])
direction_estimator.load(config['direction_rf']['save_name'])
direction_estimator.fit(shower_data_train)
direction_estimator.save(config['direction_rf']['save_name'])
#direction_estimator.load(config['direction_rf']['save_name'])
# Printing the parameter "importances"
for kind in direction_estimator.telescope_rfs:
......@@ -303,7 +303,7 @@ for oi in range(len(offset_edges) - 1):
# ================
pyplot.figure(figsize=(12, 12))
pyplot.style.use('presentation')
#pyplot.style.use('presentation')
pyplot.xlabel(r'$\theta^2$, deg$^2$')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment