BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Provides users with possibility to read and write IntensityData from/to files in different format. More...
Static Public Member Functions | |
static IHistogram * | readIntensityData (const std::string &file_name) |
Reads file and returns newly created Histogram object. More... | |
static OutputData< double > * | readOutputData (const std::string &file_name) |
Reads file and returns newly created OutputData object. More... | |
static OutputData< double > * | readReflectometryData (const std::string &file_name) |
static void | writeIntensityData (const IHistogram &histogram, const std::string &file_name) |
Writes histogram in file. More... | |
static void | writeOutputData (const OutputData< double > &data, const std::string &file_name) |
Writes OutputData in file. More... | |
static void | writeSimulationResult (const SimulationResult &result, const std::string &file_name) |
Writes OutputData contained in the given SimulationResult object. More... | |
Static Private Member Functions | |
static OutputData< double > * | readOutputData (const std::string &file_name, std::function< OutputData< double > *(std::istream &)> readData) |
static void | writeOutputData (const std::string &file_name, std::function< void(std::ostream &)> writeData) |
Provides users with possibility to read and write IntensityData from/to files in different format.
Type of the file will be deduced from file name. *.txt - ASCII file with 2D array [nrow][ncol], layout as in numpy. *.int - BornAgain internal ASCII format. *.tif - 32-bits tiff file. If file name ends with "*.gz" or "*.bz2" the file will be zipped on the fly using appropriate algorithm.
Usage:
Definition at line 47 of file IntensityDataIOFactory.h.
|
static |
Reads file and returns newly created Histogram object.
Definition at line 61 of file IntensityDataIOFactory.cpp.
References IHistogram::createHistogram(), and readOutputData().
Referenced by IHistogram::createFrom(), and IHistogram::load().
|
static |
Reads file and returns newly created OutputData object.
Definition at line 38 of file IntensityDataIOFactory.cpp.
References DataFormatUtils::isIntFile(), DataFormatUtils::isTiffFile(), OutputDataReadWriteINT::readOutputData(), and OutputDataReadWriteNumpyTXT::readOutputData().
Referenced by HistoUtils::agreesWithReference(), ImportDataUtils::ImportKnownData(), DataItem::load(), PointwiseAxisItem::load(), readIntensityData(), and readReflectometryData().
|
staticprivate |
Definition at line 140 of file IntensityDataIOFactory.cpp.
References FileSystemUtils::convert_utf8_to_utf16(), DataFormatUtils::isBZipped(), DataFormatUtils::isCompressed(), FileSystemUtils::IsFileExists(), DataFormatUtils::isGZipped(), and DataFormatUtils::isTiffFile().
|
static |
Definition at line 55 of file IntensityDataIOFactory.cpp.
References readOutputData(), and OutputDataReadReflectometry::readOutputData().
Referenced by ImportDataUtils::ImportReflectometryData().
|
static |
Writes histogram in file.
Definition at line 125 of file IntensityDataIOFactory.cpp.
References IHistogram::createOutputData(), and writeOutputData().
Referenced by IHistogram::save().
|
static |
Writes OutputData in file.
Definition at line 69 of file IntensityDataIOFactory.cpp.
References DataFormatUtils::isIntFile(), DataFormatUtils::isTiffFile(), OutputDataReadWriteINT::writeOutputData(), and OutputDataReadWriteNumpyTXT::writeOutputData().
Referenced by DataItem::save(), PointwiseAxisItem::save(), SavePlotAssistant::saveToFile(), writeIntensityData(), and writeSimulationResult().
|
staticprivate |
Definition at line 87 of file IntensityDataIOFactory.cpp.
References FileSystemUtils::convert_utf8_to_utf16(), DataFormatUtils::isBZipped(), DataFormatUtils::isCompressed(), DataFormatUtils::isGZipped(), and DataFormatUtils::isTiffFile().
|
static |
Writes OutputData contained in the given SimulationResult object.
Definition at line 132 of file IntensityDataIOFactory.cpp.
References SimulationResult::data(), and writeOutputData().