Skip to content

Commit

Permalink
Re #5199 Getting rid of old EQSANS algo + more docs for wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed May 1, 2012
1 parent c6d56b3 commit 8fb169e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 243 deletions.
2 changes: 0 additions & 2 deletions Code/Mantid/Framework/WorkflowAlgorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ set ( SRC_FILES
src/EQSANSInstrument.cpp
src/SANSSolidAngleCorrection.cpp
src/SANSSensitivityCorrection.cpp
src/EQSANSSensitivityCorrection.cpp
src/EQSANSDarkCurrentSubtraction.cpp
src/EQSANSPatchSensitivity.cpp
src/HFIRDarkCurrentSubtraction.cpp
Expand All @@ -28,7 +27,6 @@ set ( INC_FILES
inc/MantidWorkflowAlgorithms/HFIRInstrument.h
inc/MantidWorkflowAlgorithms/SANSSolidAngleCorrection.h
inc/MantidWorkflowAlgorithms/SANSSensitivityCorrection.h
inc/MantidWorkflowAlgorithms/EQSANSSensitivityCorrection.h
inc/MantidWorkflowAlgorithms/EQSANSDarkCurrentSubtraction.h
inc/MantidWorkflowAlgorithms/EQSANSPatchSensitivity.h
inc/MantidWorkflowAlgorithms/HFIRDarkCurrentSubtraction.h
Expand Down

This file was deleted.

This file was deleted.

27 changes: 16 additions & 11 deletions Code/Mantid/Framework/WorkflowAlgorithms/src/RefReduction.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*WIKI*
Reflectivity reduction workflow. This workflow algorithm computes the
specular and off-specular reflectivity for both REFM and REFL instruments.
*WIKI*/
//----------------------------------------------------------------------
// Includes
Expand Down Expand Up @@ -52,33 +52,38 @@ using namespace DataObjects;

void RefReduction::init()
{
declareProperty("DataRun", "");
declareProperty("DataRun", "", "Run number of the data set to be reduced");
declareProperty(
new ArrayProperty<int>("SignalPeakPixelRange"),
"Pixel range for the signal peak");

declareProperty("SubtractSignalBackground", false);
declareProperty("SubtractSignalBackground", false,
"If true, the background will be subtracted from the signal peak");
declareProperty(
new ArrayProperty<int>("SignalBackgroundPixelRange"),
"Pixel range for background around the signal peak");

declareProperty("CropLowResDataAxis", false);
declareProperty("CropLowResDataAxis", false,
"If true, the low-resolution pixel range will be limited to the"
" range given by the LowResDataAxisPixelRange property");
declareProperty(
new ArrayProperty<int>("LowResDataAxisPixelRange"),
"Pixel range for the signal peak in the low-res direction");

declareProperty("PerformNormalization", true);
declareProperty("NormalizationRun", "");
declareProperty("PerformNormalization", true, "If true, the normalization will be performed");
declareProperty("NormalizationRun", "", "Run number of the normalization data set");
declareProperty(
new ArrayProperty<int>("NormPeakPixelRange"),
"Pixel range for the normalization peak");

declareProperty("SubtractNormBackground", false);
declareProperty("SubtractNormBackground", false, "It true, the background will be subtracted"
" from the normalization peak");
declareProperty(
new ArrayProperty<int>("NormBackgroundPixelRange"),
"Pixel range for background around the normalization peak");

declareProperty("CropLowResNormAxis", false);
declareProperty("CropLowResNormAxis", false, "If true, the low-resolution pixel range"
" will be limited to be the range given by the LowResNormAxisPixelRange property");
declareProperty(
new ArrayProperty<int>("LowResNormAxisPixelRange"),
"Pixel range for the normalization peak in the low-res direction");
Expand All @@ -94,7 +99,7 @@ void RefReduction::init()
declareProperty("DetectorAngle", EMPTY_DBL());
declareProperty("DetectorAngle0", EMPTY_DBL());
declareProperty("DirectPixel", EMPTY_DBL());
declareProperty("PolarizedData", true);
declareProperty("PolarizedData", true, "If true, the algorithm will look for polarization states in the data set");
setPropertySettings("ReflectivityPixel", new VisibleWhenProperty("Instrument", IS_EQUAL_TO, "REF_M") );
setPropertySettings("DetectorAngle", new VisibleWhenProperty("Instrument", IS_EQUAL_TO, "REF_M") );
setPropertySettings("DetectorAngle0", new VisibleWhenProperty("Instrument", IS_EQUAL_TO, "REF_M") );
Expand All @@ -108,7 +113,7 @@ void RefReduction::init()
instrOptions.push_back("REF_M");
declareProperty("Instrument","REF_M",boost::make_shared<StringListValidator>(instrOptions),
"Instrument to reduce for");
declareProperty("OutputWorkspacePrefix","reflectivity");
declareProperty("OutputWorkspacePrefix","reflectivity", "Prefix to give the output workspaces");
declareProperty("OutputMessage","",Direction::Output);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
/*WIKI*
This SANS workflow algorithm will compute the sensitivity correction
from a given flood field data set. It will apply the proper corrections
to the data according the the input property manager object. Those
corrections may include dark current subtraction, moving the beam center,
the solid angle correction, and applying a patch.
If an input workspace is given, the computed correction will be applied
to that workspace.
A Nexus file containing a pre-calculated sensitivity correction can also
be supplied for the case where we simply want to apply the correction to
an input workspace.
*WIKI*/
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidWorkflowAlgorithms/SANSSensitivityCorrection.h"
//#include "MantidWorkflowAlgorithms/ReductionTableHandler.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidAPI/WorkspaceValidators.h"
#include "MantidAPI/AnalysisDataService.h"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -334,31 +334,3 @@ def execute(self, reducer, workspace):
log_text += "I(Qx,Qy) for %s saved in %s" % (output_ws, filename)

return log_text

class SensitivityCorrection(BaseSensitivityCorrection):
"""
Perform sensitivity correction as a function of wavelength
"""
def __init__(self, flood_data, min_sensitivity=0.5, max_sensitivity=1.5, dark_current=None,
beam_center=None, use_sample_dc=False):
super(SensitivityCorrection, self).__init__(flood_data=flood_data,
min_sensitivity=min_sensitivity, max_sensitivity=max_sensitivity,
dark_current=dark_current, beam_center=beam_center, use_sample_dc=use_sample_dc)

def execute(self, reducer, workspace):
# Perform standard sensitivity correction
# If the sensitivity correction workspace exists, just apply it. Otherwise create it.
output_str = " Using data set: %s" % extract_workspace_name(self._flood_data)
if self._efficiency_ws is None:
self._compute_efficiency(reducer, workspace)

# Modify for wavelength dependency of the efficiency of the detector tubes
EQSANSSensitivityCorrection(InputWorkspace=workspace, EfficiencyWorkspace=self._efficiency_ws,
Factor=0.95661, Error=0.005, OutputWorkspace=workspace,
OutputEfficiencyWorkspace="__wl_efficiency")

# Copy over the efficiency's masked pixels to the reduced workspace
MaskDetectors(InputWorkspace=workspace, MaskedWorkspace=self._efficiency_ws)

return "Wavelength-dependent sensitivity correction applied\n%s\n" % output_str

0 comments on commit 8fb169e

Please sign in to comment.