It is recommended to use Miniforge for managing your Python environment: https://conda-forge.org/download/
Alternatively, you can also use conda, miniconda or any other environment manager.
Use the provided environment file. You can edit it to include more packages or change the environment name.
mamba create -f environment.yaml
mamba activate <environment_name>If you choose not to use conda, ensure that all packages listed in environment.yaml are installed by other means, as they are required dependencies.
pip install PyAstronomy pysme-astroFrom the root directory of this repository, run:
pip install -e .This installs the package in editable mode, so any changes to the source code are immediately reflected without reinstalling.
The VALD linelists and the example FEROS spectra are large and are not tracked in this repository. They are attached to the data-v1 release. Download the archives and unzip them at the root of this repository:
unzip vald_linelists.zip # required
unzip feros_spectra.zip # only needed to run the tutorial notebooksThis gives:
vald_linelists/
├── linelist_solar_0.001_350-900nm # required: default solar linelist
├── Gaia RVS/ # optional: per-element and stellar linelists
└── HIRES/ # optional: per-element and stellar linelists
feros_spectra/ # spectra, fit segments and grids used by the notebooks
linelist_solar_0.001_350-900nm is required: it is loaded when pysme_wrapper is imported, which raises a FileNotFoundError without it. The Gaia RVS and HIRES folders are only needed if you use those linelists (e.g. with merge_stellar_linelists and merge_element_linelists).
To keep the linelists elsewhere (or if you did not install with pip install -e .), set the PYSME_WRAPPER_LINELISTS environment variable to the folder's path:
export PYSME_WRAPPER_LINELISTS=/path/to/vald_linelistsFor the typical workflow used with pymse-wrapper, see the pysme_wrapper_tutorial.ipynb notebook.
For PySME documentation, see https://pysme-astro.readthedocs.io/en/stable/. pysme-wrapper creates helper classes and functions to streamline workflow based on my experience with noisy FEROS spectra, so it is quite possible you will want to use "pure" pysme instead of the wrapper at some point.