BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
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. More... | |
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. More... | |
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... | |
Collection of utils for 1D and 2D image processing (background, peaks, ets).
bool HistoUtils::agreesWithReference | ( | const SimulationResult & | dat, |
const std::string & | refFileName, | ||
double | tol | ||
) |
Returns true if SimulatioResult agrees with data from reference file.
Definition at line 80 of file HistoUtils.cpp.
References DataUtils::checkRelativeDifference(), SimulationResult::data(), and IntensityDataIOFactory::readOutputData().
std::vector< std::pair< double, double > > HistoUtils::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.
Definition at line 25 of file HistoUtils.cpp.
References IAxis::bin(), Bin1D::binSize(), Bin1D::center(), IHistogram::createOutputData(), ArrayUtils::createVector2D(), IAxis::size(), IHistogram::xAxis(), and IHistogram::yAxis().
double HistoUtils::getRelativeDifference | ( | const IHistogram & | dat, |
const IHistogram & | ref | ||
) |
Definition at line 73 of file HistoUtils.cpp.
References IHistogram::getData(), OutputData< T >::meanValues(), and DataUtils::relativeDataDifference().
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 )
Definition at line 60 of file HistoUtils.cpp.
References SimulationResult::empty(), Numeric::GetRelativeDifference(), and SimulationResult::size().