Skip to content

Commit

Permalink
AddPeak() will not add peak out of data range. Refs #7847.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Sep 10, 2013
1 parent 3e0a5bf commit 24ff832
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ namespace CurveFitting
/// Return the composite function
API::IFunction_sptr getFunction();

/// Get reference to a peak
API::IPowderDiffPeakFunction_sptr getPeak(size_t peakindex);

/// Force to make all peaks to calculate peak parameters
void calPeaksParameters();

Expand Down Expand Up @@ -124,9 +127,6 @@ namespace CurveFitting
/// Log
static Kernel::Logger& g_log;

/// Get reference to a peak
API::IPowderDiffPeakFunction_sptr getPeak(size_t peakindex);

/// Set peak parameters
void setPeakParameters(IPowderDiffPeakFunction_sptr peak, map<string, double > parammap,
double peakheight, bool setpeakheight);
Expand Down
15 changes: 9 additions & 6 deletions Code/Mantid/Framework/CurveFitting/src/LeBailFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,16 @@ namespace CurveFitting
<< tofh << ", which is out of user specified boundary (" << m_minTOFPeakCentre
<< ", " << m_maxTOFPeakCentre << "). " << ".\n";
}
double dsp = newpeak->getPeakParameter("d_h");
else
{
double dsp = newpeak->getPeakParameter("d_h");

// Add new peak to all related data storage
m_vecPeaks.push_back(newpeak);
// FIXME - Refining lattice size is not considered here!
m_dspPeakVec.push_back(make_pair(dsp, newpeak));
m_mapHKLPeak.insert(make_pair(hkl, newpeak));
// Add new peak to all related data storage
m_vecPeaks.push_back(newpeak);
// FIXME - Refining lattice size is not considered here!
m_dspPeakVec.push_back(make_pair(dsp, newpeak));
m_mapHKLPeak.insert(make_pair(hkl, newpeak));
}
}

m_numPeaks = m_vecPeaks.size();
Expand Down

0 comments on commit 24ff832

Please sign in to comment.