Add example recreating SMART paper Figures 3, 5 and 11 (partially) - #22
Conversation
7742ae6 to
005ce48
Compare
005ce48 to
9042aff
Compare
There was a problem hiding this comment.
🟡 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_thresholdwithremove_off_diskthat returns a copied map and sets off-limb pixels to NaN. - Rework
smooth_los_thresholdand 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_dataalso needs to validatelimitbefore using it inarcsin(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.
No description provided.