lsst.sphgeom gd5d1ca8e18+f0a1800e64
|
#include <HtmPixelization.h>
Public Member Functions | |
HtmPixelization (int level) | |
int | getLevel () const |
getLevel returns the subdivision level of this pixelization. | |
RangeSet | universe () const override |
universe returns the set of all pixel indexes for this pixelization. More... | |
std::unique_ptr< Region > | pixel (uint64_t i) const override |
uint64_t | index (UnitVector3d const &) const override |
index computes the index of the pixel for v. More... | |
std::string | toString (uint64_t i) const override |
toString converts the given pixel index to a human-readable string. More... | |
![]() | |
virtual RangeSet | universe () const =0 |
universe returns the set of all pixel indexes for this pixelization. More... | |
virtual std::unique_ptr< Region > | pixel (uint64_t i) const =0 |
virtual uint64_t | index (UnitVector3d const &v) const =0 |
index computes the index of the pixel for v. More... | |
virtual std::string | toString (uint64_t i) const =0 |
toString converts the given pixel index to a human-readable string. More... | |
RangeSet | envelope (Region const &r, size_t maxRanges=0) const |
RangeSet | interior (Region const &r, size_t maxRanges=0) const |
Static Public Member Functions | |
static int | level (uint64_t i) |
static ConvexPolygon | triangle (uint64_t i) |
static std::string | asString (uint64_t i) |
Static Public Attributes | |
static constexpr int | MAX_LEVEL = 24 |
MAX_LEVEL is the maximum supported HTM subdivision level. | |
HtmPixelization
provides HTM indexing of points and regions.
Instances of this class are immutable and very cheap to copy.
maxRanges
argument for envelope() or interior() to a non-zero value below 6 can result in very poor region pixelizations regardless of region size. For instance, if maxRanges
is 1, a non-empty circle centered on an axis will be approximated by a hemisphere or the entire unit sphere, even as its radius tends to 0.
|
explicit |
This constructor creates an HTM pixelization of the sphere with the given subdivision level. If level
∉ [0, MAX_LEVEL], a std::invalid_argument is thrown.
|
static |
asString
converts the given HTM index to a human readable string.
The first character in the return value is always 'N' or 'S', indicating whether the root triangle containing i
is in the northern or southern hemisphere. The second character is the index of the root triangle within that hemisphere (a digit in [0-3]). Each subsequent character is a digit in [0-3] corresponding to a child trixel index, so that reading the string from left to right corresponds to descent of the HTM triangle-tree.
If i is not a valid HTM index, a std::invalid_argument is thrown.
|
overridevirtual |
index
computes the index of the pixel for v.
Implements lsst::sphgeom::Pixelization.
|
static |
level
returns the subdivision level of the given HTM index.
If i is not a valid HTM index, -1 is returned.
|
inlineoverridevirtual |
pixel
returns the spherical region corresponding to the pixel with index i.
This region will contain all unit vectors v with index(v) == i
. But it may also contain points with index not equal to i. To see why, consider a point that lies on the edge of a polygonal pixel - it is inside the polygons for both pixels sharing the edge, but must be assigned to exactly one pixel by the pixelization.
If i is not a valid pixel index, a std::invalid_argument is thrown.
Implements lsst::sphgeom::Pixelization.
|
inlineoverridevirtual |
toString
converts the given pixel index to a human-readable string.
Implements lsst::sphgeom::Pixelization.
|
static |
triangle
returns the triangle corresponding to the given HTM index.
If i is not a valid HTM index, a std::invalid_argument is thrown.
|
inlineoverridevirtual |
universe
returns the set of all pixel indexes for this pixelization.
Implements lsst::sphgeom::Pixelization.