本文整理汇总了C++中mantid::api::MatrixWorkspace_sptr::mutableRun方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixWorkspace_sptr::mutableRun方法的具体用法?C++ MatrixWorkspace_sptr::mutableRun怎么用?C++ MatrixWorkspace_sptr::mutableRun使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mantid::api::MatrixWorkspace_sptr
的用法示例。
在下文中一共展示了MatrixWorkspace_sptr::mutableRun方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shiftTimeInLogForTimeSeries
/**
* Shift the time in a time series. This is similar to the implementation in
* @param ws :: a matrix workspace
* @param prop :: a time series log
* @param timeShift :: the time shift in seconds
*/
void ChangeTimeZero::shiftTimeInLogForTimeSeries(
Mantid::API::MatrixWorkspace_sptr ws, Mantid::Kernel::Property *prop,
double timeShift) const {
if (auto timeSeries =
dynamic_cast<Mantid::Kernel::ITimeSeriesProperty *>(prop)) {
auto newlog = timeSeries->cloneWithTimeShift(timeShift);
ws->mutableRun().addProperty(newlog, true);
}
}
示例2: shiftTimeOfLogs
/**
* Change the time of the logs.
* @param ws :: a workspace
* @param timeShift :: the time shift that is applied to the log files
* @param startProgress :: start point of the progress
* @param stopProgress :: end point of the progress
*/
void ChangeTimeZero::shiftTimeOfLogs(Mantid::API::MatrixWorkspace_sptr ws,
double timeShift, double startProgress,
double stopProgress) {
// We need to change the entries for each log which can be:
// 1. any time series: here we change the time values
// 2. string properties: here we change the values if they are ISO8601 times
auto logs = ws->mutableRun().getLogData();
Progress prog(this, startProgress, stopProgress, logs.size());
for (auto iter = logs.begin(); iter != logs.end(); ++iter) {
if (isTimeSeries(*iter)) {
shiftTimeInLogForTimeSeries(ws, *iter, timeShift);
} else if (auto stringProperty =
dynamic_cast<PropertyWithValue<std::string> *>(*iter)) {
shiftTimeOfLogForStringProperty(stringProperty, timeShift);
}
prog.report(name());
}
}