WaLSAlib 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. walsalib-1.1.0/CHANGELOG.md +13 -0
  2. walsalib-1.1.0/CONTRIBUTING.md +35 -0
  3. walsalib-1.1.0/LICENSE +201 -0
  4. walsalib-1.1.0/MANIFEST.in +17 -0
  5. walsalib-1.1.0/PKG-INFO +178 -0
  6. walsalib-1.1.0/README.md +118 -0
  7. walsalib-1.1.0/THIRD_PARTY_NOTICES.md +26 -0
  8. walsalib-1.1.0/WaLSAlib.egg-info/PKG-INFO +178 -0
  9. walsalib-1.1.0/WaLSAlib.egg-info/SOURCES.txt +54 -0
  10. walsalib-1.1.0/WaLSAlib.egg-info/dependency_links.txt +1 -0
  11. walsalib-1.1.0/WaLSAlib.egg-info/requires.txt +39 -0
  12. walsalib-1.1.0/WaLSAlib.egg-info/top_level.txt +1 -0
  13. walsalib-1.1.0/build_support.py +31 -0
  14. walsalib-1.1.0/docs/release.md +41 -0
  15. walsalib-1.1.0/docs/upstream.md +36 -0
  16. walsalib-1.1.0/pyproject.toml +59 -0
  17. walsalib-1.1.0/setup.cfg +4 -0
  18. walsalib-1.1.0/src/WaLSAlib/SoFT.py +24 -0
  19. walsalib-1.1.0/src/WaLSAlib/SoFTg.py +24 -0
  20. walsalib-1.1.0/src/WaLSAlib/__init__.py +30 -0
  21. walsalib-1.1.0/src/WaLSAlib/_vendor/__init__.py +1 -0
  22. walsalib-1.1.0/src/WaLSAlib/_vendor/soft/__init__.py +1 -0
  23. walsalib-1.1.0/src/WaLSAlib/_vendor/soft/extras.py +819 -0
  24. walsalib-1.1.0/src/WaLSAlib/_vendor/soft/soft.py +1401 -0
  25. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/__init__.py +1 -0
  26. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/dataset.py +324 -0
  27. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/granule_detection_lib.py +258 -0
  28. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/label_tool.py +373 -0
  29. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/losses.py +101 -0
  30. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/model.py +177 -0
  31. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/predict.py +231 -0
  32. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/train.py +402 -0
  33. walsalib-1.1.0/src/WaLSAlib/_vendor/softg/utils.py +154 -0
  34. walsalib-1.1.0/src/WaLSAlib/linefit/WaLSA_LineFit.py +1561 -0
  35. walsalib-1.1.0/src/WaLSAlib/linefit/__init__.py +8 -0
  36. walsalib-1.1.0/tests/release/test_public_api.py +173 -0
  37. walsalib-1.1.0/tools/check_dist.py +99 -0
  38. walsalib-1.1.0/tools/sync_upstreams.py +119 -0
  39. walsalib-1.1.0/vendor/SoFT/LICENSE +674 -0
  40. walsalib-1.1.0/vendor/SoFT/README.md +86 -0
  41. walsalib-1.1.0/vendor/SoFT/setup.py +42 -0
  42. walsalib-1.1.0/vendor/SoFT/soft/__init__.py +13 -0
  43. walsalib-1.1.0/vendor/SoFT/soft/extras.py +819 -0
  44. walsalib-1.1.0/vendor/SoFT/soft/soft.py +1397 -0
  45. walsalib-1.1.0/vendor/SoFTg/LICENSE +674 -0
  46. walsalib-1.1.0/vendor/SoFTg/README.md +44 -0
  47. walsalib-1.1.0/vendor/SoFTg/dataset.py +324 -0
  48. walsalib-1.1.0/vendor/SoFTg/granule_detection_lib.py +258 -0
  49. walsalib-1.1.0/vendor/SoFTg/label_tool.py +373 -0
  50. walsalib-1.1.0/vendor/SoFTg/losses.py +101 -0
  51. walsalib-1.1.0/vendor/SoFTg/model.py +177 -0
  52. walsalib-1.1.0/vendor/SoFTg/predict.py +231 -0
  53. walsalib-1.1.0/vendor/SoFTg/requirements.txt +12 -0
  54. walsalib-1.1.0/vendor/SoFTg/train.py +402 -0
  55. walsalib-1.1.0/vendor/SoFTg/utils.py +154 -0
  56. walsalib-1.1.0/vendor/upstream-lock.json +57 -0
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 1.1.0 (Unreleased)
4
+
5
+ - Public imports for `LineFit`, `SoFT`, and `SoFTg`, with `linefit` as a callable alias.
6
+ - Solar feature tracking and granule segmentation from pinned SoFT and SoFTg sources.
7
+ - Optional UNet++ training and inference, desktop labeling, SunPy/EMD helpers, and WaLSAtools dependencies.
8
+ - Wheel and source distributions with explicit package contents and license metadata.
9
+ - Automated upstream update proposals and tag-based Trusted Publishing.
10
+
11
+ ## 1.0.0
12
+
13
+ Adaptive spectral line fitting and publication examples.
@@ -0,0 +1,35 @@
1
+ # Contributing
2
+
3
+ Discuss new methods or modules in a GitHub issue before submitting a pull request. Include documentation, dependencies, license information, citation details, and numerical and interface tests appropriate to the method.
4
+
5
+ ## Development environment
6
+
7
+ Use Python 3.10 or newer and a virtual environment:
8
+
9
+ ```bash
10
+ pip install -e '.[test,build]'
11
+ ```
12
+
13
+ Install the `softg` extra for ML development and validation.
14
+
15
+ ## Validation
16
+
17
+ ```bash
18
+ python tools/sync_upstreams.py --check
19
+ python -m pytest tests/release
20
+ python -m build
21
+ python -m twine check --strict dist/*
22
+ python tools/check_dist.py dist
23
+ ```
24
+
25
+ Document API changes, scientific assumptions, and compatibility requirements. Include reproducible examples or reference results for numerical changes.
26
+
27
+ ## Package structure
28
+
29
+ Public packages and modules are listed in `pyproject.toml`, `build_support.py`, and `MANIFEST.in`. Update these lists when adding a module. Distribution checks enforce the declared package contents.
30
+
31
+ Sources under `src/WaLSAlib/_vendor` are generated from the pinned snapshots in `vendor/`. Use `tools/sync_upstreams.py` to regenerate them. See [upstream components](docs/upstream.md) for the update procedure and [publishing](docs/release.md) for release instructions.
32
+
33
+ Keep machine-specific configuration, datasets, model checkpoints, and generated outputs outside version control. Review staged changes before committing.
34
+
35
+ Follow [.github/CODE_OF_CONDUCT.md](.github/CODE_OF_CONDUCT.md) and report security concerns as described in [.github/SECURITY.md](.github/SECURITY.md).
walsalib-1.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,17 @@
1
+ include README.md LICENSE THIRD_PARTY_NOTICES.md pyproject.toml
2
+ include CONTRIBUTING.md CHANGELOG.md build_support.py
3
+ recursive-include vendor *.py *.md *.json LICENSE requirements.txt
4
+ include tools/check_dist.py tools/sync_upstreams.py
5
+ include tests/release/test_public_api.py
6
+ include docs/release.md docs/upstream.md
7
+ prune src
8
+ include src/WaLSAlib/__init__.py src/WaLSAlib/SoFT.py src/WaLSAlib/SoFTg.py
9
+ include src/WaLSAlib/linefit/__init__.py src/WaLSAlib/linefit/WaLSA_LineFit.py
10
+ include src/WaLSAlib/_vendor/__init__.py
11
+ recursive-include src/WaLSAlib/_vendor/soft *.py
12
+ recursive-include src/WaLSAlib/_vendor/softg *.py
13
+ prune examples
14
+ prune build
15
+ prune dist
16
+ prune .github
17
+ global-exclude *.py[cod] .DS_Store
@@ -0,0 +1,178 @@
1
+ Metadata-Version: 2.4
2
+ Name: WaLSAlib
3
+ Version: 1.1.0
4
+ Summary: WaLSA auxiliary routines for spectroscopy and solar feature tracking.
5
+ Author: WaLSA Team
6
+ License-Expression: Apache-2.0 AND GPL-3.0-only
7
+ Project-URL: Homepage, https://walsa.team
8
+ Project-URL: Repository, https://github.com/WaLSAteam/WaLSAlib
9
+ Project-URL: Issues, https://github.com/WaLSAteam/WaLSAlib/issues
10
+ Project-URL: Documentation, https://github.com/WaLSAteam/WaLSAlib#readme
11
+ Keywords: solar physics,spectroscopy,feature tracking,granulation
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ License-File: THIRD_PARTY_NOTICES.md
24
+ License-File: vendor/SoFT/LICENSE
25
+ License-File: vendor/SoFTg/LICENSE
26
+ Requires-Dist: numpy>=1.23
27
+ Requires-Dist: scipy>=1.10
28
+ Requires-Dist: astropy>=5
29
+ Requires-Dist: matplotlib>=3.6
30
+ Requires-Dist: pandas>=1.5
31
+ Requires-Dist: scikit-image<0.28,>=0.21
32
+ Requires-Dist: pathos>=0.3
33
+ Requires-Dist: fastprogress>=1.0
34
+ Requires-Dist: tqdm>=4.64
35
+ Provides-Extra: soft-extras
36
+ Requires-Dist: sunpy[map,net]>=5; extra == "soft-extras"
37
+ Requires-Dist: EMD-signal>=1.6; extra == "soft-extras"
38
+ Requires-Dist: ipython>=8; extra == "soft-extras"
39
+ Provides-Extra: softg
40
+ Requires-Dist: torch>=2.6; extra == "softg"
41
+ Requires-Dist: torchvision>=0.21; extra == "softg"
42
+ Requires-Dist: lightning>=2.5; extra == "softg"
43
+ Requires-Dist: opencv-python-headless>=4.8; extra == "softg"
44
+ Requires-Dist: pillow>=9; extra == "softg"
45
+ Requires-Dist: tensorboard>=2.12; extra == "softg"
46
+ Provides-Extra: softg-gui
47
+ Requires-Dist: PyQt5>=5.15; extra == "softg-gui"
48
+ Requires-Dist: opencv-python-headless>=4.8; extra == "softg-gui"
49
+ Requires-Dist: torch>=2.6; extra == "softg-gui"
50
+ Provides-Extra: walsatools
51
+ Requires-Dist: WaLSAtools; extra == "walsatools"
52
+ Provides-Extra: test
53
+ Requires-Dist: pytest>=8; extra == "test"
54
+ Provides-Extra: build
55
+ Requires-Dist: build>=1.2; extra == "build"
56
+ Requires-Dist: twine>=6; extra == "build"
57
+ Requires-Dist: setuptools>=77; extra == "build"
58
+ Requires-Dist: wheel; extra == "build"
59
+ Dynamic: license-file
60
+
61
+ <div style="display: block; margin-bottom: 20px;">
62
+ <img align="left" src="https://raw.githubusercontent.com/WaLSAteam/WaLSAlib/main/docs/images/WaLSAlib_logo.svg" alt="WaLSAlib" width="400" height="auto">
63
+ </div>
64
+
65
+ <br><br><br>
66
+
67
+ # WaLSAlib &ndash; WaLSA Library of Auxiliary Routines
68
+ <p align="left">
69
+ <a href="#"><img src="https://img.shields.io/badge/WaLSAlib-v1.1.0-0066cc"></a>
70
+ <a href="https://walsa.team" target="_blank"><img src="https://img.shields.io/badge/powered%20by-WaLSA%20Team-000d1a"></a>
71
+ <a href="#"><img src="https://img.shields.io/badge/license-Apache%202.0%20%2B%20GPLv3-green"></a>
72
+ <a href="https://doi.org/10.5281/zenodo.23043078"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.23043078-blue.svg" alt="DOI">
73
+ </a>
74
+ </p>
75
+
76
+ **WaLSAlib** is a companion repository to [**WaLSAtools**](https://github.com/WaLSAteam/WaLSAtools), collecting practical workflow routines developed within the WaLSA Team to prepare *analysis-ready* products and time series for wave/oscillation studies (and related diagnostics). The focus here is on upstream and auxiliary steps that often sit between calibrated observations and the actual wave analysis.
77
+
78
+ WaLSAlib and its LineFit module are introduced in [Jafarzadeh et al. (2026)](https://doi.org/10.3389/fspas.2026.1843842), *Frontiers in Astronomy and Space Sciences*.
79
+
80
+ ## Scope and philosophy
81
+ Many routines in WaLSAlib are motivated by (and initially developed for) **Solar Physics** use cases — e.g., spectroscopy/spectro-polarimetry and time-series imaging — although they may be useful more broadly.
82
+
83
+ ## Included modules
84
+
85
+ - **LineFit**: adaptive multi-line spectral fitting, line-core intensities, and LOS velocities.
86
+ - **SoFT**: solar feature detection, association, and tabulation, maintained independently at [mib-unitn/SoFT](https://github.com/mib-unitn/SoFT).
87
+ - **SoFTg**: classical granule segmentation and optional UNet++ training/inference, maintained independently at [mib-unitn/SoFTg](https://github.com/mib-unitn/SoFTg).
88
+
89
+ SoFT and SoFTg are bundled with WaLSAlib. See [upstream components](https://github.com/WaLSAteam/WaLSAlib/blob/main/docs/upstream.md) for source versions and maintenance instructions.
90
+
91
+ ## Relationship to WaLSAtools
92
+ - **WaLSAlib**: spectral fitting, magnetic feature tracking, and granule segmentation
93
+ - **WaLSAtools**: wave and oscillation analysis methods (FFT/Welch, wavelets, cross-spectra, significance, etc.)
94
+
95
+ ## Installation
96
+
97
+ Python 3.10 or newer is required. Install the package with:
98
+
99
+ ```bash
100
+ pip install WaLSAlib
101
+ ```
102
+
103
+ To install from a source checkout:
104
+
105
+ ```bash
106
+ pip install .
107
+ # For development:
108
+ pip install -e '.[test,build]'
109
+ ```
110
+
111
+ The base installation includes LineFit, SoFT tracking, and classical SoFTg segmentation.
112
+
113
+ ## Quick start
114
+
115
+ ```python
116
+ from WaLSAlib import LineFit, SoFT, SoFTg
117
+ ```
118
+
119
+ ### Spectral line fitting
120
+
121
+ `LineFit` accepts a spectrum or a sequence of spectra, a wavelength axis, rest wavelengths, and line labels:
122
+
123
+ ```python
124
+ velocity, intensity = LineFit(
125
+ spectra,
126
+ wavelengths=wavelengths,
127
+ refwavelength=rest_wavelengths,
128
+ element=line_labels,
129
+ )
130
+ ```
131
+
132
+ Wavelengths are expressed in nm and velocities in km/s. `linefit` is also available as an alias for `LineFit`. See the [LineFit examples](https://github.com/WaLSAteam/WaLSAlib/tree/main/examples/LineFit_Frontiers) for data preparation, fitting, and analysis workflows.
133
+
134
+ ### Solar feature tracking
135
+
136
+ For a two-dimensional magnetogram, specify a detection threshold in the image's intensity units:
137
+
138
+ ```python
139
+ labels = SoFT.detection(magnetogram, l_thr=20, sign="pos")
140
+ labels = SoFT.identification(labels, min_size=4)
141
+ ```
142
+
143
+ `SoFT.track_all(...)` runs detection, association, and tabulation on a FITS sequence. Supply a dedicated working directory containing `00-data/`, with a trailing path separator. Each run replaces the contents of `01-mask/`, `02-id/`, and `03-assoc/`. Optional SunPy and EMD analysis functions are available through `SoFT.extras`.
144
+
145
+ ### Granule segmentation
146
+
147
+ For a two-dimensional continuum image, specify the plate scale in km per pixel:
148
+
149
+ ```python
150
+ granules, seeds, skeleton = SoFTg.segment_solar_granules(
151
+ continuum_image, plate_scale=50
152
+ )
153
+ ```
154
+
155
+ The UNet++ workflows use user-supplied training data and model checkpoints. Install the `softg` extra to access `SoFTg.model`, `SoFTg.predict`, and `SoFTg.train`:
156
+
157
+ ```bash
158
+ python -m WaLSAlib._vendor.softg.train --help
159
+ python -m WaLSAlib._vendor.softg.predict --help
160
+ ```
161
+
162
+ ## Contributing
163
+
164
+ See [CONTRIBUTING.md](https://github.com/WaLSAteam/WaLSAlib/blob/main/CONTRIBUTING.md) for development and validation requirements, and the [release guide](https://github.com/WaLSAteam/WaLSAlib/blob/main/docs/release.md) for publishing instructions.
165
+
166
+ ## Citation
167
+
168
+ The primary reference for WaLSAlib and LineFit is:
169
+
170
+ Jafarzadeh, S., Jess, D. B., Stangalini, M., et al. (2026). *Frontiers in Astronomy and Space Sciences*, **13**, 1843842. [doi:10.3389/fspas.2026.1843842](https://doi.org/10.3389/fspas.2026.1843842).
171
+
172
+ Please cite this paper when using WaLSAlib or LineFit in research. The software archive is available on [Zenodo](https://doi.org/10.5281/zenodo.23043078).
173
+
174
+ For analyses using SoFT, also cite [Berretti et al. (2025)](https://doi.org/10.1051/0004-6361/202452665). For SoFTg, cite Berretti et al. (2026); see the [upstream project](https://github.com/mib-unitn/SoFTg) for bibliographic details.
175
+
176
+ ## License
177
+
178
+ WaLSAlib code is licensed under Apache-2.0 (see LICENSE). SoFT and SoFTg are licensed under GPLv3. **The combined distribution must be redistributed in compliance with GPLv3**, while retaining the Apache notices for the native code. The SPDX expression `Apache-2.0 AND GPL-3.0-only` records both sets of obligations; it is not a choice of licenses. See [THIRD_PARTY_NOTICES.md](https://github.com/WaLSAteam/WaLSAlib/blob/main/THIRD_PARTY_NOTICES.md) for provenance and adaptation details.
@@ -0,0 +1,118 @@
1
+ <div style="display: block; margin-bottom: 20px;">
2
+ <img align="left" src="https://raw.githubusercontent.com/WaLSAteam/WaLSAlib/main/docs/images/WaLSAlib_logo.svg" alt="WaLSAlib" width="400" height="auto">
3
+ </div>
4
+
5
+ <br><br><br>
6
+
7
+ # WaLSAlib &ndash; WaLSA Library of Auxiliary Routines
8
+ <p align="left">
9
+ <a href="#"><img src="https://img.shields.io/badge/WaLSAlib-v1.1.0-0066cc"></a>
10
+ <a href="https://walsa.team" target="_blank"><img src="https://img.shields.io/badge/powered%20by-WaLSA%20Team-000d1a"></a>
11
+ <a href="#"><img src="https://img.shields.io/badge/license-Apache%202.0%20%2B%20GPLv3-green"></a>
12
+ <a href="https://doi.org/10.5281/zenodo.23043078"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.23043078-blue.svg" alt="DOI">
13
+ </a>
14
+ </p>
15
+
16
+ **WaLSAlib** is a companion repository to [**WaLSAtools**](https://github.com/WaLSAteam/WaLSAtools), collecting practical workflow routines developed within the WaLSA Team to prepare *analysis-ready* products and time series for wave/oscillation studies (and related diagnostics). The focus here is on upstream and auxiliary steps that often sit between calibrated observations and the actual wave analysis.
17
+
18
+ WaLSAlib and its LineFit module are introduced in [Jafarzadeh et al. (2026)](https://doi.org/10.3389/fspas.2026.1843842), *Frontiers in Astronomy and Space Sciences*.
19
+
20
+ ## Scope and philosophy
21
+ Many routines in WaLSAlib are motivated by (and initially developed for) **Solar Physics** use cases — e.g., spectroscopy/spectro-polarimetry and time-series imaging — although they may be useful more broadly.
22
+
23
+ ## Included modules
24
+
25
+ - **LineFit**: adaptive multi-line spectral fitting, line-core intensities, and LOS velocities.
26
+ - **SoFT**: solar feature detection, association, and tabulation, maintained independently at [mib-unitn/SoFT](https://github.com/mib-unitn/SoFT).
27
+ - **SoFTg**: classical granule segmentation and optional UNet++ training/inference, maintained independently at [mib-unitn/SoFTg](https://github.com/mib-unitn/SoFTg).
28
+
29
+ SoFT and SoFTg are bundled with WaLSAlib. See [upstream components](https://github.com/WaLSAteam/WaLSAlib/blob/main/docs/upstream.md) for source versions and maintenance instructions.
30
+
31
+ ## Relationship to WaLSAtools
32
+ - **WaLSAlib**: spectral fitting, magnetic feature tracking, and granule segmentation
33
+ - **WaLSAtools**: wave and oscillation analysis methods (FFT/Welch, wavelets, cross-spectra, significance, etc.)
34
+
35
+ ## Installation
36
+
37
+ Python 3.10 or newer is required. Install the package with:
38
+
39
+ ```bash
40
+ pip install WaLSAlib
41
+ ```
42
+
43
+ To install from a source checkout:
44
+
45
+ ```bash
46
+ pip install .
47
+ # For development:
48
+ pip install -e '.[test,build]'
49
+ ```
50
+
51
+ The base installation includes LineFit, SoFT tracking, and classical SoFTg segmentation.
52
+
53
+ ## Quick start
54
+
55
+ ```python
56
+ from WaLSAlib import LineFit, SoFT, SoFTg
57
+ ```
58
+
59
+ ### Spectral line fitting
60
+
61
+ `LineFit` accepts a spectrum or a sequence of spectra, a wavelength axis, rest wavelengths, and line labels:
62
+
63
+ ```python
64
+ velocity, intensity = LineFit(
65
+ spectra,
66
+ wavelengths=wavelengths,
67
+ refwavelength=rest_wavelengths,
68
+ element=line_labels,
69
+ )
70
+ ```
71
+
72
+ Wavelengths are expressed in nm and velocities in km/s. `linefit` is also available as an alias for `LineFit`. See the [LineFit examples](https://github.com/WaLSAteam/WaLSAlib/tree/main/examples/LineFit_Frontiers) for data preparation, fitting, and analysis workflows.
73
+
74
+ ### Solar feature tracking
75
+
76
+ For a two-dimensional magnetogram, specify a detection threshold in the image's intensity units:
77
+
78
+ ```python
79
+ labels = SoFT.detection(magnetogram, l_thr=20, sign="pos")
80
+ labels = SoFT.identification(labels, min_size=4)
81
+ ```
82
+
83
+ `SoFT.track_all(...)` runs detection, association, and tabulation on a FITS sequence. Supply a dedicated working directory containing `00-data/`, with a trailing path separator. Each run replaces the contents of `01-mask/`, `02-id/`, and `03-assoc/`. Optional SunPy and EMD analysis functions are available through `SoFT.extras`.
84
+
85
+ ### Granule segmentation
86
+
87
+ For a two-dimensional continuum image, specify the plate scale in km per pixel:
88
+
89
+ ```python
90
+ granules, seeds, skeleton = SoFTg.segment_solar_granules(
91
+ continuum_image, plate_scale=50
92
+ )
93
+ ```
94
+
95
+ The UNet++ workflows use user-supplied training data and model checkpoints. Install the `softg` extra to access `SoFTg.model`, `SoFTg.predict`, and `SoFTg.train`:
96
+
97
+ ```bash
98
+ python -m WaLSAlib._vendor.softg.train --help
99
+ python -m WaLSAlib._vendor.softg.predict --help
100
+ ```
101
+
102
+ ## Contributing
103
+
104
+ See [CONTRIBUTING.md](https://github.com/WaLSAteam/WaLSAlib/blob/main/CONTRIBUTING.md) for development and validation requirements, and the [release guide](https://github.com/WaLSAteam/WaLSAlib/blob/main/docs/release.md) for publishing instructions.
105
+
106
+ ## Citation
107
+
108
+ The primary reference for WaLSAlib and LineFit is:
109
+
110
+ Jafarzadeh, S., Jess, D. B., Stangalini, M., et al. (2026). *Frontiers in Astronomy and Space Sciences*, **13**, 1843842. [doi:10.3389/fspas.2026.1843842](https://doi.org/10.3389/fspas.2026.1843842).
111
+
112
+ Please cite this paper when using WaLSAlib or LineFit in research. The software archive is available on [Zenodo](https://doi.org/10.5281/zenodo.23043078).
113
+
114
+ For analyses using SoFT, also cite [Berretti et al. (2025)](https://doi.org/10.1051/0004-6361/202452665). For SoFTg, cite Berretti et al. (2026); see the [upstream project](https://github.com/mib-unitn/SoFTg) for bibliographic details.
115
+
116
+ ## License
117
+
118
+ WaLSAlib code is licensed under Apache-2.0 (see LICENSE). SoFT and SoFTg are licensed under GPLv3. **The combined distribution must be redistributed in compliance with GPLv3**, while retaining the Apache notices for the native code. The SPDX expression `Apache-2.0 AND GPL-3.0-only` records both sets of obligations; it is not a choice of licenses. See [THIRD_PARTY_NOTICES.md](https://github.com/WaLSAteam/WaLSAlib/blob/main/THIRD_PARTY_NOTICES.md) for provenance and adaptation details.
@@ -0,0 +1,26 @@
1
+ # Third-party source and distribution terms
2
+
3
+ WaLSAlib's own source, build tools, and tests are licensed under Apache-2.0; see LICENSE. Bundled SoFT and SoFTg sources are licensed under GNU GPL v3.
4
+
5
+ | Component | Author / source | License | Source snapshot |
6
+ | --- | --- | --- | --- |
7
+ | SoFT | Michele Berretti and upstream contributors, https://github.com/mib-unitn/SoFT | GNU GPL v3 | vendor/SoFT |
8
+ | SoFTg | Michele Berretti and upstream contributors, https://github.com/mib-unitn/SoFTg | GNU GPL v3 | vendor/SoFTg |
9
+
10
+ Exact commit IDs, selected files, and SHA-256 hashes are recorded in `vendor/upstream-lock.json`. Upstream licenses, READMEs, and dependency declarations accompany the snapshots. The metadata uses `GPL-3.0-only` because the repository-level licenses do not explicitly grant an "or later" option.
11
+
12
+ The combined distribution must comply with GPLv3, including provision of corresponding source and retention of the Apache notices for WaLSAlib files. The SPDX expression `Apache-2.0 AND GPL-3.0-only` records both sets of obligations. See the [Apache Software Foundation's compatibility explanation](https://www.apache.org/licenses/GPL-compatibility.html).
13
+
14
+ The source distribution includes the upstream snapshots, runtime sources, adapter generator, dependency declarations, and build instructions. Distribute the wheel and source archive together and retain all applicable license and attribution notices.
15
+
16
+ ## Runtime adaptations
17
+
18
+ The WaLSAlib 1.1.0 runtime adaptations, dated 2026-11-27, are generated by `tools/sync_upstreams.py` under `src/WaLSAlib/_vendor`:
19
+
20
+ - Package-relative imports for bundled sibling modules.
21
+ - Minimal private package initializers.
22
+ - Python-based cleanup of non-symlink directories `temp0` through `temp9` in the SoFT tracking working directory.
23
+
24
+ The reference upstream sources are stored in `vendor/`. Public wrapper modules outside `_vendor` are WaLSAlib source.
25
+
26
+ Dependency packages and user-supplied model weights retain their own licenses.