"MCALF: Multi-Component Atmospheric Line Fitting"
Project description
MCALF is an open-source Python package for accurately constraining velocity information from spectral imaging observations using machine learning techniques.
This software package is intended to be used by solar physicists trying to extract line-of-sight (LOS) Doppler velocity information from spectral imaging observations (Stokes I measurements) of the Sun. A ‘toolkit’ is provided that can be used to define a spectral model optimised for a particular dataset.
This package is particularly suited for extracting velocity information from spectral imaging observations where the individual spectra can contain multiple spectral components. Such multiple components are typically present when active solar phenomenon occur within an isolated region of the solar disk. Spectra within such a region will often have a large emission component superimposed on top of the underlying absorption spectral profile from the quiescent solar atmosphere.
A sample model is provided for an IBIS Ca II 8542 Å spectral imaging sunspot dataset. This dataset typically contains spectra with multiple atmospheric components and this package supports the isolation of the individual components such that velocity information can be constrained for each component. Using this sample model, as well as the separate base (template) model it is built upon, a custom model can easily be built for a specific dataset.
The custom model can be designed to take into account the spectral shape of each particular spectrum in the dataset. By training a neural network classifier using a sample of spectra from the dataset labelled with their spectral shapes, the spectral shape of any spectrum in the dataset can be found. The fitting algorithm can then be adjusted for each spectrum based on the particular spectral shape the neural network assigned it.
This package is designed to run in parallel over large data cubes, as well as in serial. As each spectrum is processed in isolation, this package scales very well across many processor cores. Numerous functions are provided to plot the results in a clearly. The MCALF API also contains many useful functions which have the potential of being integrated into other Python packages.
Installation
For easier package management we recommend using Miniconda (or Anaconda) and creating a new conda environment to install MCALF inside. To install MCALF using Miniconda, run the following commands in your system’s command prompt, or if you are using Windows, in the ‘Anaconda Prompt’:
$ conda config --add channels conda-forge
$ conda config --set channel_priority strict
$ conda install mcalf
MCALF is updated to the latest version by running:
$ conda update mcalf
Alternatively, you can install MCALF using pip:
$ pip install mcalf
Testing
A test suite is included with the package. The package is tested on multiple platforms, however you may wish to run the tests on your system also. More details on running our tox/pytest test suite are available in our documentation.
Getting Started
Documentation is available here. Some examples are included here.
Contributing
If you find this package useful and have time to make it even better, you are very welcome to contribute to this package, regardless of how much prior experience you have. Types of ways you can contribute include, expanding the documentation with more use cases and examples, reporting bugs through the GitHub issue tracker, reviewing pull requests and the existing code, fixing bugs and implementing new features in the code. You are encouraged to submit any bug reports and pull requests directly to the GitHub repository.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Citation
If you have used this package in work that leads to a publication, we would be very grateful if you could acknowledge your use of this package in the main text of the publication. Please cite the following publications,
MacBride CD, Jess DB. 2021 MCALF: Multi-Component Atmospheric Line Fitting. Journal of Open Source Software. 6(61), 3265. (doi:10.21105/joss.03265)
MacBride CD, Jess DB, Grant SDT, Khomenko E, Keys PH, Stangalini M. 2020 Accurately constraining velocity information from spectral imaging observations using machine learning techniques. Philosophical Transactions of the Royal Society A. 379, 2190. (doi:10.1098/rsta.2020.0171)
Please also cite the Zenodo DOI for the package version you used. Please also consider integrating your code and examples into the package.
License
MCALF is licensed under the terms of the BSD 2-Clause license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file mcalf-1.0.0.tar.gz
.
File metadata
- Download URL: mcalf-1.0.0.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b33d53f1e87f458c4ab6015d8da7a4531daba8c2f995a725cbab13709dc6d773 |
|
MD5 | 3616e8631f16f52e7c1c976c7bf89f49 |
|
BLAKE2b-256 | d93f08e811f73630c8feb92069a8d80d4eb73b8e6efcecca053409b585f4a901 |
File details
Details for the file mcalf-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: mcalf-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b3be68544e69efbca6828d0bb6b0900e57ef59f7f505217fd78ef09ac9e95d0 |
|
MD5 | edcc9a0f088fc00e85ad69211a2bfdae |
|
BLAKE2b-256 | 2adf2ca670ffae718d15cf99852a95ad871170672c0b2e2db36760103d16b253 |
File details
Details for the file mcalf-1.0.0-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: mcalf-1.0.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc8eb600e57e80f0a971d0c1d5d233d4cf830d7d6c43425a37da312750d61419 |
|
MD5 | 363325e28f0f0ddbabb7563ceaf7c437 |
|
BLAKE2b-256 | 62dd1b7dea4ad43235af87587d20277eb2945af03d6dff8a9ab536c23e3ff5aa |
File details
Details for the file mcalf-1.0.0-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: mcalf-1.0.0-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b405dca20c67756879085696102a845ef98e7af4c75b923c8a4a32482f45761 |
|
MD5 | 1b50770d77b5b74c87a55776abe6a17f |
|
BLAKE2b-256 | a77a9889c804cde9f1082d1e2188e130ce4020eb66a236bac6b2e36c2eea2563 |
File details
Details for the file mcalf-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: mcalf-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18255f3054d0db7595c9de4be4c617ffd2d44934d0cdb3ccd4b3a791e3e44e0e |
|
MD5 | b86e35df3d3e3d02ba42b4469916cfdc |
|
BLAKE2b-256 | 8861c289cd1278ef8f2d2d393d446c7f8e236bee2e83414e01ea1d68101329ef |
File details
Details for the file mcalf-1.0.0-cp38-abi3-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: mcalf-1.0.0-cp38-abi3-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.8+, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bf8a7c7ec92b9453c3cc2a9fbf621806e7257dd95d938a67b6b3b2a5b379e22 |
|
MD5 | 3e0f50b9385c07f8acbda957887c8dbe |
|
BLAKE2b-256 | 2a39755fddaa3bb713d68526350debaf85b9ceddbd3ed94d2e76fc50df27f37d |