Attempt to add GOES flare detection algo - #210
Conversation
|
Think the test fail is unrelated but due to update to the workflow need to export the coverage file var |
There was a problem hiding this comment.
Pull request overview
This pull request introduces a GOES XRS flare-detection implementation (with both a “naive” 3-rule interpretation and a refined algorithm intended to better match NOAA/HEK conventions), exposes it through the goes_xrs package API, and adds tests plus a gallery example to compare detections across cadences against HEK.
Changes:
- Add flare detection algorithms (
find_flares,find_flares_naive) and a GOES-specific wrapper (find_goes_flares) with cadence rebinning and quality-flag handling. - Fix/guard GOES flux → class conversion for float32 inputs and add regression coverage.
- Add comprehensive unit tests and an example script comparing detections vs HEK, plus a changelog entry.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sunkit_instruments/goes_xrs/goes_xrs.py | Adjusts flux_to_flareclass() decade computation to avoid float32 lookup issues. |
| sunkit_instruments/goes_xrs/flare_detection.py | New flare detection implementation (naive + refined) and GOES wrapper. |
| sunkit_instruments/goes_xrs/init.py | Re-exports new flare detection API at package level. |
| sunkit_instruments/goes_xrs/tests/test_goes_xrs.py | Adds float32 regression tests for flux_to_flareclass(). |
| sunkit_instruments/goes_xrs/tests/test_flare_detection.py | New test suite covering flare detection behavior and parameters. |
| examples/compare_goes_flare_detection_cadence.py | New example comparing flare detections across cadences vs HEK. |
| changelog/210.feature.rst | Documents the newly added flare detection functionality and example. |
Comments suppressed due to low confidence (4)
examples/compare_goes_flare_detection_cadence.py:13
- Typos in the example description (e.g. "periodn", "inxlucig", "windowis").
We will look at an active periodn in May 2024 with many large flare inxlucig
an X-class and also a quiet period during solar minimum, in May 2020, where
the largest flare in the windowis only A-class.
examples/compare_goes_flare_detection_cadence.py:168
- Typo in the miss-diagnosis label: "too shollow" -> "too shallow".
return "too shollow"
examples/compare_goes_flare_detection_cadence.py:327
- Typo in comment: "moth" -> "month".
# if offline run for entire moth or longer
examples/compare_goes_flare_detection_cadence.py:348
- Typos in comment: "dispear" -> "disappear" and grammar tweak for readability.
# (some of the extra events will dispear if use the extended info in the 1min avg files)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
PR Description
Attempt to add the "GOES X-ray detection algorithm" defined as
10^7W/m^{-2}` (HEK SWPC list goes down to A1.1 at lest)Initially implemented basic version based on based on the above rules but found poor match to events reported in the HEK. These rules are not sufficient to implement a full algotrytm e.g. temporary bump/dips so tired to add some more condition to improve agreement with the HEK SWPC
Open questions:
AI Assistance Disclosure
AI tools were used for: