Skip to content

Unified SZ implementation that can handle both websky and Agora#188

Closed
zonca wants to merge 35 commits intogalsci:mainfrom
zonca:agora_sz
Closed

Unified SZ implementation that can handle both websky and Agora#188
zonca wants to merge 35 commits intogalsci:mainfrom
zonca:agora_sz

Conversation

@zonca
Copy link
Copy Markdown
Member

@zonca zonca commented Jul 23, 2024

No description provided.

@zonca zonca self-assigned this Jul 23, 2024
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@zonca zonca marked this pull request as ready for review January 10, 2026 06:55
@zonca zonca requested a review from Copilot January 10, 2026 06:55
Copy link
Copy Markdown
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 pull request refactors the SZ (Sunyaev-Zeldovich) model implementation to create a unified approach that can handle both WebSky and Agora simulation templates. The WebSkySZ class is renamed to SimpleSZ and generalized to accept arbitrary template files rather than hardcoding WebSky-specific paths.

Changes:

  • Renamed WebSkySZ to SimpleSZ with a more flexible API accepting template filenames
  • Updated preset configurations to use the new SimpleSZ class for both existing WebSky models (ksz1, tsz1) and new Agora models (ksz2, tsz2, ksz3, tsz3)
  • Added a verification notebook to compare WebSky and Agora SZ templates

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/pysm3/models/websky.py Refactored WebSkySZ to SimpleSZ, removing hardcoded filename logic and accepting template_name parameter
src/pysm3/models/init.py Updated exports to replace WebSkySZ with SimpleSZ
tests/test_websky.py Updated test to use new SimpleSZ API with explicit template_name parameter
src/pysm3/data/presets.cfg Updated existing presets (ksz1, tsz1) and added new Agora presets (ksz2, ksz3, tsz2, tsz3)
docs/preprocess-templates/verify_templates/compare_websky_agora_sz.ipynb New notebook for comparing WebSky and Agora SZ templates

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

Comment thread src/pysm3/models/websky.py Outdated
Comment thread src/pysm3/models/websky.py Outdated
Comment thread src/pysm3/models/__init__.py Outdated
Comment thread src/pysm3/models/websky.py Outdated
Comment thread src/pysm3/data/presets.cfg Outdated
Comment thread src/pysm3/data/presets.cfg Outdated
Comment thread src/pysm3/models/websky.py Outdated
zonca added 2 commits January 13, 2026 18:24
setup, add joint_limits and remove_monopole functions, and enhance
thermal and kinematic SZ comparisons
@zonca
Copy link
Copy Markdown
Member Author

zonca commented Jan 14, 2026

@giuspugl @1cosmologist @seclark @brandonshensley I have implemented Agora SZ components and compared with websky,
can you check in detail this notebook? tsz looks fine, it just has different monopoles, ksz is very different.

https://gist.github.com/zonca/36576153be6b2ef706b61da4d6a90c33

@zonca zonca force-pushed the agora_sz branch 2 times, most recently from 24ca15e to b6a672a Compare January 14, 2026 03:43
@1cosmologist
Copy link
Copy Markdown

I had a look at the notebook and I think it looks fine. One comment I have for the tSZ validation is that Agora tSZ minus WebSky tSZ is not a good check as these are different realizations and should not be similar (and we see that). No idea what to make of the monopole.
The kSZ spectra looks like what WebSky (fig 6) and Agora (fig 16) published:
Screenshot 2026-01-14 at 16 57 55
Screenshot 2026-01-14 at 16 57 38
The low-ell excess is coming from the doppler term. WebSky vs Agora are very different box sizes, so not sure if Agora can eve simulate a large scale doppler term (in the bulk field). What is important is that the high ell behaviour is (sort of) consistent. In the Agora fig 16, the constraints from data are at very high ells with large error bars. I suggest we document the differences so that users are aware of the differences.

@zonca
Copy link
Copy Markdown
Member Author

zonca commented Jan 15, 2026

@1cosmologist thanks for the feedback, would you be able to do a pull request against this pull request to improve the docs? If we need more space we can create a agora.rst file all dedicated to the Agora-based models.

zonca added 3 commits January 26, 2026 13:03
Prevent duplicate log messages by clearing existing handlers and disabling propagation to the root logger.
@zonca
Copy link
Copy Markdown
Member Author

zonca commented Jan 27, 2026

Adding composite images for kSZ and tSZ template verification.

tSZ

tsz_composite

kSZ

ksz_composite

@zonca
Copy link
Copy Markdown
Member Author

zonca commented Jan 27, 2026

needed to rebase everything and enable git lfs, moved to #244

@zonca zonca closed this Jan 27, 2026
@zonca zonca deleted the agora_sz branch January 27, 2026 06:46
@zonca zonca restored the agora_sz branch January 27, 2026 06:46
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.

4 participants