Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/10945_pylintwarnings Conflicts: Code/Mantid/scripts/Inelastic/Direct/DirectEnergyConversion.py Code/Mantid/scripts/Inelastic/Direct/ReductionHelpers.py Code/Mantid/scripts/Inelastic/Direct/ReductionWrapper.py Code/Mantid/scripts/Inelastic/Direct/dgreduce.py Code/Mantid/scripts/Inelastic/DirectPropertyManager.py Code/Mantid/scripts/Inelastic/DirectReductionProperties.py
- Loading branch information
Showing
94 changed files
with
4,922 additions
and
3,517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Code/Mantid/Build/dev-packages/deb/mantid-developer/mantid-developer-1.2.3/DEBIAN/control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/RRFMuon.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 © 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_*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
|
||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.