lsst.sphgeom gb5d12ffc61+ac198e9f13
Public Member Functions | Static Public Attributes | List of all members
lsst::sphgeom::Q3cPixelization Class Reference

#include <Q3cPixelization.h>

Inheritance diagram for lsst::sphgeom::Q3cPixelization:
lsst::sphgeom::Pixelization

Public Member Functions

 Q3cPixelization (int level)
 
int getLevel () const
 getLevel returns the subdivision level of this pixelization.
 
ConvexPolygon quad (uint64_t i) const
 
std::vector< uint64_t > neighborhood (uint64_t i) const
 
RangeSet universe () const override
 universe returns the set of all pixel indexes for this pixelization. More...
 
std::unique_ptr< Regionpixel (uint64_t i) const override
 
uint64_t index (UnitVector3d const &v) const override
 index computes the index of the pixel for v. More...
 
std::string toString (uint64_t i) const override
 
- Public Member Functions inherited from lsst::sphgeom::Pixelization
virtual RangeSet universe () const =0
 universe returns the set of all pixel indexes for this pixelization. More...
 
virtual std::unique_ptr< Regionpixel (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 Attributes

static constexpr int MAX_LEVEL = 30
 The maximum supported cube-face grid resolution is 2^30 by 2^30.
 

Detailed Description

Q3cPixelization provides Q3C indexing of points and regions.

Instances of this class are immutable and very cheap to copy.

Warning
Setting the 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.

Constructor & Destructor Documentation

◆ Q3cPixelization()

lsst::sphgeom::Q3cPixelization::Q3cPixelization ( int  level)
explicit

This constructor creates a Q3C pixelization of the sphere with the given subdivision level. If level ∉ [0, MAX_LEVEL], a std::invalid_argument is thrown.

Member Function Documentation

◆ index()

uint64_t lsst::sphgeom::Q3cPixelization::index ( UnitVector3d const &  v) const
overridevirtual

index computes the index of the pixel for v.

Implements lsst::sphgeom::Pixelization.

◆ neighborhood()

std::vector< uint64_t > lsst::sphgeom::Q3cPixelization::neighborhood ( uint64_t  i) const

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 Q3C index, a std::invalid_argument is thrown.

◆ pixel()

std::unique_ptr< Region > lsst::sphgeom::Q3cPixelization::pixel ( uint64_t  i) const
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.

◆ quad()

ConvexPolygon lsst::sphgeom::Q3cPixelization::quad ( uint64_t  i) const

quad returns the quadrilateral corresponding to the Q3C pixel with index i.

If i is not a valid Q3C index, a std::invalid_argument is thrown.

◆ toString()

std::string lsst::sphgeom::Q3cPixelization::toString ( uint64_t  i) const
overridevirtual

toString converts the given 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 Q3C index, a std::invalid_argument is thrown.

Implements lsst::sphgeom::Pixelization.

◆ universe()

RangeSet lsst::sphgeom::Q3cPixelization::universe ( ) const
inlineoverridevirtual

universe returns the set of all pixel indexes for this pixelization.

Implements lsst::sphgeom::Pixelization.


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