Skip to content

Added HiPS and HiPS3D dask array classes #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

astrofrog
Copy link
Member

This is experimental for now, but these functions allow us to get a single dask array for a HiPS or HiPS3D dataset at a given level. Example:

from astropy.io import fits
from reproject.hips.dask_array import hips_as_dask
import matplotlib.pyplot as plt
array = hips_as_dask("https://alasky.cds.unistra.fr/2MASS/K/", level=0)
plt.imshow(array.compute(), origin='lower', vmin=0, vmax=1)
plt.savefig('2d.png')

2d

and for HiPS3D:

from astropy.io import fits
from reproject.hips.dask_array import hips3d_as_dask
import matplotlib.pyplot as plt
array = hips3d_as_dask("https://alasky.cds.unistra.fr/GALFAHI/GALFAHI-Narrow-DR2-3D", level=0)
plt.imshow(array.compute()[10], origin='lower', vmin=-0.1, vmax=0.1)
plt.savefig('3d.png')

3d

The nice thing about using dask is that all the I/O including remote calls gets multi-threaded, so this is quite fast.

This is something I need for glue and also something I think we can use to then easily reproject from HiPS to regular WCS, so I am putting it in this PR for now, but let's see how things evolve before deciding whether to merge. In any case, this is still quite buggy and very much a draft.

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 24.04372% with 139 lines in your changes missing coverage. Please review.

Project coverage is 81.61%. Comparing base (ce6538c) to head (45efb7a).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
reproject/hips/dask_array.py 20.52% 120 Missing ⚠️
reproject/hips/utils.py 40.62% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
- Coverage   88.86%   81.61%   -7.25%     
==========================================
  Files          28       29       +1     
  Lines        1374     1572     +198     
==========================================
+ Hits         1221     1283      +62     
- Misses        153      289     +136     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant