Skip to content

Commit

Permalink
Cherry-pick fixes from feature/9955_nans into next
Browse files Browse the repository at this point in the history
Changes:

    refs #9955. No need for replace special values.

    Replace special values done as part of finding and recording those indexes.
    (cherry picked from commit 0c56422)

    refs #9955. Add test and introduce replace functionality.
    (cherry picked from commit 1355491)

    refs #9955. Special treatment for errors too
    (cherry picked from commit 346f9ea)

    refs #9955. Document and format.
    (cherry picked from commit 7f5d872)
  • Loading branch information
OwenArnold authored and martyngigg committed Aug 20, 2014
1 parent d407354 commit e834c2a
Show file tree
Hide file tree
Showing 4 changed files with 592 additions and 438 deletions.
14 changes: 13 additions & 1 deletion Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Stitch1D.h
Expand Up @@ -68,6 +68,8 @@ namespace Mantid
/// Does the x-axis have non-zero errors
bool hasNonzeroErrors(Mantid::API::MatrixWorkspace_sptr ws);
private:
/// Helper typedef. For storing indexes of special values per spectra per workspace.
typedef std::vector<std::vector<size_t> > SpecialTypeIndexes;
/// Overwrites Algorithm method.
void init();
/// Overwrites Algorithm method.
Expand All @@ -84,7 +86,7 @@ namespace Mantid
Mantid::API::MatrixWorkspace_sptr rebin(Mantid::API::MatrixWorkspace_sptr& input,
const Mantid::MantidVec& params);
/// Perform integration
Mantid::API::MatrixWorkspace_sptr specialIntegration(Mantid::API::MatrixWorkspace_sptr& input,
Mantid::API::MatrixWorkspace_sptr integration(Mantid::API::MatrixWorkspace_sptr& input,
const double& start, const double& stop);
/// Perform multiplication over a range
Mantid::API::MatrixWorkspace_sptr multiplyRange(Mantid::API::MatrixWorkspace_sptr& input,
Expand All @@ -105,8 +107,18 @@ namespace Mantid
Mantid::API::MatrixWorkspace_sptr & source);
/// Mask out everything but the data in the ranges, but do it inplace.
void maskInPlace(int a1, int a2, Mantid::API::MatrixWorkspace_sptr source);
/// Add back in any special values
void reinsertSpecialValues(Mantid::API::MatrixWorkspace_sptr ws);
/// Range tolerance
static const double range_tolerance;
/// Index per workspace spectra of Nans
SpecialTypeIndexes m_nanYIndexes;
/// Index per workspace spectra of Infs
SpecialTypeIndexes m_infYIndexes;
/// Index per workspace spectra of Nans
SpecialTypeIndexes m_nanEIndexes;
/// Index per workspace spectra of Infs
SpecialTypeIndexes m_infEIndexes;

};

Expand Down

0 comments on commit e834c2a

Please sign in to comment.