The BornAgain I/O module supports only a few file formats:
tiff and our own internal format. This might be not enough when it comes to the fitting of data obtained from some particular instrument.
However, we fully support fitting of the data presented in the form of
The fitting workflow is as follows:
In the code snippet below we show how to create a numpy array from a file in
edf format using the fabio library.
import fabio img = fabio.open("experimental_data.edf") print(img.header) data = img.data.astype("float64")
Later in the code this data array can be used to setup a fitting job.
import bornagain as ba fit_objective = FitObjective() fit_objective.addSimulationAndData(simulation_builder, data)
The BornAgain I/O module supports a limited amount of file formats:
tiff and an internal text format
If the file name contains
.bzip2 extensions, the module considers them as compressed and performs uncompressing on-the-flight.
import bornagain as ba data = ba.IntensityDataIOFactory.readIntensityData("experimental_data.int.gz").array()