8 #ifndef UFO_UTILS_SPATIALBINSELECTOR_H_
9 #define UFO_UTILS_SPATIALBINSELECTOR_H_
59 bool metOfficeOpsCompatibilityMode =
false);
68 bool metOfficeOpsCompatibilityMode =
false);
Represents a partition of a sphere into a number of subsets (bins).
static constexpr ValueType longitudeUpperBound_
IndexType totalNumBins() const
Return the number of bins into which the sphere is split.
ValueType latitudeBinCenter(IndexType latitudeBin) const
Return the latitude at the center of the zonal band of bins with index latitudeBin.
TruncatingEquispacedBinSelector latitudeBinSelector_
bool metOfficeOpsCompatibilityMode_
static constexpr int opsCompatibilityModeRelativeLongitudeRange_
ValueType latitudeBinWidth() const
Return the width of each zonal band of bins.
std::vector< TruncatingEquispacedBinSelector > longitudeBinSelectors_
IndexType longitudeBin(IndexType latitudeBin, ValueType longitude) const
Return the index of the bin within the zonal band of index latitudeBin containing points with a given...
static constexpr ValueType longitudeLowerBound_
static constexpr ValueType latitudeLowerBound_
static constexpr ValueType opsCompatibilityModeLongitudeUpperBound_
ValueType longitudeBinCenter(IndexType latitudeBin, IndexType longitudeBin) const
Return the longitude at the center of the bin with index latitudeBin lying in the zonal band of bins ...
static constexpr ValueType latitudeUpperBound_
SpatialBinSelector(IndexType numLatitudeBins, SpatialBinCountRoundingMode roundingMode, bool metOfficeOpsCompatibilityMode=false)
Partition a sphere into bins whose centers lie on a reduced Gaussian grid.
IndexType latitudeBin(ValueType latitude) const
Return the index of the zonal band of bins containing points with a given latitude (in degrees,...
static constexpr ValueType opsCompatibilityModeLongitudeLowerBound_
ValueType longitudeBinWidth(IndexType latitudeBin) const
Return the zonal width of each bin in the band of bins with index latitudeBin.
ValueType inverseLongitudeBinWidth(IndexType latitudeBin) const
Return the inverse of the zonal width of each bin in the band of bins with index latitudeBin.
ValueType inverseLatitudeBinWidth() const
Return the inverse of the width of each zonal band of bins.
static IndexType roundNumBins(float idealNumBins, SpatialBinCountRoundingMode roundingMode)
Return idealNumBins rounded to a positive integer according to the rounding strategy roundingMode.
Represents a finite set of consecutive intervals (bins) of the same width, each closed from the left ...
ValueType binWidth() const override
Return the width of each bin.
ValueType binCenter(IndexType bin) const override
Return the value lying at the center of the bin with index bin.
ValueType inverseBinWidth() const override
Return the inverse of the width of each bin.
IndexType bin(ValueType value) const override
Return the index of the bin containing value, or the nearest bin if value lies outside all bins.
SpatialBinCountRoundingMode