Skip to content

Commit

Permalink
Merge branch 'master' into feature/10850_remove_indirect_verbose_option
Browse files Browse the repository at this point in the history
Conflicts:
	Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataAnalysis.ui
	Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/IndirectDataReduction.ui
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ApplyCorr.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/CalcCorr.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/ConvFit.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/Fury.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/FuryFit.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectCalibration.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectDiagnostics.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectMoments.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectSymmetrise.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/IndirectTransmission.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect/MSDFit.cpp
	Code/Mantid/MantidQt/CustomInterfaces/src/IndirectLoadILL.cpp

Refs #10850
  • Loading branch information
DanNixon committed Feb 6, 2015
2 parents 895c283 + b275b7e commit 803f3a8
Show file tree
Hide file tree
Showing 475 changed files with 33,987 additions and 20,087 deletions.
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
@@ -1,14 +1,13 @@
The [developer documentation](http://www.mantidproject.org/Category:Development) has information on how to participate in the mantid project as a developer. This document is meant to outline the steps for contributing to mantid without becomming a developer.
The [developer documentation](http://www.mantidproject.org/Category:Development) has information on how to participate in the mantid project as a developer. This document is meant to outline the steps for contributing to mantid without becomming a developer. We aspire to have similar guidelines as [github](https://github.com/blog/1943-how-to-write-the-perfect-pull-request).

1. [Fork](https://help.github.com/articles/fork-a-repo) the repository.
2. Make changes as you see fit. Please still follow the guidelines for [running the unit tests](http://www.mantidproject.org/Running_the_unit_tests) and the [build servers](http://www.mantidproject.org/The_automated_build_process).
3. Before submitting pull requests email mantid-help@mantidproject.org, and a developer will set up a branch that you can submit pull requests to.
4. Submit a [pull request](https://help.github.com/articles/using-pull-requests) to this branch.
4. Submit a [pull request](https://help.github.com/articles/using-pull-requests) to this branch. This is a start to the conversation.
3. (Optional) email mantid-help@mantidproject.org requests to.


Hints to make the integration of your changes easy:
Hints to make the integration of your changes easy (and happen faster):
- Keep your pull requests small
- Some comments are part of the build server infrastructure (e.g. 'test this please')
- Don't forget your unit tests
- All algorithms need documentation, don't forget the .rst file
- Contact us before creating the pull request
- Don't take changes requests to change your code personally
53 changes: 32 additions & 21 deletions Code/Mantid/Build/Jenkins/buildscript
Expand Up @@ -15,28 +15,39 @@
cmake --version
echo "SHA1=${sha1}"

if [[ ${JOB_NAME} == *clang* ]]; then
# Assuming we are using the clang compiler
echo "Using clang/llvm compiler."
clang --version
export CC=clang
export CXX=clang++
#check if CMakeCache.txt exists and if so that the cxx compiler is clang++
#only needed with incremental builds. Clean builds delete this directory in a later step.
if [[ -e $WORKSPACE/build/CMakeCache.txt ]] && [[ ${JOB_NAME} != *clean* ]]; then
COMPILERFILEPATH=`grep 'CMAKE_CXX_COMPILER:FILEPATH' $WORKSPACE/build/CMakeCache.txt`
if [[ $COMPILERFILEPATH != *clang++* ]]; then
# Removing the build directory entirely guarantees clang is used.
rm -rf $WORKSPACE/build
fi
fi
fi

###############################################################################
# OS X setup steps
###############################################################################
if [[ $(uname) == 'Darwin' ]]; then
if [[ ${JOB_NAME} == *clang* ]]; then
# Assuming we are using the clang compiler
echo "Using clang/llvm compiler."
clang --version
else
# Assuming we are using the Intel compiler
cd $WORKSPACE/Code
./fetch_Third_Party.sh
cd $WORKSPACE
# Setup environment variables
source /opt/intel/bin/iccvars.sh intel64
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$WORKSPACE/Code/Third_Party/lib/mac64:/Library/Frameworks
# Make sure we pick up the Intel compiler
export CC=icc
export CXX=icpc
echo "Using Intel compiler."
icpc --version
fi
# OS X 10.8 setup steps
###############################################################################
if [[ $(uname) == 'Darwin' ]] && [[ ${JOB_NAME} != *clang* ]]; then
# Assuming we are using the Intel compiler
cd $WORKSPACE/Code
./fetch_Third_Party.sh
cd $WORKSPACE
# Setup environment variables
source /opt/intel/bin/iccvars.sh intel64
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$WORKSPACE/Code/Third_Party/lib/mac64:/Library/Frameworks
# Make sure we pick up the Intel compiler
export CC=icc
export CXX=icpc
echo "Using Intel compiler."
icpc --version
fi

###############################################################################
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Build/dev-packages/deb/mantid-developer/README
Expand Up @@ -2,5 +2,5 @@ This directory contains the structure required to build the simple mantid-develo

To build the package:
* Switch to the directory containing this file
* Run "dpkg --build mantid-developer-1.2.2"
* A file called mantid-developer-1.2.2.deb will appear in the current directory.
* Run "dpkg --build mantid-developer-1.2.3"
* A file called mantid-developer-1.2.3.deb will appear in the current directory.
@@ -0,0 +1,13 @@
Package: mantid-developer
Version: 1.2.3
Section: main
Priority: optional
Architecture: all
Depends: git, clang, cmake-qt-gui(>=2.8.12), qt4-qmake, qt4-dev-tools, libqt4-dbg, libpoco-dev(>=1.4.2), libboost-all-dev, libboost-dbg, libnexus0-dev, libgoogle-perftools-dev, libqwt5-qt4-dev, libqwtplot3d-qt4-dev, python-qt4-dev, libgsl0-dev, liboce-visualization-dev, libmuparser-dev, python-numpy, libssl-dev, libqscintilla2-dev, texlive,texlive-latex-extra, dvipng, libhdf4-dev, doxygen, python-sphinx, python-scipy, ipython-qtconsole (>=1.2.0), libhdf5-dev, libhdf4-dev, libpococrypto11-dbg, libpocodata11-dbg, libpocofoundation11-dbg, libpocomysql11-dbg, libpoconet11-dbg, libpoconetssl11-dbg, libpocoodbc11-dbg, libpocosqlite11-dbg, libpocoutil11-dbg, libpocoxml11-dbg, libpocozip11-dbg, python-qt4-dbg, qt4-default, ninja-build, libjsoncpp-dev, python-dateutil
Installed-Size: 0
Maintainer: Mantid Project <mantid-help@mantidproject.org>
Description: Installs all packages required for a Mantid developer
A metapackage which requires all the dependencies and tools that are
required for Mantid development. It works for Ubuntu version 14.04, 14.10
Some packages (poco) must be newer than thiose in the Ubuntu repository. Please
follow instructions at http://www.mantidproject.org/Mantid_Prerequisites#Repositories
Expand Up @@ -25,19 +25,16 @@
#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
#endif

#include <Poco/DOM/DOMParser.h>
#include <Poco/DOM/Document.h>
#include <Poco/DOM/Element.h>
#include <Poco/DOM/NodeList.h>
#include <Poco/DOM/NodeIterator.h>
#include <Poco/DOM/NodeFilter.h>
#include <Poco/File.h>
#include <Poco/Path.h>

#include "MantidAPI/DllConfig.h"
#include "MantidKernel/ArrayProperty.h"
#include "ImplicitFunctionParameter.h"

namespace Poco {
namespace DOM {
class Element;
}
}

/** XML Parser for parameter types for ImplicitFunctions
@author Owen Arnold, Tessella plc
Expand Down
3 changes: 1 addition & 2 deletions Code/Mantid/Framework/API/src/IPowderDiffPeakFunction.cpp
Expand Up @@ -10,7 +10,6 @@
#include <cmath>

const double IGNOREDCHANGE = 1.0E-9;
const double PI = 3.14159265358979323846264338327950288419716939937510582;

namespace Mantid {
namespace API {
Expand Down Expand Up @@ -271,7 +270,7 @@ std::complex<double> E1(std::complex<double> z) {
exp_e1 = exp_e1 * exp(-z);
if (rz < 0.0 && fabs(imag(z)) < 1.0E-10) {
std::complex<double> u(0.0, 1.0);
exp_e1 = exp_e1 - (PI * u);
exp_e1 = exp_e1 - (M_PI * u);
}
}

Expand Down
5 changes: 4 additions & 1 deletion Code/Mantid/Framework/Algorithms/CMakeLists.txt
Expand Up @@ -203,6 +203,7 @@ set ( SRC_FILES
src/ResetNegatives.cpp
src/ResizeRectangularDetector.cpp
src/RingProfile.cpp
src/RRFMuon.cpp
src/SANSDirectBeamScaling.cpp
src/SassenaFFT.cpp
src/SaveGSASInstrumentFile.cpp
Expand Down Expand Up @@ -456,6 +457,7 @@ set ( INC_FILES
inc/MantidAlgorithms/ResetNegatives.h
inc/MantidAlgorithms/ResizeRectangularDetector.h
inc/MantidAlgorithms/RingProfile.h
inc/MantidAlgorithms/RRFMuon.h
inc/MantidAlgorithms/SANSDirectBeamScaling.h
inc/MantidAlgorithms/SassenaFFT.h
inc/MantidAlgorithms/SaveGSASInstrumentFile.h
Expand Down Expand Up @@ -516,7 +518,7 @@ if(UNITY_BUILD)
endif(UNITY_BUILD)

set ( TEST_FILES
# CalMuonDeadTimeTest.h
CalMuonDeadTimeTest.h
# CountEventsInPulsesTest.h
# UpdatePeakParameterTableTest.h
AddLogDerivativeTest.h
Expand Down Expand Up @@ -703,6 +705,7 @@ set ( TEST_FILES
ResetNegativesTest.h
ResizeRectangularDetectorTest.h
RingProfileTest.h
RRFMuonTest.h
SassenaFFTTest.h
SaveGSASInstrumentFileTest.h
ScaleTest.h
Expand Down
77 changes: 77 additions & 0 deletions Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/RRFMuon.h
@@ -0,0 +1,77 @@
#ifndef MANTID_ALGORITHM_RRFMUON_H_
#define MANTID_ALGORITHM_RRFMUON_H_

//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"
#include <gsl/gsl_errno.h>
#include <gsl/gsl_fft_complex.h>

namespace Mantid
{
namespace Algorithms
{
/**Algorithm for calculating Muon decay envelope.
@author Raquel Alvarez, ISIS, RAL
@date 5/12/2014
Copyright &copy; 2014-12 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport RRFMuon : public API::Algorithm
{
public:
/// Default constructor
RRFMuon() {};
/// Destructor
virtual ~RRFMuon() {};
/// Algorithm's name for identification overriding a virtual method
virtual const std::string name() const { return "RRFMuon";}
///Summary of algorithm's purpose
virtual const std::string summary() const {return "Calculate Muon polarization in the rotating reference frame (RRF).";}

/// Algorithm's version for identification overriding a virtual method
virtual int version() const { return 1;}
/// Algorithm's category for identification overriding a virtual method
virtual const std::string category() const { return "Muon";}

private:

/// Initialise the properties
void init();
/// Run the algorithm
void exec();

/// Frequency of the oscillations
double m_freq;
/// Phase accounting for any misalignment of the counters
double m_phase;
/// Number of data points per histogram
size_t m_nData;
/// Number of histograms
size_t m_nHisto;
};

} // namespace Algorithms
} // namespace Mantid

#endif /*MANTID_ALGORITHM_RRFMUON_H_*/
96 changes: 96 additions & 0 deletions Code/Mantid/Framework/Algorithms/src/RRFMuon.cpp
@@ -0,0 +1,96 @@
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAlgorithms/RRFMuon.h"
#include "MantidKernel/ArrayProperty.h"
#include <boost/shared_array.hpp>

#define REAL(z,i) ((z)[2*(i)])
#define IMAG(z,i) ((z)[2*(i)+1])

namespace Mantid
{
namespace Algorithms
{

using namespace Kernel;
using API::Progress;

// Register the class into the algorithm factory
DECLARE_ALGORITHM(RRFMuon)

/** Initialisation method. Declares properties to be used in algorithm.
*
*/
void RRFMuon::init()
{

declareProperty(new API::WorkspaceProperty<API::MatrixWorkspace>("InputWorkspace", "", Direction::Input),
"Name of the input workspace containing the spectra in the lab frame");

declareProperty(new API::WorkspaceProperty<API::MatrixWorkspace>("OutputWorkspace", "", Direction::Output),
"Name of the output workspace containing the spectra in the RRF" );

declareProperty(new PropertyWithValue<double>("Frequency", 0, Direction::Input),
"Frequency of the oscillations");

declareProperty(new PropertyWithValue<double>("Phase", 0, Direction::Input),
"Phase accounting for any misalignment of the counters");

}

/** Executes the algorithm
*
*/
void RRFMuon::exec()
{
// Get input workspace containing polarization in the lab-frame
API::MatrixWorkspace_sptr inputWs = getProperty("InputWorkspace");
// Get frequency
m_freq = getProperty("Frequency");
// Get phase
m_phase = getProperty("Phase");
// Get number of histograms
m_nHisto = inputWs->getNumberHistograms();
if ( m_nHisto != 2 )
{
throw std::runtime_error("Invalid number of spectra in input workspace");
}
// Set number of data points
m_nData = inputWs->blocksize();

// Compute the RRF polarization
const double twoPiFreq = 2. * M_PI * m_freq;
MantidVec time = inputWs->readX(0); // X axis: time
MantidVec labRe = inputWs->readY(0); // Lab-frame polarization (real part)
MantidVec labIm = inputWs->readY(1); // Lab-frame polarization (imaginary part)
MantidVec rrfRe(m_nData), rrfIm(m_nData); // Rotating Reference frame (RRF) polarizations
for (size_t t=0; t<m_nData; t++)
{
rrfRe [t] = labRe [t] * cos(twoPiFreq * time[t] + m_phase) + labIm [t] * sin(twoPiFreq * time[t] + m_phase);
rrfIm [t] = -labRe [t] * sin(twoPiFreq * time[t] + m_phase) + labIm [t] * cos(twoPiFreq * time[t] + m_phase);
}

// Create output workspace to put results into
API::MatrixWorkspace_sptr outputWs = boost::dynamic_pointer_cast<API::MatrixWorkspace>(
API::WorkspaceFactory::Instance().create("Workspace2D", m_nHisto, m_nData+1, m_nData));
outputWs->getAxis(0)->unit() = inputWs->getAxis(0)->unit();

// Put results into output workspace
// Real RRF polarization
outputWs->getSpectrum(0)->setSpectrumNo(1);
outputWs->dataX(0) = inputWs->readX(0);
outputWs->dataY(0) = rrfRe;
// Imaginary RRF polarization
outputWs->getSpectrum(1)->setSpectrumNo(2);
outputWs->dataX(1) = inputWs->readX(1);
outputWs->dataY(1) = rrfIm;

// Set output workspace
setProperty("OutputWorkspace", outputWs);

}


}
}
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/RayTracerTester.cpp
Expand Up @@ -6,6 +6,8 @@
#include "MantidKernel/System.h"
#include "MantidKernel/V3D.h"

#include <cmath>

using namespace Mantid::Kernel;
using namespace Mantid::API;
using namespace Mantid::DataObjects;
Expand Down Expand Up @@ -66,9 +68,9 @@ void RayTracerTester::exec() {
Progress prog(this, 0.3, 1.0, NumAzimuth);
for (int iaz = 0; iaz < NumAzimuth; iaz++) {
prog.report();
double az = double(iaz) * 3.14159 * 2.0 / double(NumAzimuth);
double az = double(iaz) * M_PI * 2.0 / double(NumAzimuth);
for (int iz = 0; iz < NumZenith; iz++) {
double zen = double(iz) * 3.14159 * 1.0 / double(NumZenith);
double zen = double(iz) * M_PI / double(NumZenith);
double x = cos(az);
double z = sin(az);
double y = cos(zen);
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/Algorithms/test/CalMuonDeadTimeTest.h
Expand Up @@ -3,7 +3,7 @@

#include <cxxtest/TestSuite.h>

#include "MantidDataHandling/LoadMuonNexus.h"
#include "MantidDataHandling/LoadMuonNexus1.h"
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidDataHandling/GroupDetectors.h"
#include "MantidAPI/IAlgorithm.h"
Expand Down Expand Up @@ -39,10 +39,10 @@ class CalMuonDeadTimeTest : public CxxTest::TestSuite
TS_ASSERT( calDeadTime.isInitialized() )
}

void xtestCalDeadTime()
void testCalDeadTime()
{
//Load the muon nexus file
Mantid::DataHandling::LoadMuonNexus loader;
Mantid::DataHandling::LoadMuonNexus1 loader;
loader.initialize();
loader.setPropertyValue("Filename", "emu00006473.nxs");
loader.setPropertyValue("OutputWorkspace", "EMU6473");
Expand Down

0 comments on commit 803f3a8

Please sign in to comment.