lsst.sphgeom ga1cf026fa3+ac198e9f13
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
lsst::sphgeom::HtmPixelization Class Reference

#include <HtmPixelization.h>

Inheritance diagram for lsst::sphgeom::HtmPixelization:
lsst::sphgeom::Pixelization

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< Regionpixel (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...
 
- 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 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.
 

Detailed Description

HtmPixelization provides HTM 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 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.

Constructor & Destructor Documentation

◆ HtmPixelization()

lsst::sphgeom::HtmPixelization::HtmPixelization ( int  level)
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.

Member Function Documentation

◆ asString()

std::string lsst::sphgeom::HtmPixelization::asString ( uint64_t  i)
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.

◆ index()

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

index computes the index of the pixel for v.

Implements lsst::sphgeom::Pixelization.

◆ level()

int lsst::sphgeom::HtmPixelization::level ( uint64_t  i)
static

level returns the subdivision level of the given HTM index.

If i is not a valid HTM index, -1 is returned.

◆ pixel()

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

◆ toString()

std::string lsst::sphgeom::HtmPixelization::toString ( uint64_t  i) const
inlineoverridevirtual

toString converts the given pixel index to a human-readable string.

Implements lsst::sphgeom::Pixelization.

◆ triangle()

ConvexPolygon lsst::sphgeom::HtmPixelization::triangle ( uint64_t  i)
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.

◆ universe()

RangeSet lsst::sphgeom::HtmPixelization::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: