24 const size_t latitudePoints,
const double minLongitude,
25 const double maxLongitude,
const size_t longitudePoints)
26 : m_minLatitude(minLatitude), m_maxLatitude(maxLatitude), m_latitudePoints(latitudePoints),
27 m_minLongitude(minLongitude), m_maxLongitude(maxLongitude), m_longitudePoints(longitudePoints) {
29 if (latitudePoints < 2 || longitudePoints < 2 || minLatitude > maxLatitude || minLongitude > maxLongitude) {
30 throw std::runtime_error(
"Invalid detector grid definition.");
34 const double tiny = 1e-5;
35 const double smallShift = M_PI / 300.0;
70 const double longitude)
const {
80 std::array<size_t, 4> is;
82 std::get<1>(is) = std::get<0>(is) + 1;
84 std::get<3>(is) = std::get<2>(is) + 1;
95 throw std::runtime_error(
"DetectorGridDefinition::getDetectorIndex: "
96 "detector requested for out of bounds row or col");
108 const double longitude)
const {
118 return std::pair<size_t, size_t>{topLeftRow, topLeftCol};
std::pair< size_t, size_t > getNearestVertex(const double latitude, const double longitude) const
Return the indices to the detector that is immediate neighbour of the supplied lat/long and has lat/l...
DetectorGridDefinition(const double minLatitude, const double maxLatitude, const size_t latitudePoints, const double minLongitude, const double maxLongitude, const size_t longitudeStep)
Initializes a DetectorGridDefinition object.
std::array< size_t, 4 > nearestNeighbourIndices(const double latitude, const double longitude) const
Return the indices to detector surrounding the given point.
double latitudeAt(const size_t row) const
Return the latitude of the given row.
size_t numberRows() const
Return the number of rows in the grid.
size_t getDetectorIndex(size_t row, size_t col)
Return the indices of the detector described by a row and col.
double longitudeAt(const size_t column) const
Return the longitude of the given column.
size_t numberColumns() const
Return the number of columns in the grid.