Skip to content

Commit

Permalink
fix: handle default values of detectors and detector_ids in edd.Setup…
Browse files Browse the repository at this point in the history
…NXdataReader and edd.UpdateNXdataReader
  • Loading branch information
keara-soloway committed Oct 8, 2024
1 parent 7332db7 commit f8b2a13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHAP/edd/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ def read(self, filename, dataset_id, detectors=None):
:rtype: dict
"""
from CHAP.common.models.map import DetectorConfig
if detectors is None:
detectors = []
detector_config = DetectorConfig(detectors=detectors)
# Columns in input .txt file:
# 0: scan number
Expand Down Expand Up @@ -783,6 +785,8 @@ def read(self, spec_file, scan_number, detector_ids=None, inputdir='.'):
f'dataset_point_index_offset = {dataset_point_index_offset}')

# Get full data point for every point in the scan
if detector_ids is None:
detector_ids = []
detector_data = scanparser.get_detector_data(detector_ids)
detector_data = {_id: detector_data[:,i,:]
for i, _id in enumerate(detector_ids)}
Expand Down

0 comments on commit f8b2a13

Please sign in to comment.