Skip to content

Commit

Permalink
Refs #4586. Fix if None is passed as filename
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jan 23, 2012
1 parent 4d3d895 commit 1e088d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Code/Mantid/scripts/Inelastic/DirectEnergyConversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,11 @@ def diagnose(self, white, **kwargs):
whiteintegrals = self.do_white(white, None, None) # No grouping yet
if 'second_white' in kwargs:
second_white = kwargs['second_white']
other_whiteintegrals = self.do_white(second_white, None, None) # No grouping yet
kwargs['second_white'] = other_whiteintegrals
if second_white is None:
del kwargs['second_white']
else:
other_whiteintegrals = self.do_white(second_white, None, None) # No grouping yet
kwargs['second_white'] = other_whiteintegrals

# Get the background/total counts from the sample if present
if 'sample' in kwargs:
Expand Down
16 changes: 7 additions & 9 deletions Code/Mantid/scripts/Inelastic/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,15 @@ def diagnose(white_int, **kwargs):
# Each element is the mask workspace name then the number of failures
test_results = [ [None, None], [None, None], [None, None], [None, None], [None, None]]

# Load the hard mask file if necessary
hard_mask_spectra = ''
if 'hard_mask' in kwargs:
# Hard mask
hardmask_file = kwargs.get('hard_mask', None)
if hardmask_file is not None:
hard_mask_spectra = common.load_mask(parser.hard_mask)
test_results[0][0] = os.path.basename(parser.hard_mask)

# Hard mask
masking = MaskDetectors(white_int, SpectraList=hard_mask_spectra)
# Find out how many detectors we hard masked
hard_mask_spectra = masking['SpectraList'].value
test_results[0][1] = len(hard_mask_spectra)
masking = MaskDetectors(white_int, SpectraList=hard_mask_spectra)
# Find out how many detectors we hard masked
hard_mask_spectra = masking['SpectraList'].value
test_results[0][1] = len(hard_mask_spectra)

# White beam Test
__white_masks, num_failed = do_white_test(white_int, parser.tiny, parser.huge,
Expand Down

0 comments on commit 1e088d8

Please sign in to comment.