Skip to content

Update float type for window cutting and docs - #353

Merged
mdenolle merged 2 commits into
mainfrom
niyiyu/float
May 27, 2026
Merged

Update float type for window cutting and docs#353
mdenolle merged 2 commits into
mainfrom
niyiyu/float

Conversation

@niyiyu

@niyiyu niyiyu commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Signed-off-by: Yiyu Ni <niyiyu@uw.edu>
@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.84%. Comparing base (04cd934) to head (449be95).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #353   +/-   ##
=======================================
  Coverage   84.84%   84.84%           
=======================================
  Files           9        9           
  Lines        1986     1986           
  Branches      298      298           
=======================================
  Hits         1685     1685           
  Misses        191      191           
  Partials      110      110           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Yiyu Ni <niyiyu@uw.edu>
@niyiyu
niyiyu temporarily deployed to github-pages May 21, 2026 18:16 — with GitHub Actions Inactive
@mdenolle
mdenolle merged commit 0502604 into main May 27, 2026
22 checks passed
@mdenolle
mdenolle deleted the niyiyu/float branch May 27, 2026 15:51
niyiyu pushed a commit that referenced this pull request Aug 3, 2026
…fft, rfft whitening) — timestamps stay float64 (#356)

* Performance fixes from the 2026-08 audit of the S1 pipeline

- cut_trace_make_stat: waveform windows back to float32 (the float64 flip in
  PR #353 was not needed for issue #352 and doubled FFT/memory cost);
  timestamps dataS_t STAY float64 — the actual #352 fix — now locked in by a
  regression test asserting exactly regular 300 s steps at a 2025 epoch.
  Drop the redundant mad() gate (std check suffices).
- correlate(): replace the per-window loop of individual complex
  scipy.fftpack.ifft calls with one batched hermitian scipy.fft.irfft
  (multi-threaded, releases the GIL); accumulate the frequency-domain mean in
  float64; fix the remaining float32 t_corr in the substack_len branch
  (same #352 failure mode); remove the dead np.zeros(nwin*Nfft2) allocation;
  take an explicit is_autocorr flag (iiS == iiR) from the call site instead
  of comparing the full amplitude spectra.
- whiten(): delete the dead arr_out allocations (433 MB transient in the 2D
  branch at campaign geometry, result discarded).
- whiten_2D: rfft instead of full complex fftn — the legacy code zeroed
  everything outside the whitened positive-frequency band anyway.
- moving_ave_2D: scipy.ndimage.uniform_filter1d instead of padded convolve2d
  (numerically identical for odd and even N).
- detrend: vectorize the per-row loop into two matrix products.

Guard rails: tests/test_ccf_regression.py runs the full pipeline A/B against
verbatim copies of the legacy float64 implementations on a seeded synthetic
day (per-window CCF correlation > 0.99999, stacked r = 1.0 to 9 decimals,
identical stretching dv/v on a ±5% grid), and the #352 timestamp-regularity
test in tests/test_noise_module.py.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Address Copilot review: preserve autocorr fallback, fix debug log placeholder

- cross_corr(): default is_autocorr to None instead of False so external
  callers that don't pass the flag still get correlate()'s legacy
  spectra-comparison fallback; the production call site passes iiS == iiR
  explicitly.
- cut_trace_make_stat(): the skipped-window debug log had a %s placeholder
  with no argument; log the trace id.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

Irregular time steps in CCF

2 participants