Skip to content

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

❌ Patch coverage is 24.30939% with 137 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.24%. Comparing base (dc4b0e2) to head (8097dba).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
reproject/hips/dask_array.py 20.80% 118 Missing ⚠️
reproject/hips/utils.py 40.62% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #514      +/-   ##
==========================================
- Coverage   88.30%   81.24%   -7.07%     
==========================================
  Files          28       29       +1     
  Lines        1411     1578     +167     
==========================================
+ Hits         1246     1282      +36     
- Misses        165      296     +131     

☔ 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