lsst.sphgeom
22.0.0+01bcf6a671
|
#include <Mq3cPixelization.h>
Public Member Functions | |
Mq3cPixelization (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. | |
std::unique_ptr< Region > | pixel (uint64_t i) const override |
uint64_t | index (UnitVector3d const &v) const override |
index computes the index of the pixel for v. | |
std::string | toString (uint64_t i) const override |
toString converts the given pixel index to a human-readable string. | |
![]() | |
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 | quad (uint64_t i) |
static std::vector< uint64_t > | neighborhood (uint64_t i) |
static std::string | asString (uint64_t i) |
Static Public Attributes | |
static constexpr int | MAX_LEVEL = 30 |
The maximum supported cube-face grid resolution is 2^30 by 2^30. | |
Mq3cPixelization
provides modified Q3C 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 4 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 the indexes for an entire cube face, even as the circle radius tends to 0.
|
explicit |
This constructor creates a modified Q3C pixelization of the sphere with the given subdivision level. If level
∉ [0, MAX_LEVEL], a std::invalid_argument is thrown.
|
static |
toString
converts the given modified-Q3C index to a human readable string.
The first two characters in the return value are always '+X', '+Y', '+Z', '-X', '-Y', or '-Z'. They give the normal vector of the cube face F containing i
. Each subsequent character is a digit in [0-3] corresponding to a child pixel index, so that reading the string from left to right corresponds to descent of the quad-tree overlaid on F.
If i is not a valid modified-Q3C index, a std::invalid_argument is thrown.
|
static |
level
returns the subdivision level of the given modified Q3C index.
If i is not a valid modified Q3C index, -1 is returned.
|
static |
neighborhood
returns the indexes of all pixels that share a vertex with pixel i
(including i
itself). A Q3C pixel has 8 - k adjacent pixels, where k is the number of vertices that are also root pixel vertices (0, 1, or 4).
If i
is not a valid modified Q3C index, a std::invalid_argument is thrown.
|
overridevirtual |
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.
|
static |
quad
returns the quadrilateral corresponding to the modified Q3C pixel with index i
.
If i
is not a valid modified Q3C index, a std::invalid_argument is thrown.