Rascal: RANSAC Assisted Spectral CALibration
Rascal is a library for automated spectrometer wavelength calibration. It has been designed primarily for astrophysics applications, but should be usable with spectra captured from any similar spectrometer.
Given a set of peaks located in your spectrum, Rascal will attempt to determine a model for your spectrometer to convert between pixels and wavelengths.
Unlike other calibration methods, rascal does not require you to manually select lines in your spectrum. Ideally you should know approximate parameters about your system, namely:
- What arc lamp was used (e.g. Xe, Hg, Ar, CuNeAr)
- What the dispersion of your spectrometer is (i.e. angstroms/pixel)
- The spectral range of your system, and the starting wavelength
You don't need to know the dispersion and start wavelength exactly. Often this information is provided by the observatory, but if you don't know it, you can take a rough guess. The closer you are to the actual system settings, the more likely it is that Rascal will be able to solve the calibration. Blind calibration, where no parameters are known, is possible but challenging currently. If you don't know the lamp, you can try iterating over the various combinations of sources. Generally when you do get a correct fit, with most astronomical instruments the errors will be extremely low.
More background information can be referred to this arXiv article.
Dependencies
- Python 3.10 to 3.13
- kaleido>=1.1.0
- matplotlib>=3.10.6
- numpy>=2.2.6
- pynverse>=0.1.4.6
- scipy>=1.15.3
- tqdm>=4.67.1
Optional Dependencies
Installation
Instructions can be found here.
Reporting issues/feature requests
Please use the issue tracker to report any issues or support questions.
Getting started
The quickstart guide will show you how to reduce the example dataset.
Contributing Code/Documentation
If you are interested in contributing code to the project, thank you! For those unfamiliar with the process of contributing to an open-source project, you may want to read through Github’s own short informational section on how to submit a contribution or send me a message.
Style -- we use Ruff for linting and formatting, which you can easily set up using a pre-commit hook.
pip install pre-commit
pre-commit install
Disclaimer
We duplicate some of the relevant metadata, but we do not process the raw metadata. Some of the metadata this software creates contain full path to the files in your system, which most likely includes a user name on your machine. Please be advised it is your responsibility to be compliant with the privacy law(s) that you are oblidged to follow, and it is your responsibility to remove any metadata that may reveal personal information and/or provide information that can reveal any computing vulunerability.
Metadata
Release files for rascal 0.3.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rascal-0.3.11.tar.gz | 300.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rascal-0.3.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 601.7 kB
Release files / rascal-0.3.11.tar.gz
| Download URL | rascal-0.3.11.tar.gz |
|---|---|
| Size | 300.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5941581e81bfe4e41a61c18f1296197d37c3dc31370c13d883fa820105911674
|
|
BLAKE2b-256 checksum How to use checksums |
e358af8ab845131056dae48b7f87c21bd24beddd8690bc00244216e68ffb1377
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / rascal-0.3.11-py3-none-any.whl
| Download URL | rascal-0.3.11-py3-none-any.whl |
|---|---|
| Size | 300.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b8438899c4d68e671ff16aae147dfb0e5bd6fb244d31b4d2bde4e82005db67c
|
|
BLAKE2b-256 checksum How to use checksums |
3f2bd4a189ee709de7077f839be185f0f7f272943a500ed01b7af6b7b81ceee4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for rascal 0.3.11
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.