Skip to content

MOC TS map rebases on v0.3.x #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 15, 2025

Conversation

Yong2Sheng
Copy link
Contributor

This PR adds the method to do multi-resolution (also called multi-order coverage, MOC) TS map fitting.

Changes to FastTSMap

  1. FastTSMap is the parent class of MOCTSMap

  2. I need to make several changes to FastTSMap to make it work with MOCTSMap:

    • Add pixel_idx parameter for fast_ts_fit.
      • This parameter is the index of the pixels fitted by FastTSMap.
      • This is added since we only fit a portion of the multi-resolution map. So I need to record the indices of the fitted pixels to match the likelihood values.
      • Note it's index of the pixels in a multi-resolution map, not the unique numbers of the pixels.
    • Add a new function zip_comp to generate the inputs for multiprocessing.
      • I used itertools.product before. However, it will cause duplicated fittings in MOCTSMap.
      • So I use zip_comp to replace it.

New module MOCTSMap.

  1. This is the new module responsible for multi-resolution TS map fitting.
  2. It checks the likelihood during each iteration, and only fit the child pixels of the mother pixels that meets the criterion.
  3. Add unit test for moc_ts_fit.py.
  4. Fixed a bug in Add multi-resolution TS map fitting  #248 where the MOC TS map values are integers. Not sure how this could affect/improve the current result, I will do some tests.

Changes to the TS map tutorial

  1. I renamed the tutorial notebook back to the original one name Parallel_TS_map_computation.ipynbso we can keep everything self-consistent
  2. I added Example 4, which fits the Crab with the multi-resolution map.

Please let me know if you have any questions and suggestions. Thank you!

@Yong2Sheng Yong2Sheng added the enhancement New feature or request label Apr 15, 2025
@Yong2Sheng Yong2Sheng requested a review from israelmcmc April 15, 2025 14:14
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 92.68293% with 9 lines in your changes missing coverage. Please review.

Project coverage is 79.80%. Comparing base (96057d5) to head (c4172c6).
Report is 8 commits behind head on v0.3.x.

Files with missing lines Patch % Lines
cosipy/ts_map/moc_ts_fit.py 95.14% 5 Missing ⚠️
cosipy/ts_map/fast_ts_fit.py 76.47% 4 Missing ⚠️
Files with missing lines Coverage Δ
cosipy/__init__.py 100.00% <100.00%> (ø)
cosipy/ts_map/__init__.py 100.00% <100.00%> (ø)
cosipy/ts_map/fast_ts_fit.py 57.36% <76.47%> (+3.13%) ⬆️
cosipy/ts_map/moc_ts_fit.py 95.14% <95.14%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@israelmcmc
Copy link
Collaborator

Thanks @Yong2Sheng. Looks good to me, I'm merging!

@israelmcmc israelmcmc merged commit 97824fe into cositools:v0.3.x Apr 15, 2025
5 checks passed
@Yong2Sheng
Copy link
Contributor Author

Thank you @israelmcmc for reviewing and merging this PR!

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.

2 participants