PyLASP: Python Refactor of the LAMOST Atmospheric Parameter Pipeline (LASP)
Jun-Chao Liang
This entry archives the PyLASP code, which refactors the LAMOST Atmospheric Parameter Pipeline (LASP) from IDL to Python, enabling simultaneous inference of radial velocity, effective temperature, surface gravity, and metallicity. During parameter inference, PyLASP convolves model spectra with a Gaussian broadening kernel to automatically match the resolution of observed spectra and applies multiplicative polynomials to absorb large-scale shape differences, thus removing the need to manually align model and observed spectra resolutions before inference. The code repository is available at https://github.com/LiangJunC/PyLASP.

PyLASP provides two inference methods: LASP-CurveFit, designed for fast inference on single or small batches of spectra, and LASP-Adam-GPU, intended for large-scale data with GPU-accelerated parallel optimization based on PyTorch. Both methods support No Clean and Clean strategies; the latter automatically masks anomalous pixels based on the residuals between the model and observed spectra, preventing them from biasing the parameter inference and thereby improving robustness for spectra with low S/N or anomalous features. The current version applies to optical spectra covering 3900–6800 Å with a typical resolution of R<10,000.

PyLASP requires Python 3.9 or above, along with dependencies such as NumPy, SciPy, Astropy, Pandas, Matplotlib, tqdm, joblib, and filelock. For GPU support, PyTorch and a compatible CUDA driver are additionally required. Run pip install -e . in the PyLASP root directory to install all dependencies and set up the environment. Usage examples can be found in PyLASP/tutorial.ipynb, which demonstrate complete workflows for LASP-CurveFit and LASP-Adam-GPU under both No Clean and Clean strategies. In this version, English code comments have been added, and code redundancy has been reduced.

PyLASP is released under the GNU General Public License v3.0, consistent with the GitHub repository. When citing, please use the DOI of this code archive and also cite the companion paper “Scalable Stellar Parameter Inference Using Python-based LASP: From CPU Optimization to GPU Acceleration.” 

Code contributor: Jun-Chao Liang.
Files
.. PyLASP.zip
12.27 MB
..
Paper Information
Paper Title:
Scalable Stellar Parameter Inference Using Python-based LASP: From CPU Optimization to GPU Acceleration
Publication:
ApJ
Identifiers
CSTR:
11379.11.101748
DOI:
10.12149/101748
VO Identifier:
ivo://China-VO/paperdata/101748
Publication Date:
2026-01-01
Usage Statistics
Total Downloads
9
Citations
Jun-Chao Liang et al. 2026. PyLASP: Python Refactor of the LAMOST Atmospheric Parameter Pipeline (LASP). Version 2.0. https://doi.org/10.12149/101748
@misc{10.12149/101748,
doi = {10.12149/101748},
url = {https://doi.org/10.12149/101748},
author = {Jun-Chao Liang},
title = {PyLASP: Python Refactor of the LAMOST Atmospheric Parameter Pipeline (LASP)},
version = {2.0},
publisher = {Nataional Astronomical Data Center of China},
year= {2026}
}
Versions
Version 2.0 (current)
2026-01-01
Main
This DOI represents all versions, and will always resolve to the latest one.
2025-10-01