Skip to content

Commit

Permalink
Merge pull request #66 from HealthyPear/bugfix-write_dl2
Browse files Browse the repository at this point in the history
Add missing variables in write_dl2
  • Loading branch information
HealthyPear committed Oct 22, 2020
2 parents 0704409 + e4be2b2 commit ee7d8cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion protopipe/pipeline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def final_array_to_use(sim_array, array, subarrays=None):
The camera IDs will feed both the estimators and the image cleaning.
The equivalent focal lengths will be used to calculate the radius of
the camera on which cut for truncated images.
subarray : ctapipe.instrument.SubarrayDescription
Complete subarray information of the final array/subarray selected.
"""
if subarrays:
Expand All @@ -181,7 +183,7 @@ def final_array_to_use(sim_array, array, subarrays=None):
tel_types[i].camera.cam_id: tel_types[i].optics.equivalent_focal_length.value
for i in range(len(tel_types))
}
return set(tel_ids), cams_and_foclens, subarray # redundant, to improve!
return set(tel_ids), cams_and_foclens, subarray


def prod3b_array(fileName, site, array):
Expand Down
2 changes: 1 addition & 1 deletion protopipe/scripts/model_diagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import matplotlib.patches as mpatches
from astropy.table import Table, Column

from sklearn.externals import joblib
import joblib

from protopipe.pipeline.utils import load_config, save_fig

Expand Down
7 changes: 6 additions & 1 deletion protopipe/scripts/write_dl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def main():

# Get the IDs of the involved telescopes and associated cameras together
# with the equivalent focal lengths from the first event
allowed_tels, cams_and_foclens = prod3b_array(filenamelist[0], site, array)
allowed_tels, cams_and_foclens, subarray = prod3b_array(filenamelist[0], site, array)

# keeping track of events and where they were rejected
evt_cutflow = CutFlow("EventCutFlow")
Expand All @@ -85,6 +85,7 @@ def main():
# Event preparer
preper = EventPreparer(
config=cfg,
subarray=subarray,
cams_and_foclens=cams_and_foclens,
mode=args.mode,
event_cutflow=evt_cutflow,
Expand Down Expand Up @@ -206,10 +207,14 @@ class RecoEvent(tb.IsDescription):
for (
event,
dl1_phe_image,
dl1_phe_image_mask_reco,
dl1_phe_image_1stPass,
calibration_status,
mc_phe_image,
n_pixel_dict,
hillas_dict,
hillas_dict_reco,
leakage_dict,
n_tels,
tot_signal,
max_signals,
Expand Down

0 comments on commit ee7d8cb

Please sign in to comment.