BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides utility methods to import data files. More...
Functions | |
bool | Compatible (const InstrumentItem &instrumentItem, const RealDataItem &realDataItem) |
Check whether data item is compatible with instrument (same rank) More... | |
std::unique_ptr< OutputData< double > > | CreateSimplifiedOutputData (const OutputData< double > &data) |
Creates OutputData with bin-valued axes. More... | |
QString | Import1dData (RealDataItem *realDataItem, const AbstractDataLoader *selectedLoader) |
Import 1D data into the given item. More... | |
std::unique_ptr< OutputData< double > > | Import2dData (const QString &baseNameOfLoadedFile) |
std::unique_ptr< OutputData< double > > | ImportKnownData (const QString &baseNameOfLoadedFile) |
std::unique_ptr< OutputData< double > > | ImportReflectometryData (const QString &baseNameOfLoadedFile) |
QString | printShapeMessage (const std::vector< int > &instrument_shape, const std::vector< int > &data_shape) |
Composes a message with the shapes of InstrumentItem and RealDataItem. More... | |
Provides utility methods to import data files.
bool ImportDataUtils::Compatible | ( | const InstrumentItem & | instrumentItem, |
const RealDataItem & | realDataItem | ||
) |
Check whether data item is compatible with instrument (same rank)
Definition at line 157 of file ImportDataUtils.cpp.
Referenced by LinkInstrumentManager::canLinkDataToInstrument().
std::unique_ptr< OutputData< double > > ImportDataUtils::CreateSimplifiedOutputData | ( | const OutputData< double > & | data | ) |
Creates OutputData with bin-valued axes.
Definition at line 164 of file ImportDataUtils.cpp.
References OutputData< T >::axis(), IAxis::getName(), OutputData< T >::getRawDataVector(), OutputData< T >::rank(), and IAxis::size().
Referenced by ImportKnownData().
QString ImportDataUtils::Import1dData | ( | RealDataItem * | realDataItem, |
const AbstractDataLoader * | selectedLoader | ||
) |
Import 1D data into the given item.
Returns an error text if a fatal error occurred (discard item). "Empty string" means "no fatal error" => imported item should be kept. The imported item still can have errors, but they might be solvable by different import settings or by using a different data loader. selectedLoader is the one which was selected in the open-file-dialog (or null if none selected).
Definition at line 92 of file ImportDataUtils.cpp.
References AbstractDataLoader::clone(), AbstractDataLoader::guessSettings(), ImportKnownData(), AbstractDataLoader::initWithDefaultImportSettings(), DataFormatUtils::isCompressed(), DataFormatUtils::isIntFile(), DataFormatUtils::isTiffFile(), RealDataItem::nativeFileName(), AbstractDataLoader::processContents(), RealDataItem::setDataLoader(), AbstractDataLoader::setFileContents(), RealDataItem::setImportData(), and AbstractDataLoader::setRealDataItem().
Referenced by RealDataSelectorWidget::importData().
std::unique_ptr< OutputData< double > > ImportDataUtils::Import2dData | ( | const QString & | baseNameOfLoadedFile | ) |
Definition at line 87 of file ImportDataUtils.cpp.
References ImportKnownData().
Referenced by RealDataSelectorWidget::importData().
std::unique_ptr< OutputData< double > > ImportDataUtils::ImportKnownData | ( | const QString & | baseNameOfLoadedFile | ) |
Definition at line 53 of file ImportDataUtils.cpp.
References CreateSimplifiedOutputData(), IntensityDataIOFactory::readOutputData(), and GUIHelpers::warning().
Referenced by Import1dData(), and Import2dData().
std::unique_ptr< OutputData< double > > ImportDataUtils::ImportReflectometryData | ( | const QString & | baseNameOfLoadedFile | ) |
Definition at line 71 of file ImportDataUtils.cpp.
References IntensityDataIOFactory::readReflectometryData(), and GUIHelpers::warning().
QString ImportDataUtils::printShapeMessage | ( | const std::vector< int > & | instrument_shape, |
const std::vector< int > & | data_shape | ||
) |
Composes a message with the shapes of InstrumentItem and RealDataItem.
Definition at line 184 of file ImportDataUtils.cpp.
Referenced by LinkInstrumentManager::canLinkDataToInstrument().