20 bool metOfficeOpsCompatibilityMode)
21 : metOfficeOpsCompatibilityMode_(metOfficeOpsCompatibilityMode),
22 latitudeBinSelector_(latitudeLowerBound_, latitudeUpperBound_, numLatitudeBins) {
24 for (
IndexType latBin = 0; latBin < numLatitudeBins; ++latBin) {
27 const int equatorToMeridianLengthRatio = 2;
28 const float tentativeNumLongitudeBins =
29 equatorToMeridianLengthRatio * numLatitudeBins *
33 if (metOfficeOpsCompatibilityMode)
46 bool metOfficeOpsCompatibilityMode)
47 : metOfficeOpsCompatibilityMode_(metOfficeOpsCompatibilityMode),
48 latitudeBinSelector_(latitudeLowerBound_, latitudeUpperBound_, numLatitudeBins),
49 longitudeBinSelectors_(numLatitudeBins,
50 metOfficeOpsCompatibilityMode ?
52 opsCompatibilityModeLongitudeLowerBound_,
53 opsCompatibilityModeLongitudeUpperBound_,
54 opsCompatibilityModeRelativeLongitudeRange_ * numLongitudeBins) :
64 n += *selector.numBins();
74 idealNumBins : std::round(idealNumBins));
75 return std::max(1, numBins);
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.
bool metOfficeOpsCompatibilityMode_
static constexpr int opsCompatibilityModeRelativeLongitudeRange_
std::vector< TruncatingEquispacedBinSelector > longitudeBinSelectors_
static constexpr ValueType longitudeLowerBound_
static constexpr ValueType opsCompatibilityModeLongitudeUpperBound_
SpatialBinSelector(IndexType numLatitudeBins, SpatialBinCountRoundingMode roundingMode, bool metOfficeOpsCompatibilityMode=false)
Partition a sphere into bins whose centers lie on a reduced Gaussian grid.
static constexpr ValueType opsCompatibilityModeLongitudeLowerBound_
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 ...
SpatialBinCountRoundingMode
static constexpr double deg2rad