Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from snapred.backend.dao.GroupPeakList import GroupPeakList
from snapred.backend.dao.state.CalibrantSample import CalibrantSample
from snapred.backend.dao.state.InstrumentState import InstrumentState
from snapred.backend.dao.state.PixelGroup import PixelGroup


Expand All @@ -13,3 +14,4 @@ class NormalizationIngredients(BaseModel):
pixelGroup: PixelGroup
calibrantSample: CalibrantSample
detectorPeaks: List[GroupPeakList]
instrumentState: InstrumentState
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def chopIngredients(self, ingredients: Ingredients) -> None:
self.geometry = ingredients.calibrantSample.geometry
self.material = ingredients.calibrantSample.material
self.sampleShape = self.geometry.shape
self.lambdaMin = ingredients.instrumentState.particleBounds.wavelength.minimum
self.lambdaMax = ingredients.instrumentState.particleBounds.wavelength.maximum

def unbagGroceries(self) -> None:
self.inputVanadiumWS = self.getPropertyValue("InputWorkspace")
Expand Down Expand Up @@ -83,6 +85,30 @@ def chopNeutronData(self, inputWS: str, outputWS: str) -> None:
BinningMode="Logarithmic",
)

# Malcolm added these lines ##################
self.mantidSnapper.ConvertUnits(
"Convert workspace to wavelength units",
InputWorkspace=outputWS,
Outputworkspace=outputWS,
Target="Wavelength",
)

self.mantidSnapper.CropWorkspace(
"crop all events outside of range",
InputWorkspace=outputWS,
Outputworkspace=outputWS,
XMin=self.lambdaMin,
XMax=self.lambdaMax,
)

self.mantidSnapper.ConvertUnits(
"Ensure workspace is in TOF units",
InputWorkspace=outputWS,
Outputworkspace=outputWS,
Target="TOF",
)
################################

self.mantidSnapper.MakeDirtyDish(
"make a copy of data after chop",
InputWorkspace=outputWS,
Expand Down
1 change: 1 addition & 0 deletions src/snapred/backend/service/SousChef.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ def prepNormalizationIngredients(self, ingredients: FarmFreshIngredients) -> Nor
pixelGroup=self.prepPixelGroup(ingredients),
calibrantSample=self.prepCalibrantSample(ingredients.calibrantSamplePath),
detectorPeaks=self.prepDetectorPeaks(ingredients, purgePeaks=False),
instrumentState=self.prepInstrumentState(ingredients),
)

def prepDiffractionCalibrationIngredients(
Expand Down
12 changes: 6 additions & 6 deletions src/snapred/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ instrument:
name: SNAP
home: ${IPTS.root}/SNAP
calibration:
home: ${instrument.home}/shared/Calibration
home: ${instrument.home}/shared/Calibration_testing
sample:
home: ${instrument.calibration.home}/CalibrantSamples
extensions:
Expand Down Expand Up @@ -215,19 +215,19 @@ constants:
tofMax: 14500
rebinParams: [2000, -0.001, 14500]
CropFactors:
lowWavelengthCrop: 0.05
lowdSpacingCrop: 0.1
highdSpacingCrop: 0.15
lowWavelengthCrop: -0.04
lowdSpacingCrop: 0.015
highdSpacingCrop: 0.022
CrystallographicInfo:
crystalDMin: 0.4
crystalDMin: 0.7
crystalDMax: 100.0
DetectorPeakPredictor:
fwhm: 1.17741002252 # used to convert gaussian to fwhm (2 * log_e(2))
LiteDataCreationAlgo:
toggleCompressionTolerance: false # false = no tolerance compression, true = tolerance compression
# tolerance: -0.004 # tolerance override for calculated compression
GroupDiffractionCalibration:
MaxChiSq: 100
MaxChiSq: 10000
RawVanadiumCorrection:
numberOfSlices: 10
numberOfAnnuli: 10
Expand Down
Loading