本文整理汇总了C++中NXData::openFloatData方法的典型用法代码示例。如果您正苦于以下问题:C++ NXData::openFloatData方法的具体用法?C++ NXData::openFloatData怎么用?C++ NXData::openFloatData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NXData
的用法示例。
在下文中一共展示了NXData::openFloatData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadDataIntoTheWorkSpace
void LoadLLB::loadDataIntoTheWorkSpace(NeXus::NXEntry &entry) {
// read in the data
NXData dataGroup = entry.openNXData("nxdata");
NXFloat data = dataGroup.openFloatData();
data.load();
// EPP
int calculatedDetectorElasticPeakPosition =
getDetectorElasticPeakPosition(data);
std::vector<double> timeBinning =
getTimeBinning(calculatedDetectorElasticPeakPosition, m_channelWidth);
// Assign time bin to first X entry
m_localWorkspace->dataX(0).assign(timeBinning.begin(), timeBinning.end());
Progress progress(this, 0, 1, m_numberOfTubes * m_numberOfPixelsPerTube);
size_t spec = 0;
for (size_t i = 0; i < m_numberOfTubes; ++i) {
for (size_t j = 0; j < m_numberOfPixelsPerTube; ++j) {
if (spec > 0) {
// just copy the time binning axis to every spectra
m_localWorkspace->dataX(spec) = m_localWorkspace->readX(0);
}
// Assign Y
float *data_p = &data(static_cast<int>(i), static_cast<int>(j));
m_localWorkspace->dataY(spec).assign(data_p, data_p + m_numberOfChannels);
// Assign Error
MantidVec &E = m_localWorkspace->dataE(spec);
std::transform(data_p, data_p + m_numberOfChannels, E.begin(),
LoadLLB::calculateError);
++spec;
progress.report();
}
}
g_log.debug() << "Data loading inti WS done....\n";
}