当前位置: 首页>>代码示例>>C++>>正文


C++ MatrixWorkspace_sptr::mutableRun方法代码示例

本文整理汇总了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);
  }
}
开发者ID:DiegoMonserrat,项目名称:mantid,代码行数:15,代码来源:ChangeTimeZero.cpp

示例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());
  }
}
开发者ID:DiegoMonserrat,项目名称:mantid,代码行数:27,代码来源:ChangeTimeZero.cpp


注:本文中的mantid::api::MatrixWorkspace_sptr::mutableRun方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。