BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Functions | |
bool | checkRelativeDifference (const OutputData< double > &dat, const OutputData< double > &ref, const double threshold) |
Returns true is relative difference is below threshold; prints informative output. More... | |
void | coordinateFromBinf (double &x, double &y, const OutputData< double > &data) |
Transforms x,y coordinate from bin-fraction-coordinates to OutputData's axes coordinates. More... | |
double | coordinateFromBinf (double value, const IAxis &axis) |
Transforms bin-fraction-coordinate into axis coordinate. More... | |
void | coordinateToBinf (double &x, double &y, const OutputData< double > &data) |
Transforms x,y coordinate from OutputData axes coordinates to bin-fraction-coordinates. More... | |
double | coordinateToBinf (double coordinate, const IAxis &axis) |
Transforms coordinate on axis into the bin-fraction-coordinate. More... | |
std::vector< std::vector< double > > | create2DArrayfromOutputData (const OutputData< double > &data) |
Creates a vector of vectors of double (2D Array) from OutputData. More... | |
std::unique_ptr< OutputData< double > > | createClippedDataSet (const OutputData< double > &origin, double x1, double y1, double x2, double y2) |
Returns new IntensityData objects which axes clipped to represent the specified rectangle. More... | |
std::unique_ptr< OutputData< double > > | createFFT (const OutputData< double > &data) |
Creates Fourier Transform (OutputData format) of intensity map (OutputData format). More... | |
std::unique_ptr< OutputData< double > > | createOutputDatafrom2DArray (const std::vector< std::vector< double >> &array_2d) |
Creates OutputData from a 2D Array. More... | |
std::unique_ptr< OutputData< double > > | createRearrangedDataSet (const OutputData< double > &data, int n) |
Returns new object with input data rotated by n*90 deg counterclockwise (n > 0) or clockwise (n < 0) Axes are swapped if the data is effectively rotated by 90 or 270 degrees Applicable to 2D arrays only. More... | |
std::unique_ptr< OutputData< double > > | createRelativeDifferenceData (const OutputData< double > &data, const OutputData< double > &reference) |
OutputData< double > * | importArrayToOutputData (const std::vector< double > &vec) |
Reads 1D array of doubles to Python, for use in persistence test. More... | |
OutputData< double > * | importArrayToOutputData (const std::vector< std::vector< double >> &vec) |
Reads 2D array of doubles to Python, for use in persistence test. More... | |
double | relativeDataDifference (const OutputData< double > &dat, const OutputData< double > &ref) |
Returns relative difference between two data sets sum(dat[i] - ref[i])/ref[i]). More... | |
bool DataUtils::checkRelativeDifference | ( | const OutputData< double > & | dat, |
const OutputData< double > & | ref, | ||
const double | threshold | ||
) |
Returns true is relative difference is below threshold; prints informative output.
Definition at line 51 of file DataUtils.cpp.
References relativeDataDifference().
Referenced by HistoUtils::agreesWithReference().
void DataUtils::coordinateFromBinf | ( | double & | x, |
double & | y, | ||
const OutputData< double > & | data | ||
) |
Transforms x,y coordinate from bin-fraction-coordinates to OutputData's axes coordinates.
Definition at line 202 of file DataUtils.cpp.
References OutputData< T >::axis(), and coordinateFromBinf().
double DataUtils::coordinateFromBinf | ( | double | value, |
const IAxis & | axis | ||
) |
Transforms bin-fraction-coordinate into axis coordinate.
Definition at line 177 of file DataUtils.cpp.
References IAxis::bin(), Bin1D::binSize(), Bin1D::m_lower, Bin1D::m_upper, and IAxis::size().
Referenced by MaskUnitsConverter::convert(), MaskUnitsConverter::convertMask(), and coordinateFromBinf().
void DataUtils::coordinateToBinf | ( | double & | x, |
double & | y, | ||
const OutputData< double > & | data | ||
) |
Transforms x,y coordinate from OutputData axes coordinates to bin-fraction-coordinates.
Definition at line 196 of file DataUtils.cpp.
References OutputData< T >::axis(), and coordinateToBinf().
double DataUtils::coordinateToBinf | ( | double | coordinate, |
const IAxis & | axis | ||
) |
Transforms coordinate on axis into the bin-fraction-coordinate.
Definition at line 169 of file DataUtils.cpp.
References IAxis::bin(), Bin1D::binSize(), IAxis::findClosestIndex(), and Bin1D::m_lower.
Referenced by MaskUnitsConverter::convert(), MaskUnitsConverter::convertMask(), and coordinateToBinf().
std::vector< std::vector< double > > DataUtils::create2DArrayfromOutputData | ( | const OutputData< double > & | data | ) |
Creates a vector of vectors of double (2D Array) from OutputData.
Definition at line 209 of file DataUtils.cpp.
References OutputData< T >::axis(), OutputData< T >::rank(), and IAxis::size().
Referenced by createFFT().
std::unique_ptr< OutputData< double > > DataUtils::createClippedDataSet | ( | const OutputData< double > & | origin, |
double | x1, | ||
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Returns new IntensityData objects which axes clipped to represent the specified rectangle.
Definition at line 128 of file DataUtils.cpp.
References OutputData< T >::axis(), OutputData< T >::begin(), IAxis::createClippedAxis(), OutputData< T >::end(), OutputData< T >::getAxisValue(), and OutputData< T >::rank().
std::unique_ptr< OutputData< double > > DataUtils::createFFT | ( | const OutputData< double > & | data | ) |
Creates Fourier Transform (OutputData format) of intensity map (OutputData format).
Definition at line 256 of file DataUtils.cpp.
References create2DArrayfromOutputData(), and createOutputDatafrom2DArray().
Referenced by IntensityDataFFTPresenter::fftItem().
std::unique_ptr< OutputData< double > > DataUtils::createOutputDatafrom2DArray | ( | const std::vector< std::vector< double >> & | array_2d | ) |
Creates OutputData from a 2D Array.
Definition at line 235 of file DataUtils.cpp.
Referenced by createFFT().
std::unique_ptr< OutputData< double > > DataUtils::createRearrangedDataSet | ( | const OutputData< double > & | data, |
int | n | ||
) |
Returns new object with input data rotated by n*90 deg counterclockwise (n > 0) or clockwise (n < 0) Axes are swapped if the data is effectively rotated by 90 or 270 degrees Applicable to 2D arrays only.
Definition at line 82 of file DataUtils.cpp.
References OutputData< T >::axis(), OutputData< T >::clone(), OutputData< T >::getAllocatedSize(), OutputData< T >::getAxesBinIndices(), OutputData< T >::rank(), and IAxis::size().
Referenced by RealDataItem::rotateData().
std::unique_ptr< OutputData< double > > DataUtils::createRelativeDifferenceData | ( | const OutputData< double > & | data, |
const OutputData< double > & | reference | ||
) |
Definition at line 69 of file DataUtils.cpp.
References OutputData< T >::clone(), Numeric::GetRelativeDifference(), and OutputData< T >::hasSameDimensions().
Referenced by DiffItemController::updateDiffData().
OutputData< double > * DataUtils::importArrayToOutputData | ( | const std::vector< double > & | vec | ) |
Reads 1D array of doubles to Python, for use in persistence test.
Definition at line 263 of file DataUtils.cpp.
References ArrayUtils::createData().
OutputData< double > * DataUtils::importArrayToOutputData | ( | const std::vector< std::vector< double >> & | vec | ) |
Reads 2D array of doubles to Python, for use in persistence test.
Definition at line 268 of file DataUtils.cpp.
References ArrayUtils::createData().
double DataUtils::relativeDataDifference | ( | const OutputData< double > & | dat, |
const OutputData< double > & | ref | ||
) |
Returns relative difference between two data sets sum(dat[i] - ref[i])/ref[i]).
Definition at line 35 of file DataUtils.cpp.
References OutputData< T >::getAllocatedSize(), Numeric::GetRelativeDifference(), and OutputData< T >::hasSameDimensions().
Referenced by checkRelativeDifference(), and HistoUtils::getRelativeDifference().