Skip to content

Commit

Permalink
Re #12398 Create helper class to get errors from workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed Jun 15, 2015
1 parent 8ddecb1 commit b6d4220
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ namespace ALCHelper
/// Create Qwt curve data from a workspace
boost::shared_ptr<QwtData> curveDataFromWs(MatrixWorkspace_const_sptr ws, size_t wsIndex);

/// Create error vector from a workspace
std::vector<double> curveErrorsFromWs(MatrixWorkspace_const_sptr ws, size_t wsIndex);

/// Create Qwt curve data from a function
boost::shared_ptr<QwtData> curveDataFromFunction(IFunction_const_sptr func,
const std::vector<double>& xValues);
Expand Down
11 changes: 11 additions & 0 deletions Code/Mantid/MantidQt/CustomInterfaces/src/Muon/ALCHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ namespace ALCHelper
return boost::make_shared<QwtArrayData>(x,y,size);
}

/**
* Creates vector of errors using E values from the workspace spectra.
* @param ws :: Workspace with E values to use
* @param wsIndex :: Workspace index to use
* @return Vector of errors
*/
std::vector<double> curveErrorsFromWs(MatrixWorkspace_const_sptr ws, size_t wsIndex)
{
return ws->readE(wsIndex);
}

/**
* Creates QwtData with Y values produced by the function for specified X values.
* @param func :: Function to use
Expand Down

0 comments on commit b6d4220

Please sign in to comment.