Conversation
- Implement `to_spectrogram` method in `RawVoltageBackend` for generating spectrograms directly from voltage data without intermediate RAW file processing. - Enhance CLI options to include frequency range and fine-channel FFT method for spectrogram generation. - Update `PolyphaseFilterbank` to support selected coarse channelization methods and validate input parameters. - Modify `RawReductionSpec` to include frequency range and methods for coarse and fine channelization. - Add tests for new functionality, ensuring selected channelization methods match full slices and validating spectrogram outputs. - Introduce benchmarking script for comparing performance of full FFT slicing against selected-bin PFB channelization. - Create `spectrogram.py` module to handle spectrogram specifications and results, including writing output to files.
- Introduced a new backend management system in `setigen.voltage._array_backend` to handle NumPy and CuPy backends. - Replaced the legacy `SETIGEN_ENABLE_GPU` environment variable with a more flexible `set_backend` function. - Updated documentation and Jupyter notebooks to reflect the new backend usage. - Ensured backward compatibility by maintaining support for the legacy environment variable. - Added tests for backend setting functionality to ensure correct behavior.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
==========================================
+ Coverage 92.22% 94.27% +2.04%
==========================================
Files 54 56 +2
Lines 3189 3491 +302
==========================================
+ Hits 2941 3291 +350
+ Misses 248 200 -48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
This PR accelerates
setigen.voltageworkflows by adding exact selected-channel computation, direct voltage-to-spectrogram generation, and centralized NumPy/CuPy backend control.Key changes:
stg.voltage.set_backend("cupy" | "numpy" | "auto")for explicit backend selection.SETIGEN_ENABLE_GPU=1as a legacy fallback.RawVoltageBackend.to_spectrogram(...)to generate spectrograms directly without writing and rereading RAW files.frequency_range,coarse_method, andfine_methodoptions to reduction specs.--frequency-rangeand--fine-method.stg.voltage.set_backend("cupy").Usage
Enable GPU acceleration before constructing voltage objects:
Force CPU execution:
Generate a spectrogram directly from a voltage backend:
Reduce only a final-frequency region:
CLI equivalent:
Notes
accuracy="approx_zoom"is reserved but not implemented; onlyaccuracy="exact"is currently supported.coarse_method="auto"andfine_method="auto"use selected-bin computation only for small selections and fall back to full FFT otherwise.filterbank.frontend_method = "vectorized", but remains off by default because it can increase temporary memory use.