Skip to content

Compute Gaia TGE n_pix with nside2npix - #73

Open
shaneraphel wants to merge 1 commit into
gregreen:masterfrom
shaneraphel:gaia-tge-nside2npix-70
Open

shaneraphel wants to merge 1 commit into
gregreen:masterfrom
shaneraphel:gaia-tge-nside2npix-70

Conversation

@shaneraphel

@shaneraphel shaneraphel commented Sep 18, 2026

Copy link
Copy Markdown

Description

GaiaTGEQuery stores healpix_level as i1. On the optimum path it sets

n_pix = 12 * 4**hpx_level_max

NumPy keeps that power in int8, so 4**8 (and every realistic TGE level ≥ 4) overflows to 0. The index array is then empty and a nest index such as 19200 raises IndexError.

The HEALPix identity is n_pix = nside2npix(2**level) = 12 * 4**level. Rewriting that with a Python int level keeps the map size finite. The on-disk dtype and the nest fill loop are unchanged.

Measured current n_pix for int8 levels 6, 7, 8, 9 is 0; this change is 49152, 196608, 786432, 3145728.

Related issues

Closes #70

healpix_level is stored as int8. 4**level then overflows for
every realistic TGE resolution, so the optimum map is empty and
a nest index raises IndexError. Use the HEALPix identity
nside2npix(2**int(level)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IndexError from loading GaiaTGEQuery

1 participant