Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 11187_threadsanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve committed May 4, 2015
2 parents 990ba39 + 830111e commit 67ba2d7
Show file tree
Hide file tree
Showing 75 changed files with 2,439 additions and 827 deletions.
6 changes: 6 additions & 0 deletions Code/Mantid/Framework/Algorithms/CMakeLists.txt
Expand Up @@ -100,6 +100,7 @@ set ( SRC_FILES
src/ExtractMask.cpp
src/ExtractMaskToTable.cpp
src/ExtractSingleSpectrum.cpp
src/ExtractSpectra.cpp
src/FFT.cpp
src/FFTDerivative.cpp
src/FFTSmooth.cpp
Expand Down Expand Up @@ -198,6 +199,7 @@ set ( SRC_FILES
src/RemoveBins.cpp
src/RemoveExpDecay.cpp
src/RemoveLowResTOF.cpp
src/RemoveMaskedSpectra.cpp
src/RemovePromptPulse.cpp
src/RemoveWorkspaceHistory.cpp
src/RenameWorkspace.cpp
Expand Down Expand Up @@ -358,6 +360,7 @@ set ( INC_FILES
inc/MantidAlgorithms/ExtractMask.h
inc/MantidAlgorithms/ExtractMaskToTable.h
inc/MantidAlgorithms/ExtractSingleSpectrum.h
inc/MantidAlgorithms/ExtractSpectra.h
inc/MantidAlgorithms/FFT.h
inc/MantidAlgorithms/FFTDerivative.h
inc/MantidAlgorithms/FFTSmooth.h
Expand Down Expand Up @@ -457,6 +460,7 @@ set ( INC_FILES
inc/MantidAlgorithms/RemoveBins.h
inc/MantidAlgorithms/RemoveExpDecay.h
inc/MantidAlgorithms/RemoveLowResTOF.h
inc/MantidAlgorithms/RemoveMaskedSpectra.h
inc/MantidAlgorithms/RemovePromptPulse.h
inc/MantidAlgorithms/RemoveWorkspaceHistory.h
inc/MantidAlgorithms/RenameWorkspace.h
Expand Down Expand Up @@ -623,6 +627,7 @@ set ( TEST_FILES
ExtractMaskTest.h
ExtractMaskToTableTest.h
ExtractSingleSpectrumTest.h
ExtractSpectraTest.h
FFTDerivativeTest.h
FFTSmooth2Test.h
FFTTest.h
Expand Down Expand Up @@ -709,6 +714,7 @@ set ( TEST_FILES
RemoveBinsTest.h
RemoveExpDecayTest.h
RemoveLowResTOFTest.h
RemoveMaskedSpectraTest.h
RemovePromptPulseTest.h
RemoveWorkspaceHistoryTest.h
RenameWorkspaceTest.h
Expand Down
Expand Up @@ -5,9 +5,6 @@
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"
#include "MantidDataObjects/EventWorkspace.h"

#include <climits>

namespace Mantid {
namespace Algorithms {
Expand Down Expand Up @@ -91,31 +88,6 @@ class DLLExport CropWorkspace : public API::Algorithm {
void init();
/// Execution code
void exec();
void execEvent();

void checkProperties();
std::size_t getXMin(const int wsIndex = 0);
std::size_t getXMax(const int wsIndex = 0);
void cropRagged(API::MatrixWorkspace_sptr outputWorkspace, int inIndex,
int outIndex);

/// The input workspace
API::MatrixWorkspace_sptr m_inputWorkspace;
DataObjects::EventWorkspace_sptr eventW;
/// The bin index to start the cropped workspace from
std::size_t m_minX;
/// The bin index to end the cropped workspace at
std::size_t m_maxX;
/// The spectrum index to start the cropped workspace from
specid_t m_minSpec;
/// The spectrum index to end the cropped workspace at
specid_t m_maxSpec;
/// Flag indicating whether the input workspace has common boundaries
bool m_commonBoundaries;
/// Flag indicating whether we're dealing with histogram data
bool m_histogram;
/// Flag indicating whether XMin and/or XMax has been set
bool m_croppingInX;
};

} // namespace Algorithms
Expand Down
@@ -0,0 +1,78 @@
#ifndef MANTID_ALGORITHMS_EXTRACTSPECTRA_H_
#define MANTID_ALGORITHMS_EXTRACTSPECTRA_H_

#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidDataObjects/EventWorkspace.h"

namespace Mantid {
namespace Algorithms {

/** Extracts specified spectra from a workspace and places them in a new
workspace.
Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
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 ExtractSpectra : public API::Algorithm {
public:
ExtractSpectra();
virtual ~ExtractSpectra();

virtual const std::string name() const;
virtual int version() const;
virtual const std::string category() const;
virtual const std::string summary() const;

private:
void init();
void exec();
void execHistogram();
void execEvent();

void checkProperties();
std::size_t getXMin(const int wsIndex = 0);
std::size_t getXMax(const int wsIndex = 0);
void cropRagged(API::MatrixWorkspace_sptr outputWorkspace, int inIndex,
int outIndex);

/// The input workspace
API::MatrixWorkspace_sptr m_inputWorkspace;
DataObjects::EventWorkspace_sptr eventW;
/// The bin index to start the cropped workspace from
std::size_t m_minX;
/// The bin index to end the cropped workspace at
std::size_t m_maxX;
/// Flag indicating whether the input workspace has common boundaries
bool m_commonBoundaries;
/// Flag indicating whether we're dealing with histogram data
bool m_histogram;
/// Flag indicating whether XMin and/or XMax has been set
bool m_croppingInX;
/// The list of spectra to extract.
std::vector<specid_t> m_spectrumList;
};

} // namespace Algorithms
} // namespace Mantid

#endif /* MANTID_ALGORITHMS_EXTRACTSPECTRA_H_ */
@@ -0,0 +1,53 @@
#ifndef MANTID_ALGORITHMS_REMOVEMASKEDSPECTRA_H_
#define MANTID_ALGORITHMS_REMOVEMASKEDSPECTRA_H_

#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"

namespace Mantid {
namespace Algorithms {

/** RemoveMaskedSpectra removes all masked spectra.
Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
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 RemoveMaskedSpectra : public API::Algorithm {
public:
RemoveMaskedSpectra();
virtual ~RemoveMaskedSpectra();

virtual const std::string name() const;
virtual int version() const;
virtual const std::string category() const;
virtual const std::string summary() const;

private:
void init();
void exec();
void makeIndexList(std::vector<specid_t> &indices,
const API::MatrixWorkspace *maskedWorkspace);
};

} // namespace Algorithms
} // namespace Mantid

#endif /* MANTID_ALGORITHMS_REMOVEMASKEDSPECTRA_H_ */

0 comments on commit 67ba2d7

Please sign in to comment.