Skip to content

Commit

Permalink
Merge pull request #591 from bnmajor/detector-groups
Browse files Browse the repository at this point in the history
Add support for detector "group" key
  • Loading branch information
bnmajor authored Dec 12, 2023
2 parents 6d2edc0 + 79389b2 commit 6455642
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion hexrd/instrument/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def __init__(self,
saturation_level=None,
panel_buffer=None,
tth_distortion=None,
roi=None,
roi=None, group=None,
distortion=None,
max_workers=max_workers_DFLT):
"""
Expand Down Expand Up @@ -197,6 +197,8 @@ def __init__(self,
boolean with True marking valid pixels. The default is None.
roi : TYPE, optional
DESCRIPTION. The default is None.
group : TYPE, optional
DESCRIPTION. The default is None.
distortion : TYPE, optional
DESCRIPTION. The default is None.
Expand Down Expand Up @@ -239,6 +241,8 @@ def __init__(self,

self.max_workers = max_workers

self.group = group

#
# set up calibration parameter list and refinement flags
#
Expand Down Expand Up @@ -644,6 +648,10 @@ def config_dict(self, chi=0, tvec=ct.zeros_3,
# Only add roi if it is not None
det_dict['pixels']['roi'] = roi

if self.group is not None:
# Only add group if it is not None
det_dict['group'] = self.group

# distortion
if self.distortion is not None:
dparams = self.distortion.params
Expand Down
4 changes: 3 additions & 1 deletion hexrd/instrument/hedm_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def __init__(self, instrument_config=None,
xrs_dist=self._source_distance,
evec=self._eta_vector,
distortion=None,
roi=None,
roi=None, group=None,
max_workers=self.max_workers),
)

Expand Down Expand Up @@ -631,6 +631,7 @@ def __init__(self, instrument_config=None,
detectors_config = instrument_config['detectors']
det_dict = dict.fromkeys(detectors_config)
for det_id, det_info in detectors_config.items():
det_group = det_info.get('group') # optional detector group
pixel_info = det_info['pixels']
affine_info = det_info['transform']
detector_type = det_info.get('detector_type', 'planar')
Expand Down Expand Up @@ -702,6 +703,7 @@ def __init__(self, instrument_config=None,
evec=self._eta_vector,
distortion=distortion,
roi=roi,
group=det_group,
max_workers=self.max_workers,
)

Expand Down

0 comments on commit 6455642

Please sign in to comment.