BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
HistoUtils Namespace Reference

Collection of utils for 1D and 2D image processing (background, peaks, ets). More...

Functions

bool agreesWithReference (const SimulationResult &dat, const std::string &refFileName, double tol)
 Returns true if SimulatioResult agrees with data from reference file.
 
std::vector< std::pair< double, double > > FindPeaks (const Histogram2D &hist, double sigma=2, const std::string &option={}, double threshold=0.05)
 Returns vector of peak center coordinates, for peaks in given histogram.
 
double getRelativeDifference (const IHistogram &dat, const IHistogram &ref)
 
double RelativeDifference (const SimulationResult &dat, const SimulationResult &ref)
 Returns sum of relative differences between each pair of elements: (a, b) -> 2*abs(a - b)/(a + b) ( and zero if a-b=0 ) More...
 

Detailed Description

Collection of utils for 1D and 2D image processing (background, peaks, ets).

Function Documentation

◆ RelativeDifference()

double HistoUtils::RelativeDifference ( const SimulationResult dat,
const SimulationResult ref 
)

Returns sum of relative differences between each pair of elements: (a, b) -> 2*abs(a - b)/(a + b) ( and zero if a-b=0 )

Returns sum of relative differences between each pair of elements: (a, b) -> 2*abs(a - b)/(|a| + |b|) ( and zero if a=b=0 within epsilon )