Mantid
Loading...
Searching...
No Matches
SparseInstrument.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2017 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include "MantidAlgorithms/DllConfig.h"
11
12#include <array>
13#include <boost/optional/optional.hpp>
14#include <tuple>
15#include <utility>
16
17namespace Mantid {
18namespace Algorithms {
19class DetectorGridDefinition;
20}
21namespace Geometry {
22class ReferenceFrame;
23}
24namespace HistogramData {
25class Histogram;
26}
27namespace Kernel {
28class V3D;
29}
30namespace Algorithms {
31namespace SparseInstrument {
36MANTID_ALGORITHMS_DLL std::tuple<double, double, double, double> extremeAngles(const API::MatrixWorkspace &ws);
37MANTID_ALGORITHMS_DLL std::pair<double, double> geographicalAngles(const Kernel::V3D &p,
38 const Geometry::ReferenceFrame &refFrame);
39MANTID_ALGORITHMS_DLL std::tuple<double, double> extremeWavelengths(const API::MatrixWorkspace &ws);
40MANTID_ALGORITHMS_DLL HistogramData::Histogram modelHistogram(const API::MatrixWorkspace &modelWS,
41 const size_t wavelengthPoints);
44 const size_t wavelengthPoints);
45MANTID_ALGORITHMS_DLL double greatCircleDistance(const double lat1, const double long1, const double lat2,
46 const double long2);
47MANTID_ALGORITHMS_DLL std::array<double, 4> inverseDistanceWeights(const std::array<double, 4> &distances);
48MANTID_ALGORITHMS_DLL HistogramData::Histogram interpolateFromDetectorGrid(const double lat, const double lon,
49 const API::MatrixWorkspace &ws,
50 const std::array<size_t, 4> &indices);
51MANTID_ALGORITHMS_DLL HistogramData::Histogram
52bilinearInterpolateFromDetectorGrid(const double lat, const double lon, const API::MatrixWorkspace &ws,
53 const std::vector<std::vector<boost::optional<size_t>>> &indices);
54MANTID_ALGORITHMS_DLL std::unique_ptr<const Algorithms::DetectorGridDefinition>
55createDetectorGridDefinition(const API::MatrixWorkspace &modelWS, const size_t rows, const size_t columns);
56} // namespace SparseInstrument
57} // namespace Algorithms
58} // namespace Mantid
Base MatrixWorkspace Abstract Class.
DetectorGridDefinition is a helper class for building the sparse instrument in MonteCarloAbsorption.
ReferenceFrame : Holds reference frame information from the geometry description file.
Class for 3D vectors.
Definition: V3D.h:34
std::unique_ptr< MatrixWorkspace > MatrixWorkspace_uptr
unique pointer to Mantid::API::MatrixWorkspace
MANTID_ALGORITHMS_DLL std::array< double, 4 > inverseDistanceWeights(const std::array< double, 4 > &distances)
MANTID_ALGORITHMS_DLL std::pair< double, double > geographicalAngles(const Kernel::V3D &p, const Geometry::ReferenceFrame &refFrame)
MANTID_ALGORITHMS_DLL std::tuple< double, double > extremeWavelengths(const API::MatrixWorkspace &ws)
MANTID_ALGORITHMS_DLL API::MatrixWorkspace_uptr createSparseWS(const API::MatrixWorkspace &modelWS, const Algorithms::DetectorGridDefinition &grid, const size_t wavelengthPoints)
MANTID_ALGORITHMS_DLL HistogramData::Histogram interpolateFromDetectorGrid(const double lat, const double lon, const API::MatrixWorkspace &ws, const std::array< size_t, 4 > &indices)
MANTID_ALGORITHMS_DLL std::tuple< double, double, double, double > extremeAngles(const API::MatrixWorkspace &ws)
Defines functions and utilities to create and deal with sparse instruments.
MANTID_ALGORITHMS_DLL HistogramData::Histogram bilinearInterpolateFromDetectorGrid(const double lat, const double lon, const API::MatrixWorkspace &ws, const std::vector< std::vector< boost::optional< size_t > > > &indices)
MANTID_ALGORITHMS_DLL double greatCircleDistance(const double lat1, const double long1, const double lat2, const double long2)
MANTID_ALGORITHMS_DLL std::unique_ptr< const Algorithms::DetectorGridDefinition > createDetectorGridDefinition(const API::MatrixWorkspace &modelWS, const size_t rows, const size_t columns)
MANTID_ALGORITHMS_DLL HistogramData::Histogram modelHistogram(const API::MatrixWorkspace &modelWS, const size_t wavelengthPoints)
Helper class which provides the Collimation Length for SANS instruments.