Skip to content
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

Add custom healpix plotting method #374

Merged
merged 24 commits into from
Oct 25, 2024
Merged

Add custom healpix plotting method #374

merged 24 commits into from
Oct 25, 2024

Conversation

smcguire-cmu
Copy link
Contributor

@smcguire-cmu smcguire-cmu commented Oct 11, 2024

Replaces healpy's plotting methods with a new healpix map plotting method based on mocpy's plotting functions.

Fixes #242

Copy link

github-actions bot commented Oct 11, 2024

Before [1628457] After [fa11278] Ratio Benchmark (Parameter)
381±3ms 384±2ms 1.01 benchmarks.Suite.time_outer_pixel_alignment
111±2ms 111±2ms 1.01 benchmarks.Suite.time_paths_creation
125±0.8ms 126±1ms 1.01 benchmarks.time_test_alignment_even_sky
21.6±0.07ms 21.6±0.2ms 1 benchmarks.MetadataSuite.time_load_partition_info_order6
91.9±1ms 91.8±0.4ms 1 benchmarks.MetadataSuite.time_load_partition_info_order7
92.1±0.9ms 92.0±0.6ms 1 benchmarks.MetadataSuite.time_load_partition_join_info
13.4±0.2ms 13.4±0.4ms 1 benchmarks.Suite.time_inner_pixel_alignment
982±3μs 977±1μs 1 benchmarks.time_test_cone_filter_multiple_order
50.1±0.7ms 49.4±0.9ms 0.99 benchmarks.Suite.time_pixel_tree_creation

Click here to view all benchmarks.

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 96.57143% with 6 lines in your changes missing coverage. Please review.

Project coverage is 92.87%. Comparing base (1628457) to head (23436e0).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
src/hats/inspection/visualize_catalog.py 97.04% 5 Missing ⚠️
...rc/hats/catalog/healpix_dataset/healpix_dataset.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #374      +/-   ##
==========================================
- Coverage   93.00%   92.87%   -0.13%     
==========================================
  Files          49       49              
  Lines        2001     2134     +133     
==========================================
+ Hits         1861     1982     +121     
- Misses        140      152      +12     

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

@smcguire-cmu smcguire-cmu changed the base branch from main to development October 11, 2024 19:19
@smcguire-cmu smcguire-cmu requested a review from hombit October 11, 2024 19:31
Copy link
Contributor

@hombit hombit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Sean!

@hombit
Copy link
Contributor

hombit commented Oct 16, 2024

@smcguire-cmu I played more! It gave me empty plot when I tried to do it for ALLWISE:

import hipscat

catalog = hipscat.loaders.read_from_hipscat('https://data.lsdb.io/unstable/wise/allwise')
hipscat.inspection.plot_points(catalog)
image

It also uses a lot of RAM, but it is probably expected?

Zoomed version works fine

import hipscat
from astropy.coordinates import Angle, SkyCoord

catalog = hipscat.loaders.read_from_hipscat('https://data.lsdb.io/unstable/wise/allwise')
hipscat.inspection.plot_points(catalog, center=SkyCoord(0, 0, unit='deg'), fov=(Angle(5, 'deg'), Angle(10, 'deg')))
image

@hombit
Copy link
Contributor

hombit commented Oct 16, 2024

@smcguire-cmu One more thing. It would be nice to make a "view window" to be a rectangle when fov is passed

Base automatically changed from development to main October 22, 2024 14:13
@smcguire-cmu smcguire-cmu force-pushed the sean/healpix-plotting branch from 2ef097f to 0d30308 Compare October 23, 2024 20:25
@smcguire-cmu
Copy link
Contributor Author

@smcguire-cmu I played more! It gave me empty plot when I tried to do it for ALLWISE:

import hipscat

catalog = hipscat.loaders.read_from_hipscat('https://data.lsdb.io/unstable/wise/allwise')
hipscat.inspection.plot_points(catalog)
image It also uses a lot of RAM, but it is probably expected?

Zoomed version works fine

import hipscat
from astropy.coordinates import Angle, SkyCoord

catalog = hipscat.loaders.read_from_hipscat('https://data.lsdb.io/unstable/wise/allwise')
hipscat.inspection.plot_points(catalog, center=SkyCoord(0, 0, unit='deg'), fov=(Angle(5, 'deg'), Angle(10, 'deg')))
image

This was an interesting issue! Allwise has order 10 pixels in the point map, which are much smaller than a single pixel in the plot, so the part of the code that culls the backfacing cells detected them as invalid pixels and removed them all. I added some more functionality that merges any healpix pixels smaller than a single plot pixel. There's lots of ways that you can deal with aggregating multiple map pixels, but that's complicated. I figured a rendering engine with multiple objects in the same pixel would just pick one, so for now the behavior is to sample from the map and throw a warning.

Copy link
Contributor

@hombit hombit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super-mega great, thank you!

@smcguire-cmu smcguire-cmu merged commit 4ef9952 into main Oct 25, 2024
10 checks passed
@smcguire-cmu smcguire-cmu deleted the sean/healpix-plotting branch October 25, 2024 15:55
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.

HEALPix pixel plotting improvements
2 participants