Skip to content

Comments

feat(imaging): DataDegrader for sparsity validation (#187)#240

Merged
KedoKudo merged 2 commits intofeature/172-2d-imagingfrom
feature/187-data-degrader
Feb 21, 2026
Merged

feat(imaging): DataDegrader for sparsity validation (#187)#240
KedoKudo merged 2 commits intofeature/172-2d-imagingfrom
feature/187-data-degrader

Conversation

@KedoKudo
Copy link
Collaborator

Summary

  • Adds DataDegrader class in src/pleiades/imaging/degrader.py
  • add_poisson_noise(data, n_incident): Poisson photon-counting noise, clips to [0,1]
  • add_dead_pixels(data, dead_fraction): sets random pixel spectra to 1.0, returns (data, mask)
  • degrade_to_level(data, level): L1–L4 presets (L1=5000, L2=500, L3=100+5%dead, L4=20+10%dead)
  • All operations reproducible via random_seed
  • 36 unit tests covering shape, range, statistical expectations, reproducibility, error handling

Test plan

  • pixi run pytest tests/unit/pleiades/imaging/test_degrader.py -v → 36 passed
  • No regressions in existing 1487 tests

🤖 Generated with Claude Code

…ion (#187)

Adds DataDegrader to src/pleiades/imaging/degrader.py with three degradation
methods: add_poisson_noise (photon-counting simulation), add_dead_pixels
(open-beam detector dead elements), and degrade_to_level (L1-L4 presets).
All operations are reproducible via random_seed. 36 unit tests in
tests/unit/pleiades/imaging/test_degrader.py cover happy paths, edge
cases, error handling, and statistical expectations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a DataDegrader class to simulate realistic noise and detector degradation in hyperspectral transmission data for algorithm validation. The implementation supports reproducible Poisson photon-counting noise, dead pixel simulation, and preset degradation levels (L1-L4) representing different data quality scenarios.

Changes:

  • Added DataDegrader class with Poisson noise simulation and dead pixel injection
  • Implemented four preset degradation levels (L1=mild to L4=extreme)
  • Comprehensive test suite with 36 unit tests covering all methods, edge cases, and reproducibility

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/pleiades/imaging/degrader.py New DataDegrader class with add_poisson_noise, add_dead_pixels, and degrade_to_level methods
tests/unit/pleiades/imaging/test_degrader.py Comprehensive test suite covering initialization, Poisson noise, dead pixels, degradation levels, error handling, and reproducibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KedoKudo KedoKudo merged commit 6f3fb65 into feature/172-2d-imaging Feb 21, 2026
3 checks passed
@KedoKudo KedoKudo deleted the feature/187-data-degrader branch February 21, 2026 01:56
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