Skip to content

Commit

Permalink
refs #9184. Merge branch 'master'
Browse files Browse the repository at this point in the history
Merge branch 'master' into feature/9184_correct_positions_rro

Conflicts:
	Code/Mantid/Framework/Algorithms/src/ReflectometryReductionOne.cpp
  • Loading branch information
OwenArnold committed Jun 4, 2014
2 parents 759476e + e2afd78 commit 396ba4e
Show file tree
Hide file tree
Showing 1,402 changed files with 26,621 additions and 12,965 deletions.
1 change: 1 addition & 0 deletions Code/Mantid/Build/CMake/FindSphinx.cmake
Expand Up @@ -8,6 +8,7 @@
# SPHINX_EXECUTABLE

find_program( SPHINX_EXECUTABLE NAME sphinx-build
PATHS ${CMAKE_LIBRARY_PATH}/Python27/Scripts
PATH_SUFFIXES bin
DOC "Sphinx documentation generator"
)
Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/Build/Jenkins/buildscript
Expand Up @@ -35,7 +35,7 @@ if [[ ${JOB_NAME} == *clean* ]]; then
# Set some variables relating to the linux packages created from clean builds
if [[ $(uname) != 'Darwin' ]]; then
if [[ ${JOB_NAME} == *master* ]]; then
PACKAGINGVARS="-DENVVARS_ON_INSTALL=False -DCMAKE_INSTALL_PREFIX=/opt/mantidnightly -DCPACK_PACKAGE_SUFFIX=nightly -DCPACK_SET_DESTDIR=OFF -DQT_ASSISTANT_FETCH_IMAGES=ON"
PACKAGINGVARS="-DENVVARS_ON_INSTALL=False -DCMAKE_INSTALL_PREFIX=/opt/mantidnightly -DCPACK_PACKAGE_SUFFIX=nightly -DCPACK_SET_DESTDIR=OFF"
elif [[ ${JOB_NAME} == *develop* ]]; then
PACKAGINGVARS="-DENVVARS_ON_INSTALL=False -DCMAKE_INSTALL_PREFIX=/opt/mantidunstable -DCPACK_PACKAGE_SUFFIX=unstable -DCPACK_SET_DESTDIR=OFF"
fi
Expand Down Expand Up @@ -84,7 +84,6 @@ $SCL_ON_RHEL6 "ctest --output-on-failure -R MantidPlot"
rm -f *.dmg *.rpm *.deb *.tar.gz
# Always build a package on linux
if [[ $(uname) != 'Darwin' ]]; then
$SCL_ON_RHEL6 "make -j$BUILD_THREADS qtassistant"
$SCL_ON_RHEL6 "cpack"
fi

Expand Down
6 changes: 1 addition & 5 deletions Code/Mantid/Build/Jenkins/buildscript.bat
Expand Up @@ -25,9 +25,6 @@ if "%JOB_NAME%"=="%JOB_NAME:clean=%" (
) else (
set CLEANBUILD=yes
rmdir /S /Q build
if NOT "%JOB_NAME%"=="%JOB_NAME:master=%" (
set DOC_IMAGES=-DQT_ASSISTANT_FETCH_IMAGES=ON
)
)

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expand All @@ -39,7 +36,7 @@ cd %WORKSPACE%\build
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: CMake configuration
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -G "Visual Studio 11 Win64" -DCONSOLE=OFF -DENABLE_CPACK=ON -DMAKE_VATES=ON -DParaView_DIR=%PARAVIEW_DIR% -DUSE_PRECOMPILED_HEADERS=ON %DOC_IMAGES% ..\Code\Mantid
"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -G "Visual Studio 11 Win64" -DCONSOLE=OFF -DENABLE_CPACK=ON -DMAKE_VATES=ON -DParaView_DIR=%PARAVIEW_DIR% -DUSE_PRECOMPILED_HEADERS=ON ..\Code\Mantid
if ERRORLEVEL 1 exit /B %ERRORLEVEL%

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expand All @@ -61,7 +58,6 @@ if ERRORLEVEL 1 exit /B %ERRORLEVEL%
:: Create the install kit if this is a clean build
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if "%CLEANBUILD%" EQU "yes" (
msbuild /nologo /m:%BUILD_THREADS% /nr:false /p:Configuration=Release docs/qtassistant/qtassistant.vcxproj
if ERRORLEVEL 1 exit /B %ERRORLEVEL%
cpack -C Release --config CPackConfig.cmake
)
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmFactory.h
Expand Up @@ -125,6 +125,9 @@ class MANTID_API_DLL AlgorithmFactoryImpl : public Kernel::DynamicFactory<Algori
/// Get the algorithm names and version - mangled use decodeName to separate
const std::vector<std::string> getKeys() const;
const std::vector<std::string> getKeys(bool includeHidden) const;

/// Returns the highest version of the algorithm currently registered
int highestVersion(const std::string & algorithmName) const;

///Get the algorithm categories
const std::set<std::string> getCategories(bool includeHidden=false) const;
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/ExperimentInfo.h
Expand Up @@ -73,6 +73,8 @@ namespace API

/// Replaces current parameter map with copy of given map
void replaceInstrumentParameters(const Geometry::ParameterMap & pmap);
/// exchange contents of current parameter map with contents of other map)
void swapInstrumentParameters(Geometry::ParameterMap & pmap);

/// Cache a lookup of grouped detIDs to member IDs
void cacheDetectorGroupings(const det2group_map & mapping);
Expand Down
15 changes: 15 additions & 0 deletions Code/Mantid/Framework/API/src/AlgorithmFactory.cpp
Expand Up @@ -227,6 +227,21 @@ namespace Mantid
}
}

/**
* @param algorithmName The name of an algorithm registered with the factory
* @return An integer corresponding to the highest version registered
* @throw std::invalid_argument if the algorithm cannot be found
*/
int AlgorithmFactoryImpl::highestVersion(const std::string &algorithmName) const
{
VersionMap::const_iterator viter = m_vmap.find(algorithmName);
if(viter != m_vmap.end()) return viter->second;
else
{
throw std::invalid_argument("AlgorithmFactory::highestVersion() - Unknown algorithm '" + algorithmName + "'");
}
}

/**
* Return the categories of the algorithms. This includes those within the Factory itself and
* any cleanly constructed algorithms stored here.
Expand Down
31 changes: 0 additions & 31 deletions Code/Mantid/Framework/API/src/CompositeFunction.cpp
@@ -1,34 +1,3 @@
/*WIKI*
A composite function is a function containing other functions. It combines the values calculated by the member functions by adding them. The members are indexed from 0 to the number of functions minus 1. The indices are defined by the order in which the functions were added. Composite functions do not have their own parameters, instead they use parameters of the member functions. Parameter names are formed from the member function's index and its parameter name: f[index].[name]. For example, name "f0.Sigma" would be given to the "Sigma" parameter of a Gaussian added first to the composite function. If a member function is a composite function itself the same principle applies: 'f[index].' is prepended to a name, e.g. "f0.f1.Sigma".
The input string to the Fit algorithm for a CompositeFunction is constructed by joining the inputs of the member functions using the semicolon ';' as a separator. For example, the string for two [[Gaussian]]s with tied sigma parameters may look like the following:
name=Gaussian,PeakCentre=0,Height=1,Sigma=0.1,constraints=(0<Sigma<1);name=Gaussian,PeakCentre=1,Height=1,Sigma=0.1;ties=(f1.Sigma=f0.Sigma)
Note that the ties clause is also separated by a semicolon. It is done because the parameters are from different functions. Ties between parameters of the same function can be placed inside the member definition in which the local parameter names must be used, for example:
name = FunctionType, P1=0, ties=( P2 = 2*P1 ); name = FunctionType, P1=0, ties=( P2 = 3 )
which is equivalent to
name = FunctionType, P1=0; name = FunctionType, P1=0; ties=( f0.P2 = 2*f0.P1, f1.P2 = 3 )
Boundary constraints usually make sense to put in a local function definition but they can also be moved to the composite function level, i.e. can be separated by ';'. In this case the full parameter name must be used, for example:
name=Gaussian,PeakCentre=0,Height=1,Sigma=0.1;name=Gaussian,PeakCentre=1,Height=1,Sigma=0.1;ties=(f1.Sigma=f0.Sigma);constraints=(0<f0.Sigma<1)
Mantid defines a number of fitting functions which extend CompositeFunction. These are functions which also include other functions but use different operations to combine them. Examples are [[ProductFunction]] and [[Convolution]]. Everything said about parameters of the CompositeFunction applies to these functions.
Input strings of an extended composite function must start with "composite=FunctionName;" and followed by the definitions of its members as described for CompositeFunction. For example,
composite=ProductFunction;name=LinearBackground;name=ExpDecay
To define a composite function inside a composite function enclose the inner one in brackets:
name=LinearBackground;(composite=Convolution;name=Resolution;name=Lorentzian)
*WIKI*/
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions Code/Mantid/Framework/API/src/ExperimentInfo.cpp
Expand Up @@ -316,6 +316,16 @@ namespace API
{
this->m_parmap.reset(new ParameterMap(pmap));
}
//---------------------------------------------------------------------------------------
/**
* exchanges contents of current parameter map with contents of other map)
* @ pmap reference to parameter map which would exchange its contents with current map
*/
void ExperimentInfo::swapInstrumentParameters(Geometry::ParameterMap & pmap)
{
this->m_parmap->swap(pmap);
}


//---------------------------------------------------------------------------------------
/**
Expand Down
19 changes: 18 additions & 1 deletion Code/Mantid/Framework/API/test/AlgorithmFactoryTest.h
Expand Up @@ -106,6 +106,23 @@ class AlgorithmFactoryTest : public CxxTest::TestSuite
TS_ASSERT_THROWS_NOTHING(keys = AlgorithmFactory::Instance().getKeys());
TS_ASSERT_EQUALS(noOfAlgs - 1, keys.size());
}

void test_HighestVersion()
{
auto & factory = AlgorithmFactory::Instance();

TS_ASSERT_THROWS(factory.highestVersion("ToyAlgorithm"), std::invalid_argument);

AlgorithmFactory::Instance().subscribe<ToyAlgorithm>();
TS_ASSERT_EQUALS(1, factory.highestVersion("ToyAlgorithm"));

Mantid::Kernel::Instantiator<ToyAlgorithmTwo, Algorithm>* newTwo = new Mantid::Kernel::Instantiator<ToyAlgorithmTwo, Algorithm>;
AlgorithmFactory::Instance().subscribe(newTwo);
TS_ASSERT_EQUALS(2, factory.highestVersion("ToyAlgorithm"));

AlgorithmFactory::Instance().unsubscribe("ToyAlgorithm",1);
AlgorithmFactory::Instance().unsubscribe("ToyAlgorithm",2);
}

void testCreate()
{
Expand Down Expand Up @@ -201,4 +218,4 @@ class AlgorithmFactoryTest : public CxxTest::TestSuite

};

#endif
#endif
14 changes: 7 additions & 7 deletions Code/Mantid/Framework/API/test/FileFinderTest.h
Expand Up @@ -234,13 +234,13 @@ class FileFinderTest: public CxxTest::TestSuite
{
ConfigService::Instance().setString("default.facility","ISIS");
std::vector<std::string> files;
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15189-n15199"), std::invalid_argument);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15189n-15199"), std::invalid_argument);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15189-15199n"), std::invalid_argument);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15189-151n99"), std::invalid_argument);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15n189-151n99"), Exception::NotFoundError);
TS_ASSERT_THROWS_NOTHING(files = FileFinder::Instance().findRuns("MUSR15189-15199"));
TS_ASSERT_EQUALS(files.size(), 11);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15189-n15193"), std::invalid_argument);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15189n-15193"), std::invalid_argument);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15189-15193n"), std::invalid_argument);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15189-151n93"), std::invalid_argument);
TS_ASSERT_THROWS(files = FileFinder::Instance().findRuns("MUSR15n189-151n93"), Exception::NotFoundError);
TS_ASSERT_THROWS_NOTHING(files = FileFinder::Instance().findRuns("MUSR15189-15193"));
TS_ASSERT_EQUALS(files.size(), 5);
std::vector<std::string>::iterator it = files.begin();

for (; it != files.end(); ++it)
Expand Down
Expand Up @@ -91,8 +91,8 @@ namespace Algorithms
void processSingleValueFilter(double minvalue, double maxvalue,
bool filterincrease, bool filterdecrease);

void processMultipleValueFilters(double minvalue, double maxvalue,
bool filterincrease, bool filterdecrease);
void processMultipleValueFilters(double minvalue, double valueinterval, double maxvalue,
bool filterincrease, bool filterdecrease);

void makeFilterByValue(Kernel::TimeSplitterType& split, double min, double max, double TimeTolerance, bool centre,
bool filterIncrease, bool filterDecrease, Kernel::DateAndTime startTime, Kernel::DateAndTime stopTime,
Expand Down
21 changes: 0 additions & 21 deletions Code/Mantid/Framework/Algorithms/src/AbsorptionCorrection.cpp
@@ -1,24 +1,3 @@
/*WIKI*
This algorithm uses a numerical integration method to calculate attenuation factors resulting from absorption and single scattering in a sample with the material properties given. Factors are calculated for each spectrum (i.e. detector position) and wavelength point, as defined by the input workspace.
The sample is first bounded by a cuboid, which is divided up into small cubes. The cubes whose centres lie within the sample make up the set of integration elements (so you have a kind of 'Lego' model of the sample) and path lengths through the sample are calculated for the centre-point of each element, and a numerical integration is carried out using these path lengths over the volume elements.
Note that the duration of this algorithm is strongly dependent on the element size chosen, and that too small an element size can cause the algorithm to fail because of insufficient memory.
Note that The number density of the sample is in <math> \mathrm{\AA}^{-3} </math>
== Choosing an absorption correction algorithm ==
This flow chart is given as a way of selecting the most appropriate of the absorption correction algorithms. It also shows the algorithms that must be run first in each case. Note that this does not cover the following absorption correction algorithms: [[MonteCarloAbsorption]] (correction factors for a generic sample using a Monte Carlo instead of a numerical integration method), [[MultipleScatteringCylinderAbsorption]] & [[AnvredCorrection]] (corrections in a spherical sample, using a method imported from ISAW). Also, HRPD users can use the [[HRPDSlabCanAbsorption]] to add rudimentary calculations of the effects of the sample holder.
[[File:AbsorptionFlow.png]]
==== Assumptions ====
This algorithm assumes that the (parallel) beam illuminates the entire sample '''unless''' a 'gauge volume' has been defined using the [[DefineGaugeVolume]] algorithm (or by otherwise adding a valid XML string [[HowToDefineGeometricShape | defining a shape]] to a [[Run]] property called "GaugeVolume"). In this latter case only scattering within this volume (and the sample) is integrated, because this is all the detector can 'see'. The full sample is still used for the neutron paths. ('''N.B.''' If your gauge volume is of axis-aligned cuboid shape and fully enclosed by the sample then you will get a more accurate result from the [[CuboidGaugeVolumeAbsorption]] algorithm.)
==== Restrictions on the input workspace ====
The input workspace must have units of wavelength. The [[instrument]] associated with the workspace must be fully defined because detector, source & sample position are needed.
*WIKI*/
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
Expand Down
15 changes: 0 additions & 15 deletions Code/Mantid/Framework/Algorithms/src/AddLogDerivative.cpp
@@ -1,17 +1,3 @@
/*WIKI*
This algorithm performs a simple numerical derivative of the values in a sample log.
The 1st order derivative is simply: dy = (y1-y0) / (t1-t0), which is placed in the log at t=(t0+t1)/2
Higher order derivatives are obtained by performing the equation above N times.
Since this is a simple numerical derivative, you can expect the result to quickly
get noisy at higher derivatives.
If any of the times in the logs are repeated, then those repeated time values will be skipped,
and the output derivative log will have fewer points than the input.
*WIKI*/
#include "MantidAlgorithms/AddLogDerivative.h"
#include "MantidKernel/System.h"
#include "MantidKernel/TimeSeriesProperty.h"
Expand Down Expand Up @@ -163,4 +149,3 @@ namespace Algorithms

} // namespace Mantid
} // namespace Algorithms

7 changes: 0 additions & 7 deletions Code/Mantid/Framework/Algorithms/src/AddPeak.cpp
@@ -1,9 +1,3 @@
/*WIKI*
Adds a [[IPeak]] to a [[PeaksWorkspace]].
*WIKI*/

#include "MantidAlgorithms/AddPeak.h"
#include "MantidKernel/System.h"
#include "MantidAPI/IPeaksWorkspace.h"
Expand Down Expand Up @@ -148,4 +142,3 @@ namespace Algorithms

} // namespace Mantid
} // namespace Algorithms

7 changes: 0 additions & 7 deletions Code/Mantid/Framework/Algorithms/src/AddSampleLog.cpp
@@ -1,10 +1,3 @@
/*WIKI*
Workspaces contain information in logs. Often these detail what happened to the sample during the experiment. This algorithm allows one named log to be entered.
The log can be either a String, a Number, or a Number Series. If you select Number Series, the workspace start time will be used as the time of the log entry, and the number in the text used as the (only) value.
If the LogText contains a numeric value, the created log will be of integer type if an integer is passed and floating point (double) otherwise. This applies to both the Number & Number Series options.
*WIKI*/
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
Expand Down
20 changes: 0 additions & 20 deletions Code/Mantid/Framework/Algorithms/src/AddTimeSeriesLog.cpp
@@ -1,23 +1,3 @@
/*WIKI*
Creates/updates a time-series log entry on a chosen workspace. The given timestamp & value are appended to the
named log entry. If the named entry does not exist then a new log is created. A time stamp must be given in
ISO8601 format, e.g. 2010-09-14T04:20:12.
By default, the given value is interpreted as a double and a double series is either created or expected. However,
if the "Type" is set to "int" then the value is interpreted as an integer and an integer is either created
or expected.
*WIKI*/
/*WIKI_USAGE*
'''Python'''
import datetime as dt
# Add an entry for the current time
log_name = "temperature"
log_value = 21.5
AddTimeSeriesLog(inOutWS, Name=log_name, Time=dt.datetime.utcnow().isoformat(), Value=log_value)
*WIKI_USAGE*/

#include "MantidAlgorithms/AddTimeSeriesLog.h"
#include "MantidKernel/DateTimeValidator.h"
#include "MantidKernel/MandatoryValidator.h"
Expand Down
16 changes: 0 additions & 16 deletions Code/Mantid/Framework/Algorithms/src/AlignDetectors.cpp
@@ -1,19 +1,3 @@
/*WIKI*
The offsets are a correction to the dSpacing values and are applied during the conversion from time-of-flight to dSpacing as follows:
:<math> d = \frac{h}{2m_N} \frac{t.o.f.}{L_{tot} sin \theta} (1+ \rm{offset})</math>
The detector offsets can be obtained from either: an [[OffsetsWorkspace]] where each pixel has one value, the offset; or a .cal file (in the form created by the ARIEL software).
'''Note:''' the workspace that this algorithms outputs is a [[Ragged Workspace]].
==== Restrictions on the input workspace ====
The input workspace must contain histogram or event data where the X unit is time-of-flight and the Y data is raw counts. The [[instrument]] associated with the workspace must be fully defined because detector, source & sample position are needed.
*WIKI*/
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
Expand Down
11 changes: 0 additions & 11 deletions Code/Mantid/Framework/Algorithms/src/AlphaCalc.cpp
@@ -1,12 +1,3 @@
/*WIKI*
Returns the relative efficiency of the forward detector group compared to the backward detector group. If Alpha is larger than 1 more counts has been collected in the forward group.
This algorithm leave the input workspace unchanged. To group detectors in a workspace use [[GroupDetectors]].
*WIKI*/
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
Expand Down Expand Up @@ -156,5 +147,3 @@ void AlphaCalc::exec()

} // namespace Algorithm
} // namespace Mantid


35 changes: 0 additions & 35 deletions Code/Mantid/Framework/Algorithms/src/AppendSpectra.cpp
@@ -1,38 +1,3 @@
/*WIKI*
This algorithm appends the spectra of two workspaces together.
The output workspace from this algorithm will be a copy of the first
input workspace, to which the data from the second input workspace
will be appended.
Workspace data members other than the data (e.g. instrument etc.) will be copied
from the first input workspace (but if they're not identical anyway,
then you probably shouldn't be using this algorithm!).
==== Restrictions on the input workspace ====
For [[EventWorkspace]]s, there are no restrictions on the input workspaces if ValidateInputs=false.
For [[Workspace2D]]s, the number of bins must be the same in both inputs.
If ValidateInputs is selected, then the input workspaces must also:
* Come from the same instrument
* Have common units
* Have common bin boundaries
==== Spectrum Numbers ====
If there is an overlap in the spectrum numbers of both inputs, then the output
workspace will have its spectrum numbers reset starting at 0 and increasing by
1 for each spectrum.
==== See Also ====
* [[ConjoinWorkspaces]] for joining parts of the same workspace.
*WIKI*/

#include "MantidAlgorithms/AppendSpectra.h"
#include "MantidKernel/System.h"
#include "MantidAPI/WorkspaceValidators.h"
Expand Down

0 comments on commit 396ba4e

Please sign in to comment.