Skip to content

Commit

Permalink
refs #10384 A bit more Rebib properties and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Oct 24, 2014
1 parent 8f3ccfa commit 31b4a9e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
26 changes: 20 additions & 6 deletions Code/Mantid/Framework/Algorithms/src/Rebin.cpp
Expand Up @@ -2,14 +2,18 @@
// Includes
//----------------------------------------------------------------------
#include "MantidAlgorithms/Rebin.h"
#include "MantidAPI/WorkspaceValidators.h"
#include "MantidDataObjects/EventWorkspace.h"

#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/RebinParamsValidator.h"
#include "MantidKernel/VectorHelper.h"
#include "MantidKernel/ListValidator.h"
#include "MantidKernel/RebinParamsValidator.h"
#include "MantidKernel/VisibleWhenProperty.h"

#include "MantidAPI/WorkspaceValidators.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidDataObjects/EventList.h"


namespace Mantid
{
namespace Algorithms
Expand Down Expand Up @@ -93,16 +97,26 @@ namespace Mantid
"then the workspace gets converted to a Workspace2D histogram.");

declareProperty("FullBinsOnly", false, "Omit the final bin if it's width is smaller than the step size");

//---------------------------------------------------------------
//
auto vsValidator = boost::make_shared<CompositeValidator>();
vsValidator->add<InstrumentValidator>();
vsValidator->add<WorkspaceUnitValidator>("TOF");
vsValidator->add<HistogramValidator>();
declareProperty(new WorkspaceProperty<>("FlatBkgWorkspace","",Direction::Input,API::PropertyMode::Optional,vsValidator),
"An optional histogram workspace in the units of TOF, containing the same number of spectra as the \"InputWorkspace\" "
"and single Y value per each spectra, representing flat background in the time bin of this "
"and single Y value per each spectra, representing flat background in this time bin. "
"If such workspace is present, the value of the flat background provided by this workspace is removed "
"from each spectra of the rebinned workspace");
"from each spectra of the rebinned workspace. This works for histogram and event workspace when events are not retained
"but actually useful for event workspace in the units different from TOF.");
std::vector<std::string> dE_modes = Kernel::DeltaEMode().availableTypes();
declareProperty("dEAnalysisMode",dE_modes[Kernel::DeltaEMode::Direct],boost::make_shared<Kernel::StringListValidator>(dE_modes),
"If FlatBkgWorkspace, this property is used to define the units conversion from TOF to the units of the InputWorkspace",Direction::Input);
setPropertySettings("dEAnalysisMode",
new Kernel::VisibleWhenProperty("FlatBkgWorkspace", IS_NOT_EQUAL_TO, ""));
}
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Kernel/inc/MantidKernel/Unit.h
Expand Up @@ -168,10 +168,10 @@ class MANTID_KERNEL_DLL Unit
{ return initialized; }

/// some units can be converted from TOF only in the range of TOF ;
/// This function returns minimal TOF value still reversively convertable into the unit.
/// This function returns minimal TOF value still reversibly convertible into the unit.
virtual double conversionTOFMin()const=0;

/// This function returns maximal TOF value still reversively convertable into the unit.
/// This function returns maximal TOF value still reversibly convertible into the unit.
virtual double conversionTOFMax()const=0;

/**The range where conversion to TOF from given units is monotonic and reversible*/
Expand Down
Expand Up @@ -30,7 +30,7 @@ namespace Mantid
namespace Kernel
{
//-------------------------------------------------------------------------
// Forward declations
// Forward declarations
//-------------------------------------------------------------------------
class Unit;

Expand Down

0 comments on commit 31b4a9e

Please sign in to comment.