UFO
|
Represents a partition of a sphere into a number of subsets (bins). More...
#include <SpatialBinSelector.h>
Public Types | |
typedef float | ValueType |
typedef int | IndexType |
Public Member Functions | |
SpatialBinSelector (IndexType numLatitudeBins, SpatialBinCountRoundingMode roundingMode, bool metOfficeOpsCompatibilityMode=false) | |
Partition a sphere into bins whose centers lie on a reduced Gaussian grid. More... | |
SpatialBinSelector (IndexType numLatitudeBins, IndexType numLongitudeBins, bool metOfficeOpsCompatibilityMode=false) | |
Partition a sphere into bins whose centers lie on a regular Gaussian grid. More... | |
IndexType | latitudeBin (ValueType latitude) const |
Return the index of the zonal band of bins containing points with a given latitude (in degrees, assumed to lie in the interval [-90, 90]). More... | |
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 longitude (in degrees). More... | |
ValueType | latitudeBinCenter (IndexType latitudeBin) const |
Return the latitude at the center of the zonal band of bins with index latitudeBin . More... | |
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 with index latitudeBin . More... | |
IndexType | totalNumBins () const |
Return the number of bins into which the sphere is split. More... | |
ValueType | latitudeBinWidth () const |
Return the width of each zonal band of bins. More... | |
ValueType | longitudeBinWidth (IndexType latitudeBin) const |
Return the zonal width of each bin in the band of bins with index latitudeBin . More... | |
ValueType | inverseLatitudeBinWidth () const |
Return the inverse of the width of each zonal band of bins. More... | |
ValueType | inverseLongitudeBinWidth (IndexType latitudeBin) const |
Return the inverse of the zonal width of each bin in the band of bins with index latitudeBin . More... | |
Static Public Member Functions | |
static IndexType | roundNumBins (float idealNumBins, SpatialBinCountRoundingMode roundingMode) |
Return idealNumBins rounded to a positive integer according to the rounding strategy roundingMode . More... | |
Private Attributes | |
bool | metOfficeOpsCompatibilityMode_ |
TruncatingEquispacedBinSelector | latitudeBinSelector_ |
std::vector< TruncatingEquispacedBinSelector > | longitudeBinSelectors_ |
Static Private Attributes | |
static constexpr ValueType | latitudeLowerBound_ = -90 |
static constexpr ValueType | latitudeUpperBound_ = 90 |
static constexpr ValueType | longitudeLowerBound_ = 0 |
static constexpr ValueType | longitudeUpperBound_ = 360 |
static constexpr ValueType | opsCompatibilityModeLongitudeLowerBound_ = -360 |
static constexpr ValueType | opsCompatibilityModeLongitudeUpperBound_ = 720 |
static constexpr int | opsCompatibilityModeRelativeLongitudeRange_ = 3 |
Represents a partition of a sphere into a number of subsets (bins).
Definition at line 25 of file SpatialBinSelector.h.
typedef int ufo::SpatialBinSelector::IndexType |
Definition at line 29 of file SpatialBinSelector.h.
typedef float ufo::SpatialBinSelector::ValueType |
Definition at line 28 of file SpatialBinSelector.h.
ufo::SpatialBinSelector::SpatialBinSelector | ( | IndexType | numLatitudeBins, |
SpatialBinCountRoundingMode | roundingMode, | ||
bool | metOfficeOpsCompatibilityMode = false |
||
) |
Partition a sphere into bins whose centers lie on a reduced Gaussian grid.
numLatitudeBins | The number of zonal bands of bins into which the sphere is split. |
roundingMode |
|
metOfficeOpsCompatibilityMode | If true, the compatibility mode with the Met Office OPS system will be activated. This will stop longitudeBin() from clamping longitudes to the interval [0, 360] deg. |
Activation of this mode in new code is discouraged; even if input longitudes are e.g. in the range [-180, 180] deg, it is normally better to wrap them to the [0, 360] deg range before passing them to longitudeBin(). Otherwise there's a risk that points lying exactly at -180 or 180 deg will be put into a bin of their own.
Definition at line 18 of file SpatialBinSelector.cc.
ufo::SpatialBinSelector::SpatialBinSelector | ( | IndexType | numLatitudeBins, |
IndexType | numLongitudeBins, | ||
bool | metOfficeOpsCompatibilityMode = false |
||
) |
Partition a sphere into bins whose centers lie on a regular Gaussian grid.
numLatitudeBins | The number of zonal bands of bins into which the sphere is split. |
numLongitudeBins | The number of meridional bands of bins into which the sphere is split. |
Definition at line 45 of file SpatialBinSelector.cc.
|
inline |
Return the inverse of the width of each zonal band of bins.
Definition at line 110 of file SpatialBinSelector.h.
Return the inverse of the zonal width of each bin in the band of bins with index latitudeBin
.
Definition at line 116 of file SpatialBinSelector.h.
Return the index of the zonal band of bins containing points with a given latitude (in degrees, assumed to lie in the interval [-90, 90]).
Definition at line 72 of file SpatialBinSelector.h.
Return the latitude at the center of the zonal band of bins with index latitudeBin
.
Definition at line 86 of file SpatialBinSelector.h.
|
inline |
Return the width of each zonal band of bins.
Definition at line 100 of file SpatialBinSelector.h.
|
inline |
Return the index of the bin within the zonal band of index latitudeBin
containing points with a given longitude (in degrees).
The longitude is assumed to lie in the interval [0, 360] unless the compatibility mode with the Met Office OPS system is in effect.
Definition at line 81 of file SpatialBinSelector.h.
|
inline |
Return the longitude at the center of the bin with index latitudeBin
lying in the zonal band of bins with index latitudeBin
.
Definition at line 92 of file SpatialBinSelector.h.
Return the zonal width of each bin in the band of bins with index latitudeBin
.
Definition at line 105 of file SpatialBinSelector.h.
|
static |
Return idealNumBins
rounded to a positive integer according to the rounding strategy roundingMode
.
Definition at line 70 of file SpatialBinSelector.cc.
SpatialBinSelector::IndexType ufo::SpatialBinSelector::totalNumBins | ( | ) | const |
Return the number of bins into which the sphere is split.
Definition at line 61 of file SpatialBinSelector.cc.
|
private |
Definition at line 126 of file SpatialBinSelector.h.
|
staticconstexprprivate |
Definition at line 32 of file SpatialBinSelector.h.
|
staticconstexprprivate |
Definition at line 33 of file SpatialBinSelector.h.
|
private |
Definition at line 127 of file SpatialBinSelector.h.
|
staticconstexprprivate |
Definition at line 34 of file SpatialBinSelector.h.
|
staticconstexprprivate |
Definition at line 35 of file SpatialBinSelector.h.
|
private |
Definition at line 125 of file SpatialBinSelector.h.
|
staticconstexprprivate |
Definition at line 36 of file SpatialBinSelector.h.
|
staticconstexprprivate |
Definition at line 37 of file SpatialBinSelector.h.
|
staticconstexprprivate |
Definition at line 38 of file SpatialBinSelector.h.