Skip to content

Implement mathematical documentation fix for log-tens transformation#9

Open
zonca wants to merge 12 commits into
freefree_f2_fazlurahmanfrom
freefree_f2_zonca
Open

Implement mathematical documentation fix for log-tens transformation#9
zonca wants to merge 12 commits into
freefree_f2_fazlurahmanfrom
freefree_f2_zonca

Conversation

@zonca
Copy link
Copy Markdown
Owner

@zonca zonca commented Feb 18, 2026

This PR fixes a mathematical typo in Cell 11 of the free-free small-scale template notebook. The transformation 'i' was correctly implemented in code as ln(I) but incorrectly documented as ln(I^2).

@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 force-pushed the freefree_f2_fazlurahman branch from 11d271e to 873a928 Compare February 18, 2026 02:36
@zonca zonca force-pushed the freefree_f2_zonca branch from 5e78a0a to 092e3c3 Compare February 18, 2026 02:48
@zonca zonca force-pushed the freefree_f2_fazlurahman branch from 873a928 to 9d8ad0a Compare February 18, 2026 02:55
@zonca zonca force-pushed the freefree_f2_zonca branch from 092e3c3 to 36366fc Compare February 18, 2026 03:09
zonca and others added 11 commits February 17, 2026 19:13
Use log(m + eps) / exp(x) - eps instead of log(max(m, eps)) / exp(x),
making the forward and inverse transforms a true inverse pair. The
previous implementation introduced a bias for pixels where m < eps
because the inverse did not account for the epsilon floor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Major reorganization of the notebook from 94 cells to 53 cells:

- Organize into 12 numbered sections with clear markdown hierarchy
- Add detailed explanations for each processing step including
  the EM-to-temperature conversion physics (Gaunt factor, references),
  the log-transform pair, power-conserving cross-fade filters, and
  the patch-based modulation map construction
- Fix stale math documentation: update formulas to match the actual
  log(I+eps)/exp(i)-eps transform pair
- Import sigmoid from pysm3.utils instead of redefining it locally
- Use pysm3.utils.add_metadata for FITS output coordinate/unit metadata
- Consolidate imports into a single cell, remove 14 empty cells
- Extract all hardcoded parameters to a documented configuration cell
- Rename variables for clarity: gamma_fit2 -> gamma_target,
  A_fit2 -> A_extrap, map_to_log_pol_tens -> map_to_log
- Remove dead code (unused variables, commented-out saves, debug prints)
- Add RANDOM_SEED=777 for reproducibility
- Notebook executes successfully at nside=2048

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The executed notebook (with outputs and plots) is available as a gist:
https://gist.github.com/zonca/22ca2c4e94e6756a6c87f7bde489c294

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix SyntaxWarning: use raw strings for label with C_\ell in cell 27
- Add grid to power spectra comparison plot
- Remove diff panels from gnomview comparison
- Compare f1 vs f2 on same color scale after monopole removal
- Add full-sky mollview comparison with monopole removed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.

1 participant