BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
GUI::Util::IO Namespace Reference

Description

Provides utility methods for output data.

Functions

std::unique_ptr< Datafield > binifyAxes (const Datafield &data)
 Creates Datafield with bin-valued axes. More...
 

Function Documentation

◆ binifyAxes()

std::unique_ptr< Datafield > GUI::Util::IO::binifyAxes ( const Datafield &  data)

Creates Datafield with bin-valued axes.

Definition at line 22 of file IOUtils.cpp.

23 {
24  std::vector<IAxis*> axes;
25  for (size_t i = 0; i < data.rank(); ++i)
26  axes.emplace_back(data.axis(i).clone());
27 
28  auto result = std::make_unique<Datafield>(axes);
29 
30  result->setVector(data.flatVector());
31 
32  return result;
33 }