Clone the repo¶
To download the DAP software and associated data, clone the GitHub repo by executing:
git clone https://github.com/sdss/mangadap.git
This will create a
mangadap directory in the current directory.
Although we try to keep the
master branch of the repository stable,
we recommend using the most recent tag. You can do so by executing:
cd mangadap ./checkout_current_tag
There is a distribution of the DAP that can be installed via pip, but we’re still working out the bugs.
Install Python 3¶
Install the DAP code¶
To install the DAP and ensure its dependencies are met, ensure your
at in the top-level
mangadap directory and run (preferred):
pip3 install -e .
This approach is preferred because it eases uninstalling the code:
pip3 uninstall sdss-mangadap
Alternatively, if you anticipate making changes to the DAP code, run:
python3 setup.py develop
To install only the DAP dependencies, run:
pip3 install -r requirements.txt
Test your installation¶
To test the installation, you can do one of the following:
Run the tests via the setup script:python3 setup.py test
Run the tests using pytest directly:cd mangadap/tests python3 -m pytest .
Some tests requires a set of “remote” data that are not located in
the repo for space considerations. Downloading the data used by these
tests currently requires SDSS Collaboration Access.
The link in the last sentence points to a description of how this
access is granted for Marvin using a
~\.netrc file. The DAP uses
~\.netrc file to authenticate access to the
data.sdss.org host for downloading the test data. Once you have
~\.netrc file, you can download the necessary test data and
rerun the tests to include usage of that data like this:
python3 download_test_data.py cd mangadap/tests python3 -m pytest .
Local Environment Setup¶
The DAP uses environmental variables to define the paths to specific data and other repositories. If these are not defined, warnings will be issued every time the DAP is installed or imported. The relevant environmental variables, their default, and their usage are provided below.
Version of the DRP, used for path construction
Root path for the reduced data
Version of the DAP, used for path construction
Root path for the analysis data
These environmental variables can be added to, e.g., your
.bash_profile file in your home directory or be included in a script
that is sourced when you want to run the DAP. The lines added to your
.bash_profile file could look something like this:
export MANGA_SPECTRO_REDUX=/Volumes/MaNGA/redux export MANGA_SPECTRO_ANALYSIS=/Volumes/MaNGA/analysis export MANGADRP_VER=v3_0_1 export MANGADAP_VER=3.0.0
The DAP checks that these variables are defined every time it is imported. If they are not, warnings are raised and the defaults are used.
Some of these same variables are defined by Marvin. It is possible to have both Marvin and the DAP point to the same directory, but beware that this may mean that some of the files get overwritten!
Two additional variables (
$MANGACORE_DIR) are used in a specific mode of survey-level execution of the DAP. However, this is a niche usage mode and is effectively never used. See Batch execution using automatically generated scripts.
The DAP expects to find the DRP
LOGRSSfiles in the directory
[PLATE]is the desired plate number. The
LOGRSSfiles are required if you want to properly account for Spatial Covariance. This path can be altered when executing the DAP.
The DAP expects to find/write data to
$MANGA_SPECTRO_ANALYSIS/$MANGADRP_VER/$MANGADAP_VER. This path can be altered when executing the DAP, but the directory structure below this used by the DAP to organize its outputs cannot be changed.
$MANGADAP_VERis only used to set the path names, not to select the specific version of the DAP that should be used. The version of the DAP used is always the one installed by your python environment.