Skip to content

Time stepped ground filter#916

Open
keskitalo wants to merge 50 commits intotoast3from
time_stepped_ground_filter
Open

Time stepped ground filter#916
keskitalo wants to merge 50 commits intotoast3from
time_stepped_ground_filter

Conversation

@keskitalo
Copy link
Member

Time-stepped ground filter and all the facilities to perform map co-add in memory.

Copy link

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 time-stepped ground filtering and expands infrastructure for in-memory HEALPix map co-addition / comparison, while also standardizing operator timing logs across multiple TOAST ops.

Changes:

  • Extend FilterBin with time-stepped ground templates, template covariance handling controls, and facilities for saving template examples / amplitudes.
  • Refactor toast_healpix_coadd.py to support cached (in-memory) inputs, optional RING output, and more flexible weighting.
  • Add a new toast_healpix_compare.py script and broaden operator-level “Applying/Applied” timing logs.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 39 comments.

Show a summary per file
File Description
src/toast/tests/ops_filterbin.py Updates FilterBin test configuration to exercise new options.
src/toast/scripts/toast_healpix_compare.py New CLI script to compare two HEALPix maps.
src/toast/scripts/toast_healpix_coadd.py Refactor coadd workflow (cache/result support, ring output option, input parsing changes).
src/toast/scripts/CMakeLists.txt Installs the new toast_healpix_compare.py entrypoint.
src/toast/pixels_io_healpix.py Simplifies HDF5 read argument handling and removes verbose printouts.
src/toast/ops/time_constant.py Adds consistent operator start/end timing logs.
src/toast/ops/simple_statcut.py Adds consistent operator start/end timing logs and adjusts logging output.
src/toast/ops/simple_jumpcorrect.py Adds consistent operator start/end timing logs.
src/toast/ops/simple_deglitch.py Adds consistent operator start/end timing logs and adjusts logging output.
src/toast/ops/signal_diff_noise_model.py Adds consistent operator timing logs.
src/toast/ops/scan_healpix.py Adds consistent operator timing logs.
src/toast/ops/polyfilter/polyfilter.py Adds consistent operator timing logs.
src/toast/ops/noise_model.py Adds consistent operator timing logs in FlagNoiseFit.
src/toast/ops/mapmaker.py Changes initialization of START/STOP header aggregation values.
src/toast/ops/hwpfilter.py Adds reverse mode and consistent operator timing logs; refactors template subtraction path.
src/toast/ops/filterbin.py Implements time-stepped ground templates, template metadata capture, rcond-based handling, template saving, and output naming changes.
src/toast/ops/demodulation.py Fixes help text typo and adds consistent operator timing logs.
src/toast/ops/decimate_focalplane.py New operator to decimate (flag) detectors on the focalplane.
src/toast/ops/calibrate.py Adds consistent operator timing logs.
src/toast/ops/init.py Exports the new DecimateFocalplane operator.
src/toast/ops/CMakeLists.txt Installs the new decimate_focalplane.py module.

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

Copy link

Copilot AI commented Feb 6, 2026

@keskitalo I've opened a new pull request, #917, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Feb 6, 2026

@keskitalo I've opened a new pull request, #918, to work on those changes. Once the pull request is ready, I'll request review from you.

keskitalo and others added 2 commits February 6, 2026 11:44
* Initial plan

* Fix undefined variables in error messages (nside1->nside, nmap1->nmap)

Co-authored-by: keskitalo <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: keskitalo <[email protected]>
Copy link

Copilot AI commented Feb 6, 2026

@keskitalo I've opened a new pull request, #921, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Feb 6, 2026

@keskitalo I've opened a new pull request, #922, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 5 commits February 6, 2026 12:48
…920)

* Initial plan

* Fix weights type error: assign tuples instead of scalars

Co-authored-by: keskitalo <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: keskitalo <[email protected]>
* Initial plan

* Fix division by zero in template orthogonalization

Co-authored-by: keskitalo <[email protected]>

* Use tolerance for near-zero norm check in orthogonalization

Co-authored-by: keskitalo <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: keskitalo <[email protected]>
* Initial plan

* Add comprehensive unit tests for DecimateFocalplane operator

Co-authored-by: keskitalo <[email protected]>

* Improve decimation pattern test with proper assertions

Co-authored-by: keskitalo <[email protected]>

* Add assertions for unflagged detectors in pixel grouping test

Co-authored-by: keskitalo <[email protected]>

* Remove redundant MPI reduction and pixel grouping tests

Co-authored-by: keskitalo <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: keskitalo <[email protected]>
@keskitalo keskitalo marked this pull request as ready for review February 10, 2026 05:24
@keskitalo keskitalo requested a review from tskisner February 10, 2026 05:24
@keskitalo
Copy link
Member Author

There are intermittent unit test failures but they seem unrelated to the PR.

@tskisner
Copy link
Member

All three test failures happen in the same place in the ops_filterbin.py test file. Do they pass locally? Do they pass on the toast3 branch?

@tskisner
Copy link
Member

I'll just note that this test fails with the same error on my local system:

OMP_NUM_THREADS=1 mpirun -np 2 python -c 'import toast.tests; toast.tests.run("ops_filterbin")'

<snip>

Proc 0: Traceback (most recent call last):
Proc 0:   File "/home/kisner/software/conda/envs/toast/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
    yield
Proc 0:   File "/home/kisner/software/conda/envs/toast/lib/python3.12/unittest/case.py", line 634, in run
    self._callTestMethod(testMethod)
Proc 0:   File "/home/kisner/software/conda/envs/toast/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
    if method() is not None:
       ^^^^^^^^
Proc 0:   File "/home/kisner/software/conda/envs/toast/lib/python3.12/site-packages/toast/tests/ops_filterbin.py", line 776, in test_filterbin_obsmatrix_noiseweighted
    fname_matrix = ops.coadd_observation_matrix(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Proc 0:   File "/home/kisner/software/conda/envs/toast/lib/python3.12/site-packages/toast/ops/obsmat.py", line 187, in coadd_observation_matrix
    raise RuntimeError(msg)
Proc 0: RuntimeError: Cannot find an inverse covariance matrix to go with '{infile_matrix}'

[0]error Abort(1) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0

The same command running on an install of the toast3 branch works, so the cause of the failure is something in this PR. I'll see if anything stands out as I look through it.

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.

3 participants