Skip to content

Commit d1c6cc7

Browse files
authored
Merge pull request #818 from neutrons/mask_error
change instrument def in load_mask
2 parents 34a3935 + 266fe35 commit d1c6cc7

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

pyrs/core/nexus_conversion.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,13 @@ def __load_mask(self, mask_file_name):
362362

363363
# Load mask XML to workspace
364364
mask_ws_name = os.path.basename(mask_file_name.split('.')[0])
365-
mask_ws = LoadMask(Instrument='nrsf2', InputFile=mask_file_name, RefWorkspace=self._event_wksp,
366-
OutputWorkspace=mask_ws_name)
365+
366+
try:
367+
mask_ws = LoadMask(Instrument='hidra', InputFile=mask_file_name, RefWorkspace=self._event_wksp,
368+
OutputWorkspace=mask_ws_name)
369+
except RuntimeError: # second mask load added for old data measured prior to instrument rename
370+
mask_ws = LoadMask(Instrument='nrsf2', InputFile=mask_file_name, RefWorkspace=self._event_wksp,
371+
OutputWorkspace=mask_ws_name)
367372

368373
# Extract mask out
369374
# get the Y array from mask workspace: shape = (1048576, 1)

0 commit comments

Comments
 (0)