Skip to content

IndexError from loading GaiaTGEQuery #70

@psmd-iberutaru

Description

@psmd-iberutaru

I have been trying to load the GaiaTGE map, but I am unable to create the query instance class because the index error.

Currently, I have been trying to load the map using the following code in a Jupyter notebook.

import dustmaps
import dustmaps.gaia_tge
from dustmaps.config import config
# Config...
config.reset()
config["data_dir"] = "/home/sparrow/baystar/"
# Downloading the map if needed...
dustmaps.gaia_tge.fetch()
# Load the map.
gaia_map = GaiaTGEQuery()

But, the last line fails with...

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[6], line 1
----> 1 gaia_map = GaiaTGEQuery()

File ~/.local/lib/python3.14/site-packages/dustmaps/gaia_tge.py:117, in GaiaTGEQuery.__init__(self, map_fname, healpix_level)
    115         hpx_idx_base = hpx_idx_nest*mult_factor
    116         for offset in range(mult_factor):
--> 117             idx[hpx_idx_base+offset] = idx_opt[idx_lvl]
    118 else:
    119     raise ValueError(
    120         '`healpix_level` must be either an integer or "optimum"'
    121     )

IndexError: index 19200 is out of bounds for axis 0 with size 0

What would be the best solution to download and utilize the Gaia maps?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions