Skip to main content
WaLSAlib




WaLSAlib – WaLSA Library of Auxiliary Routines

DOI PyPI Latest Release

WaLSAlib is a companion repository to 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.

WaLSAlib and its LineFit module are introduced in Jafarzadeh et al. (2026), Frontiers in Astronomy and Space Sciences.


⭐ If you find WaLSAlib useful, please consider giving it a star (click the ⭐ at the top right of this page).
It helps others discover the project and supports the growth of an open, cross-disciplinary wave analysis community.

🔔 To stay updated on new releases and features, click “Watch → Custom → Releases” at the top of the page.


Scope and philosophy

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.

Included modules

  • LineFit: adaptive multi-line spectral fitting, line-core intensities, and LOS velocities.
  • SoFT: solar feature detection, association, and tabulation, maintained independently at mib-unitn/SoFT.
  • SoFTg: classical granule segmentation and optional UNet++ training/inference, maintained independently at mib-unitn/SoFTg.

SoFT and SoFTg are bundled with WaLSAlib. See upstream components for source versions and maintenance instructions.

Relationship to WaLSAtools

  • WaLSAlib: spectral fitting, magnetic feature tracking, and granule segmentation
  • WaLSAtools: wave and oscillation analysis methods (FFT/Welch, wavelets, cross-spectra, significance, etc.)

Installation

Python 3.10 or newer is required. Install the package with:

pip install WaLSAlib

To install from a source checkout:

pip install .
# For development:
pip install -e '.[test,build]'

The base installation includes LineFit, SoFT tracking, and classical SoFTg segmentation.

Quick start

from WaLSAlib import LineFit, SoFT, SoFTg

The three public names accept any capitalization, for example:

from WaLSAlib import Linefit, soft, softg

These aliases refer to the same fitting function and tracking namespaces. The package name is WaLSAlib; dotted submodule imports and function argument names follow their documented spelling.

Spectral line fitting

LineFit accepts a spectrum or a sequence of spectra, a wavelength axis, rest wavelengths, and line labels:

velocity, intensity = LineFit(
    spectra,
    wavelengths=wavelengths,
    refwavelength=rest_wavelengths,
    element=line_labels,
)

Wavelengths are expressed in nm and velocities in km/s. linefit is also available as an alias for LineFit. See the LineFit examples for data preparation, fitting, and analysis workflows.

Solar feature tracking

For a two-dimensional magnetogram, specify a detection threshold in the image's intensity units:

labels = SoFT.detection(magnetogram, l_thr=20, sign="pos")
labels = SoFT.identification(labels, min_size=4)

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.

Granule segmentation

For a two-dimensional continuum image, specify the plate scale in km per pixel:

granules, seeds, skeleton = SoFTg.segment_solar_granules(
    continuum_image, plate_scale=50
)

The UNet++ workflows use user-supplied training data and model checkpoints. Install the softg extra to access SoFTg.model, SoFTg.predict, and SoFTg.train:

python -m WaLSAlib._vendor.softg.train --help
python -m WaLSAlib._vendor.softg.predict --help

Contributing

See CONTRIBUTING.md for development and validation requirements, and the release guide for publishing instructions.

Citation

The primary reference for WaLSAlib and LineFit is:

Jafarzadeh, S., Jess, D. B., Stangalini, M., et al. (2026). Frontiers in Astronomy and Space Sciences, 13, 1843842. doi:10.3389/fspas.2026.1843842.

Please cite this paper when using WaLSAlib or LineFit in research. The software archive is available on Zenodo.

For analyses using SoFT, also cite Berretti et al. (2025). For SoFTg, cite Berretti et al. (2026); see the upstream project for bibliographic details.

License

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 for provenance and adaptation details.

Metadata

Release files for WaLSAlib 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for WaLSAlib 1.1.1
File Size Uploaded Provenance Actions
walsalib-1.1.1.tar.gz 154.2 kB With provenance Details for walsalib-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for WaLSAlib 1.1.1
File Interpreter ABI Platform Actions
walsalib-1.1.1-py3-none-any.whl Python 3 none any Details for walsalib-1.1.1-py3-none-any.whl

Total release size: 254.5 kB

Release files / walsalib-1.1.1.tar.gz

Download URL walsalib-1.1.1.tar.gz
Size 154.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4222cc1b9084f659acabdb62b6103b6cc5e16fcac9c780ed37af13f87e12c545
BLAKE2b-256 checksum
How to use checksums
b72dbf3578a22b3cb0f0b442a328075b6d0bfaa5d97f225a5f91dfe779968d17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / walsalib-1.1.1-py3-none-any.whl

Download URL walsalib-1.1.1-py3-none-any.whl
Size 100.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e842e9f122784ecc4f3d4fc2a34b187d1edc2e3d9b4404826f4a3bbec4fa4f38
BLAKE2b-256 checksum
How to use checksums
fcea08b44f94eaeb4b385a6a5e1bc3fe7c6680b13fc96ea3c84beb6e5701e82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for WaLSAlib 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for walsalib-1.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page