BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ReadWriteNumpyTXT.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Device/IO/ReadWriteNumpyTXT.h
6 //! @brief Defines ReadWriteNumpyTXT
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_DEVICE_IO_READWRITENUMPYTXT_H
21 #define BORNAGAIN_DEVICE_IO_READWRITENUMPYTXT_H
22 
23 #include <istream>
24 
25 class Datafield;
26 
27 //! Class for reading and writing Datafield from simple ASCII file with the layout as in
28 //! numpy.savetxt.
29 
31 public:
32  Datafield* readDatafield(std::istream& input_stream);
33  void writeDatafield(const Datafield& data, std::ostream& output_stream);
34 
35 private:
36  static void write1DRepresentation(const Datafield& data, std::ostream& output_stream);
37  static void write2DRepresentation(const Datafield& data, std::ostream& output_stream);
38  static double ignoreDenormalized(double value);
39 };
40 
41 #endif // BORNAGAIN_DEVICE_IO_READWRITENUMPYTXT_H
42 #endif // USER_API
Stores radiation power per bin.
Definition: Datafield.h:30
Class for reading and writing Datafield from simple ASCII file with the layout as in numpy....
static double ignoreDenormalized(double value)
static void write2DRepresentation(const Datafield &data, std::ostream &output_stream)
void writeDatafield(const Datafield &data, std::ostream &output_stream)
Datafield * readDatafield(std::istream &input_stream)
static void write1DRepresentation(const Datafield &data, std::ostream &output_stream)