Skip to content

DESI Software

DESI uses standard file formats such as FITS, HDF5, JSON, YAML, and CSV such that no DESI-specific software is required to be able to read and use DESI data.

At the same time, all DESI data processing code is open source at https://github.com/desihub as a reference for the underlying algorithms and to provide convenience utilities for understanding DESI targeting bits (desitarget), reading and manipulating DESI spectra formats (desispec), and working with redshifts and spectral classifications (redrock).

The following instructions are provided as reference for those who wish to use the DESI software to simplify working with key aspects of the DESI data model. Most users may not need to install the complete software suite to work with DESI data.

Installing DESI Software

To install these packages on a local machine, you will need a Python environment with a set of 3rd party libraries, plus some DESI code and example data.

  1. Install miniforge or anaconda

  2. Create a DESI environment with the required packages

    conda create --name desi 'numpy<2' scipy 'astropy<7' ipython jupyter \
            matplotlib numba pytest fitsio h5py healpy requests
    conda activate desi
    
  3. Install the DESI-specific packages

    pip install git+https://github.com/desihub/desiutil@3.5.0
    pip install git+https://github.com/desihub/desitarget@2.9.0
    pip install git+https://github.com/desihub/desispec@0.69.0
    pip install git+https://github.com/desihub/desimodel@0.19.3
    install_desimodel_data
    pip install git+https://github.com/desihub/redrock.git@0.20.4
    install_redrock_templates
    

    NOTE: To get the absolute latest versions, you can replace those tag X.Y.Z numbers with “main”. If you previously installed main and want to update it again, use pip install --force-reinstall ....

  4. Some utilities additionally require $DESI_ROOT to be set to the path where you have a local copy of the data, equivalent to the root directory for a data release such at https://data.desi.lbl.gov/public/dr1, e.g. export DESI_ROOT=/path/to/desi/data.

  5. See https://github.com/desihub/tutorials for tutorials on how to download a subset of DESI data, understand their formats, and use these packages as convenience tools to read and analyze these data.

Note

There are many more DESI packages used to generate the DESI data. Additional packages, datasets, and environment variables are needed to fully use every function of these packages, but the above is sufficient to read and interpret the redshift catalogs, spectra, and coadd files as shown in the tutorials.

Tip

If you make a mistake during installation and want to start over, you can remove the conda environment via:

conda remove --name desi --all --yes

Data Release Software

The software used to generate each data release is documented as part of that release: EDR, DR1. However, DESI software packages are backwards compatible with files written by earlier versions, and it is generally recommended to use the latest set of tags for analysis purposes.

Again, we emphasize that no DESI-specific software is required to be able to read and use DESI data using standard tools such as astropy, fitsio, and numpy (or non-Python options too). The above software packages are provides as a convenience but are not required.