Skip to content
Snippets Groups Projects
Commit 442a5268 authored by Harriet Brown's avatar Harriet Brown
Browse files

Update docs and changelog, add todo for after user comments

parent 067991d7
No related branches found
No related tags found
No related merge requests found
......@@ -9,11 +9,12 @@
Description
-----------
This algorithm takes an incident spectrum function and it's derivative and
calculates the time-of-flight Placzek scattering correction from the workspaces
material sample and detector info. [1]_ [2]_ [3]_ For obtaining the incident spectrum
from a measurement (ie beam monitors or calibrant sample), the
:ref:FitIncidentSpectrum <algm-FitIncidentSpectrum> can provide the necessary inputs.
This algorithm takes an incident spectrum function and it's derivative, along with
the workspace containing spectrum info and calculates the time-of-flight Placzek
scattering correction from the workspaces material sample and detector info.
[1]_ [2]_ [3]_ For obtaining the incident spectrum from a measurement (ie beam
monitors or calibrant sample), the :ref:FitIncidentSpectrum <algm-FitIncidentSpectrum>
can provide the necessary inputs.
Usage
-----
......@@ -71,7 +72,8 @@ Usage
InputWorkspace='fit_wksp',
ChemicalFormula='Co')
CalculatePlaczekSelfScattering(
InputWorkspace='fit_wksp',
InputWorkspace='incident_wksp',
InputSpectra='fit_wksp',
OutputWorkspace='placzek_scattering')
......
......@@ -22,6 +22,7 @@ Improvements
- :ref:`SNAPReduce <algm-SNAPReduce-v1>` has an additional parameter ``MaxChunkSize`` for customizing the chunking behavior
- :ref:`LorentzCorrection <algm-LorentzCorrection-v1>` has an additional option for single crystal (default) or powder operation
- The create_total_scattering_pdf method in Polaris scripts now supports merging banks with a weighted mean.
- The create_total_scattering_pdf method in Polaris scripts now applies the Placzek self scattering correction from :ref:CalculatePlaczekSelfScattering <algm-CalculatePlaczekSelfScattering>.
Bug Fixes
#########
......
......@@ -173,6 +173,9 @@ sum of the detector banks performed using supplied Q limits *q_lims=q_limits*, Q
form of a numpy array with shape (2, x) where x is the number rof detectors, or a string containing the
directory of an appropriately formatted `.lim` file.
This function applies the placzek self scattering correction from
:ref:CalculatePlaczekSelfScattering <algm-CalculatePlaczekSelfScattering> before calculating the PDF
This function requires the run_number you wish to analyse. The focused file for this run number must
either be loaded in Mantid with the naming format given by the *focus* method:
......
......@@ -177,6 +177,7 @@ def _merge_workspace_with_limits(focused_ws, q_lims):
q_min[i] = pdf_x_array[tmp2]
q_max[i] = pdf_x_array[np.amax(np.where(pdf_x_array <= q_max[i]))]
bin_width = min(pdf_x_array[1] - pdf_x_array[0], bin_width)
# TODO what is the best spectra to use to match in any case, how can we always pick the correct one
mantid.MatchSpectra(InputWorkspace=focused_ws_conjoined,
OutputWorkspace=focused_ws_conjoined,
ReferenceSpectrum=5)
......@@ -195,6 +196,7 @@ def _calculate_self_scattering_correction(run_number, cal_file_name, sample_deta
mantid.SetSample(InputWorkspace=raw_ws,
Geometry=common.generate_sample_geometry(sample_details),
Material=common.generate_sample_material(sample_details))
# TODO find way to automaticaly select best monitor for incident spectrum
monitor = mantid.ExtractSpectra(InputWorkspace=raw_ws, WorkspaceIndexList=[11])
monitor = mantid.ConvertUnits(InputWorkspace=monitor, Target="Wavelength")
x_data = monitor.dataX(0)
......
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