-
Notifications
You must be signed in to change notification settings - Fork 121
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 11187_threadsanitizer
- Loading branch information
Showing
75 changed files
with
2,439 additions
and
827 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
78 changes: 78 additions & 0 deletions
78
Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ExtractSpectra.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,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 © 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_ */ |
53 changes: 53 additions & 0 deletions
53
Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/RemoveMaskedSpectra.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,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 © 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_ */ |
Oops, something went wrong.