Skip to content

Interface with ducc0 noise generation and documentation improvements#490

Open
paganol wants to merge 6 commits intomasterfrom
ducc0_noise
Open

Interface with ducc0 noise generation and documentation improvements#490
paganol wants to merge 6 commits intomasterfrom
ducc0_noise

Conversation

@paganol
Copy link
Member

@paganol paganol commented Jan 29, 2026

Description

This PR introduces an interface with the ducc0 noise generation module, offering a significant performance boost for long timelines. It refactors the noise.py module to support multiple noise generation engines and physical models, while improving documentation and defaulting to the standard FFT-based approach for backward compatibility.

Key Changes

New Noise Engines & Models:

  • Added support for engine="ducc", which uses ducc0.misc.OofaNoise for time-domain filtering. This is faster and more memory-efficient for long simulations.
  • Added support for model="keshner" (native to DUCC) alongside the existing model="toast", which implements the model in toast.
  • Refactored add_one_over_f_noise to dispatch between fft (default) and ducc engines.

API Updates:

  • add_noise_to_observations and underlying functions now accept engine and model arguments.
  • Defaults: The defaults remain engine="fft" and model="toast" to ensure backward compatibility.
  • Validation: Added safety checks to prevent mismatched engine/model combinations (e.g., raising a ValueError if engine="ducc" is used with model="toast").

@paganol paganol added the enhancement New feature or request label Jan 29, 2026
@paganol paganol linked an issue Jan 29, 2026 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  litebird_sim
  hwp_diff_emiss.py 80
  noise.py 21-27, 36-42, 72-85, 215-229, 396
  simulations.py
Project Total  

This report was generated by python-coverage-comment-action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ducc0 for noise.py and other applications of FFT

1 participant