Skip to content

Commit

Permalink
SetBeam to set beam size and prevent invalid bounding box error
Browse files Browse the repository at this point in the history
Bounding box error comes from AddAbsorptionWeightedPathLengths algorithm
  • Loading branch information
RichardWaiteSTFC committed Oct 8, 2024
1 parent 78d8466 commit 8e09cb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/Diffraction/single_crystal/base_sx.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def calc_absorption_weighted_path_lengths(self, peak_type, int_type=None, run=No
default_kwargs = {"ApplyCorrection": self.scale_integrated, "EventsPerPoint": 1500, "MaxScatterPtAttempts": 7500}
kwargs = {**default_kwargs, **kwargs}
ws = self.get_ws(run)
SetBeam(ws, Geometry={"Shape": "Slit", "Width": self.beam_width, "Height": self.beam_height})
peaks = self.get_peaks(run, peak_type, int_type)
mantid.CopySample(InputWorkspace=ws, OutputWorkspace=peaks, CopyEnvironment=False)
mantid.AddAbsorptionWeightedPathLengths(InputWorkspace=peaks, **kwargs)
Expand Down
2 changes: 2 additions & 0 deletions scripts/Diffraction/single_crystal/sxd.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def __init__(self, vanadium_runno=None, empty_runno=None, detcal_path=None, file
<centre x="0.0" y="0.0" z="0.0" />
<radius val="0.003"/>
</sphere>""" # sphere radius 3mm - used for vanadium and NaCl
self.beam_width = 0.6 # cm
self.beam_height = 0.6 # cm

def process_data(self, runs: Sequence[str], *args):
"""
Expand Down
2 changes: 2 additions & 0 deletions scripts/Diffraction/wish/wishSX.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def __init__(self, *args, **kwargs):
<centre x="0.0" y="0.0" z="0.0" />
<radius val="0.0025"/>
</sphere>""" # sphere radius 2.5mm - used for vanadium and NaCl
self.beam_width = 0.2 # cm
self.beam_height = 0.4 # cm

def process_data(self, runs: Sequence[str], *args):
"""
Expand Down

0 comments on commit 8e09cb7

Please sign in to comment.