Add spherical peak counting functions for HEALPix maps#38
Draft
Add spherical peak counting functions for HEALPix maps#38
Conversation
…_wtpeaks_sphere) Co-authored-by: AndreasTersenov <108676313+AndreasTersenov@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] I would like to create a new fuction for calculating multi-scale peak counts (like get_wtpeaks), but on spherical healpix maps. The idea is to make it similar to get_wtl1_sphere, i.e. use CMRStarlet() for the wavelet transform of the spherical maps, an...
Add spherical peak counting functions for HEALPix maps
Sep 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements new functionality for calculating multi-scale peak counts on spherical HEALPix maps, providing a spherical analog to the existing
get_wtpeaksfunction for 2D images.New Functions Added
get_peaks_sphere(healpix_map, threshold=None, ordered=True, mask=None, nside=None)Core function for finding local maxima in HEALPix maps using proper spherical geometry:
healpy.get_all_neighbours()to find pixel neighbors on the sphereget_wtpeaks_sphere(Map, nscales, nbins=None, Mask=None, min_snr=None, max_snr=None, noise_std=None, peak_threshold=None)Main multi-scale peak counting function that:
CMRStarlet()for spherical wavelet transform (same asget_wtl1_sphere)Usage Example
Design Features
get_wtl1_sphereandget_wtpeaksApplications
This functionality enables cosmologists to perform peak-based statistical analysis on spherical maps such as:
The new functions complement the existing
get_wtl1_sphere()function by providing peak-based statistics rather than L1-norm based analysis, offering a different perspective on multi-scale structure in spherical data.Testing
The implementation has been thoroughly tested with:
All functions integrate seamlessly with the existing CMRStarlet spherical wavelet transform infrastructure.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.