Python code to reduce data obtained with the SpeX spectrograph.
-
Setup your computer and install miniforge, if you haven't already.
Follow Steps 0-2 of the Astropy Workshop Setup instructions to install WSL (for Windows) and install conda with miniforge.
-
Make a
pyspextool_3.13conda environment with Python 3.13.conda create -n pyspextool_3.13 python=3.13 -
Activate the new environment
conda activate pyspextool_3.13 -
Install the
pyspextoolpackage from PyPI usingpip. This also installs the other Python packages thatpyspextooldepends upon.pip install pyspextool -
Install other Python packages
If you want to use Jupyter notebooks or other Python tools with
pyspextool, you need to install them in the new environment. For example:pip install jupyterlab
-
The Jupyter notebook tutorials are under
notebooks/for preupgraded and upgraded SpeX Prism, SXD, and LXD data. -
Follow the instructions above to download the test data which will be saved under
tests/test_data/. To get the data used by the Jupyter notebooks, clone the test_data repository.git clone git@github.com:pyspextool/test_data.gitThe raw and processed example data products are available under
tests/test_data/raw/andtests/test_data/processed/respectively. The data products include thecal(calibration data),proc(processed data), andqa(quality assurance plots). -
While users should be able to run the Jupyter notebook tutorials without changing the output paths, users are encouraged to move the data folder and rename the output paths. The default saving directory is
/test_pyspextool/test_data/processed/.
If you plan to contribute code to pyspextool, you should clone a fork of this repo.
You will also need pytest and the test data in order to run the tests.
-
Make your own fork of this repository.
-
Clone the fork to your computer.
-
Make and activate a dedicated virtual environment, ideally with Python 3.13.
-
Install and editable version of
pyspextooland install the extra packages needed for testing and developing. In thepyspextool/direcotry:pip install -e ".[test]" -
Setup and download the
test_data/submodulegit submodule update --init --recursive