Class Datafield holds experimental or simulated scattering data.
Most important, the function simulation.simulate() returns an object of class Datafield.
A Datafield object contains
To set the title of Datafield df:
df.setTitle("text")
This is particularly useful for disambiguating datafields that are put together in a list.
Functions make_plot and plot_multicurve from module ba_plot
use datafield titles to generate a legend.
For detailed reference, see Export.
To save a Datafield df in a file:
ba.IOFactory.writeDatafield(df, file_name)
where file_name must have an extension .(txt|int|tif),
and may have a second extension .(gz|bz2).
To extract NumPy arrays from a Datafield df:
df.xCenters() # centers of x bins
df.dataArray() # intensities
df.errors() # error estimates thereof
For detailed reference, see Plotting.
To plot a Datafield df:
from bornagain import ba_plot as bp
bp.plot_simulation_result(df)
bp.plt.show()
To determine pekas in a 2d Datafield, use