UFO
ufo::SpatialBinSelector Class Reference

Represents a partition of a sphere into a number of subsets (bins). More...

#include <SpatialBinSelector.h>

Collaboration diagram for ufo::SpatialBinSelector:

Public Types

typedef float ValueType
 
typedef int IndexType
 

Public Member Functions

 SpatialBinSelector (IndexType numLatitudeBins, SpatialBinCountRoundingMode roundingMode)
 Partition a sphere into bins whose centers lie on a reduced Gaussian grid. More...
 
 SpatialBinSelector (IndexType numLatitudeBins, IndexType numLongitudeBins)
 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 latitude (in degrees, assumed to lie in the interval [0, 360)). 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

EquispacedBinSelector latitudeBinSelector_
 
std::vector< EquispacedBinSelectorlongitudeBinSelectors_
 

Static Private Attributes

static constexpr ValueType latitudeLowerBound_ = -90
 
static constexpr ValueType latitudeUpperBound_ = 90
 
static constexpr ValueType longitudeLowerBound_ = 0
 
static constexpr ValueType longitudeUpperBound_ = 360
 

Detailed Description

Represents a partition of a sphere into a number of subsets (bins).

Definition at line 25 of file SpatialBinSelector.h.

Member Typedef Documentation

◆ IndexType

Definition at line 29 of file SpatialBinSelector.h.

◆ ValueType

Definition at line 28 of file SpatialBinSelector.h.

Constructor & Destructor Documentation

◆ SpatialBinSelector() [1/2]

ufo::SpatialBinSelector::SpatialBinSelector ( IndexType  numLatitudeBins,
SpatialBinCountRoundingMode  roundingMode 
)

Partition a sphere into bins whose centers lie on a reduced Gaussian grid.

Parameters
numLatitudeBinsThe number of zonal bands of bins into which the sphere is split.
roundingMode
  • If set to NEAREST, the number of bins in each zonal band is chosen so that the bin width in the zonal direction is as close as possible to that in the meridional direction.
  • If set to DOWN, the number of bins is chosen so that the bin width in the zonal direction is as small as possible, but no smaller than in the meridional direction.

Definition at line 18 of file SpatialBinSelector.cc.

Here is the call graph for this function:

◆ SpatialBinSelector() [2/2]

ufo::SpatialBinSelector::SpatialBinSelector ( IndexType  numLatitudeBins,
IndexType  numLongitudeBins 
)

Partition a sphere into bins whose centers lie on a regular Gaussian grid.

Parameters
numLatitudeBinsThe number of zonal bands of bins into which the sphere is split.
numLongitudeBinsThe number of meridional bands of bins into which the sphere is split.

Definition at line 37 of file SpatialBinSelector.cc.

Member Function Documentation

◆ inverseLatitudeBinWidth()

ValueType ufo::SpatialBinSelector::inverseLatitudeBinWidth ( ) const
inline

Return the inverse of the width of each zonal band of bins.

Definition at line 94 of file SpatialBinSelector.h.

Here is the call graph for this function:

◆ inverseLongitudeBinWidth()

ValueType ufo::SpatialBinSelector::inverseLongitudeBinWidth ( IndexType  latitudeBin) const
inline

Return the inverse of the zonal width of each bin in the band of bins with index latitudeBin.

Definition at line 100 of file SpatialBinSelector.h.

Here is the call graph for this function:

◆ latitudeBin()

IndexType ufo::SpatialBinSelector::latitudeBin ( ValueType  latitude) const
inline

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 59 of file SpatialBinSelector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ latitudeBinCenter()

ValueType ufo::SpatialBinSelector::latitudeBinCenter ( IndexType  latitudeBin) const
inline

Return the latitude at the center of the zonal band of bins with index latitudeBin.

Definition at line 70 of file SpatialBinSelector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ latitudeBinWidth()

ValueType ufo::SpatialBinSelector::latitudeBinWidth ( ) const
inline

Return the width of each zonal band of bins.

Definition at line 84 of file SpatialBinSelector.h.

Here is the call graph for this function:

◆ longitudeBin()

IndexType ufo::SpatialBinSelector::longitudeBin ( IndexType  latitudeBin,
ValueType  longitude 
) const
inline

Return the index of the bin within the zonal band of index latitudeBin containing points with a given latitude (in degrees, assumed to lie in the interval [0, 360)).

Definition at line 65 of file SpatialBinSelector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ longitudeBinCenter()

ValueType ufo::SpatialBinSelector::longitudeBinCenter ( IndexType  latitudeBin,
IndexType  longitudeBin 
) const
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 76 of file SpatialBinSelector.h.

Here is the call graph for this function:

◆ longitudeBinWidth()

ValueType ufo::SpatialBinSelector::longitudeBinWidth ( IndexType  latitudeBin) const
inline

Return the zonal width of each bin in the band of bins with index latitudeBin.

Definition at line 89 of file SpatialBinSelector.h.

Here is the call graph for this function:

◆ roundNumBins()

SpatialBinSelector::IndexType ufo::SpatialBinSelector::roundNumBins ( float  idealNumBins,
SpatialBinCountRoundingMode  roundingMode 
)
static

Return idealNumBins rounded to a positive integer according to the rounding strategy roundingMode.

Definition at line 51 of file SpatialBinSelector.cc.

Here is the caller graph for this function:

◆ totalNumBins()

SpatialBinSelector::IndexType ufo::SpatialBinSelector::totalNumBins ( ) const

Return the number of bins into which the sphere is split.

Definition at line 44 of file SpatialBinSelector.cc.

Member Data Documentation

◆ latitudeBinSelector_

EquispacedBinSelector ufo::SpatialBinSelector::latitudeBinSelector_
private

Definition at line 109 of file SpatialBinSelector.h.

◆ latitudeLowerBound_

constexpr ValueType ufo::SpatialBinSelector::latitudeLowerBound_ = -90
staticconstexprprivate

Definition at line 32 of file SpatialBinSelector.h.

◆ latitudeUpperBound_

constexpr ValueType ufo::SpatialBinSelector::latitudeUpperBound_ = 90
staticconstexprprivate

Definition at line 33 of file SpatialBinSelector.h.

◆ longitudeBinSelectors_

std::vector<EquispacedBinSelector> ufo::SpatialBinSelector::longitudeBinSelectors_
private

Definition at line 110 of file SpatialBinSelector.h.

◆ longitudeLowerBound_

constexpr ValueType ufo::SpatialBinSelector::longitudeLowerBound_ = 0
staticconstexprprivate

Definition at line 34 of file SpatialBinSelector.h.

◆ longitudeUpperBound_

constexpr ValueType ufo::SpatialBinSelector::longitudeUpperBound_ = 360
staticconstexprprivate

Definition at line 35 of file SpatialBinSelector.h.


The documentation for this class was generated from the following files: