esheldon / esutil

A variety of python utilities focusing on numerical, scientific, and astrophysical computing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Method to get total number of HTM pixels

parejkoj opened this issue · comments

A useful addition would be a method to get the total number of HTM pixels for a given depth. I think it would look like this:

def get_n_pixels(self):
    """Return the total number of pixels for this HTM's depth."""
    return 4**self.get_depth()

but I had to work that out from the existing code. This is useful for knowing how many files you might generate with a given indexing scheme.

according to Szalay et al. https://arxiv.org/abs/cs/0701164 the number of nodes is

8 * 4**(depth-1)