Skip to content

Commit

Permalink
Ewm6534 fix missing parameters in call to raw vanadium correction algo (
Browse files Browse the repository at this point in the history
#508)

* Add all changes for testing on analysis.

* Reverting changes for WorkflowImplementer.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove this, ended up in the wrong branch

* Update diffcal_masking_script.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and rboston628 committed Dec 6, 2024
1 parent 74dd608 commit 31d1605
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from snapred.backend.dao.ingredients import NormalizationIngredients as Ingredients
from snapred.backend.recipe.algorithm.MantidSnapper import MantidSnapper
from snapred.meta.Config import Config


class RawVanadiumCorrectionAlgorithm(PythonAlgorithm):
Expand Down Expand Up @@ -91,17 +92,24 @@ def chopNeutronData(self, inputWS: str, outputWS: str) -> None:
self.mantidSnapper.executeQueue()

def shapedAbsorption(self, inputWS: str, absorptionWS: str, sampleShape: str):
numberOfSlices = Config["constants.RawVanadiumCorrection.numberOfSlices"]
numberOfAnnuli = Config["constants.RawVanadiumCorrection.numberOfAnnuli"]

if sampleShape == "Cylinder":
self.mantidSnapper.CylinderAbsorption(
"Create cylinder absorption data",
InputWorkspace=inputWS,
OutputWorkspace=absorptionWS,
NumberOfSlices=numberOfSlices,
NumberOfAnnuli=numberOfAnnuli,
)
elif sampleShape == "Sphere":
self.mantidSnapper.SphericalAbsorption(
"Create spherical absorption data",
InputWorkspace=inputWS,
OutputWorkspace=absorptionWS,
NumberOfSlices=numberOfSlices,
NumberOfAnnuli=numberOfAnnuli,
)
else:
raise RuntimeError("Must use cylindrical or spherical calibrant samples\n")
Expand Down
4 changes: 4 additions & 0 deletions src/snapred/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ constants:
lowdSpacingCrop: 0.1
highdSpacingCrop: 0.15

RawVanadiumCorrection:
numberOfSlices: 10
numberOfAnnuli: 10

docs:
user:
path: /SNS/SNAP/shared/Malcolm/SNAPUserDocs/_build/html/index.html
Expand Down
4 changes: 4 additions & 0 deletions tests/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ constants:
lowdSpacingCrop: 0.1
highdSpacingCrop: 0.15

RawVanadiumCorrection:
numberOfSlices: 10
numberOfAnnuli: 10

metadata:
tagPrefix: testSNAPfuntime_

Expand Down

0 comments on commit 31d1605

Please sign in to comment.