PyLASP: Python Refactor of the LAMOST Atmospheric Parameter Pipeline (LASP)
Junchao 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/uly_tgm_alone/tutorial_LASP_CurveFit.ipynb and PyLASP/uly_tgm_group/tutorial_LASP_Adam_GPU.ipynb, which demonstrate complete workflows for LASP-CurveFit and LASP-Adam-GPU under both No Clean and Clean strategies. 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
Paper Information
Paper Title:
Scalable Stellar Parameter Inference Using Python-Based LASP: From CPU Optimization to GPU Acceleration
Publication:
ApJ
Identifiers
CSTR:
11379.11.101679
DOI:
10.12149/101679
VO Identifier:
ivo://China-VO/paperdata/101679
Publication Date:
2025-10-01
Usage Statistics
Total Downloads
45
Citations
Junchao Liang et al. 2025. PyLASP: Python Refactor of the LAMOST Atmospheric Parameter Pipeline (LASP). Version 1.0. https://doi.org/10.12149/101679
@misc{10.12149/101679,
doi = {10.12149/101679},
url = {https://doi.org/10.12149/101679},
author = {Junchao Liang},
title = {PyLASP: Python Refactor of the LAMOST Atmospheric Parameter Pipeline (LASP)},
version = {1.0},
publisher = {Nataional Astronomical Data Center of China},
year= {2025}
}
doi = {10.12149/101679},
url = {https://doi.org/10.12149/101679},
author = {Junchao Liang},
title = {PyLASP: Python Refactor of the LAMOST Atmospheric Parameter Pipeline (LASP)},
version = {1.0},
publisher = {Nataional Astronomical Data Center of China},
year= {2025}
}
Versions
Main
This DOI represents all versions, and will always resolve to the latest one.
2025-10-01