Skip to content

Add example recreating SMART paper Figures 3, 5 and 11 (partially) - #22

Merged
samaloney merged 13 commits into
TCDSolar:mainfrom
samaloney:paper-example
Sep 4, 2026
Merged

Add example recreating SMART paper Figures 3, 5 and 11 (partially)#22
samaloney merged 13 commits into
TCDSolar:mainfrom
samaloney:paper-example

Conversation

@samaloney

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Several issues need correction (example misuse of preprocessing, inconsistent kwargs propagation, and a couple of correctness/documentation/error-message problems) before the changes are safe and clear to users.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds a new end-to-end example that reproduces selected figures from Higgins et al. (2011) and updates the SMART processing pipeline to better match the paper (smoothing → threshold → LOS correction), including improved off-disk handling and transient removal.

Changes:

  • Replace in-place map_threshold with remove_off_disk that returns a copied map and sets off-limb pixels to NaN.
  • Rework smooth_los_threshold and transient removal (index_and_grow_mask) to follow the paper’s intended processing order and enable “un-grown” masks for callers that do their own growing.
  • Add a comprehensive Sphinx-gallery example reproducing SMART paper Figures 3, 5, and (partially) 11, and update docs/changelog accordingly.
File summaries
File Description
smart/tests/test_map_processing.py Updates tests to cover remove_off_disk behavior and non-mutating semantics.
smart/tests/test_calculate_properties.py Updates the integration-style test data URL/time for the previous magnetogram.
smart/processing.py Introduces remove_off_disk, reorders smoothing/threshold/LOS correction, adds configurable caps, and updates smart_prep pass-through.
smart/indexed_grown_mask.py Reworks transient removal to rotate the earlier frame after smoothing/thresholding and compares masks as in the paper.
smart/calculate_properties.py Updates pipeline to use the new indexing/transient-removal flow and forwards kwargs to IGM.
pyproject.toml Adds sunpy[net] to docs extras to support the new example’s JSOC/HEK fetching.
examples/smart_process.py Updates processing example to use remove_off_disk and the updated IGM call shape.
examples/reproducing_higgins_2011.py New example script reproducing key Higgins et al. (2011) figures using JSOC/HEK data.
examples/full_walkthrough.py Updates walkthrough to match the new mask-indexing workflow.
docs/explanation.rst Updates pipeline documentation references from map_threshold to remove_off_disk.
changelog/22.doc.rst Adds documentation changelog entry for the new reproduction example.
changelog/22.bugfix.rst Adds bugfix changelog entry describing pipeline/algorithm fixes made during reproduction.
Review details

Suppressed comments (1)

smart/processing.py:192

  • cosine_correct_data also needs to validate limit before using it in arcsin(limit) and to compute the clipping cap; otherwise callers can trigger invalid math by passing out-of-range values.
    if cosmap is None:
        cosmap = calculate_cosine_correction(im_map, limit=limit)

    cosmap = np.clip(cosmap, None, 1 / np.cos(np.arcsin(limit)))
  • Files reviewed: 12/12 changed files
  • Comments generated: 9
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread examples/smart_process.py
Comment thread smart/calculate_properties.py
Comment thread smart/indexed_grown_mask.py
Comment thread smart/processing.py
Comment thread changelog/22.bugfix.rst Outdated
Comment thread examples/reproducing_higgins_2011.py Outdated
Comment thread examples/reproducing_higgins_2011.py Outdated
Comment thread smart/processing.py
Comment thread smart/processing.py
@samaloney
samaloney merged commit 27a0ad4 into TCDSolar:main Sep 4, 2026
20 checks passed
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.

2 participants