Skip to content
Snippets Groups Projects
Commit 98c2583d authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Use smaller number of wavelength points for HRPD slab abs corr

For thin samples the number of sample elements ends up quite high
and simulating each wavelength is unrealistic.
parent 3b69d340
No related branches found
No related tags found
No related merge requests found
......@@ -61,9 +61,19 @@ def calculate_slab_absorb_corrections(ws_to_correct, sample_details_obj):
if previous_units != ws_units.wavelength:
ws_to_correct = mantid.ConvertUnits(InputWorkspace=ws_to_correct, OutputWorkspace=ws_to_correct,
Target=ws_units.wavelength)
# set element size based on thickness
sample_thickness = sample_details_obj.thickness()
# half and convert cm to mm 5=(0.5*10)
element_size = 5.*sample_thickness
# limit number of wavelength points as for small samples the number of elements can be required to be quite large
if sample_thickness < 0.1: # 1mm
nlambda = 100
else:
nlambda = None # use all points
absorb_factors = mantid.HRPDSlabCanAbsorption(InputWorkspace=ws_to_correct,
Thickness=str(sample_details_obj.thickness()))
Thickness=sample_thickness,
ElementSize=element_size,
NumberOfWavelengthPoints=nlambda)
ws_to_correct = mantid.Divide(LHSWorkspace=ws_to_correct, RHSWorkspace=absorb_factors,
OutputWorkspace=ws_to_correct)
mantid.DeleteWorkspace(Workspace=absorb_factors)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment