Add spherical peak counting functions for HEALPix maps #38
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_wtpeaks
function 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_sphere
andget_wtpeaks
Applications
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.