Skip to content

Commit

Permalink
Follow desidatamodel's env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyzt committed Jun 8, 2024
1 parent 9cba54e commit 94f3501
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ if [ -z "$DESI_RELEASE" ]; then
export DESI_RELEASE=edr
fi
DESI_RELEASE=${DESI_RELEASE,,}

# Set environment variables as per
# https://desidatamodel.readthedocs.io/en/latest/
echo "+ Set \$DESI_ROOT to the $DESI_RELEASE release."
export DESI_ROOT=$DESI_DATA/$DESI_RELEASE
export DESI_RAW=$DESI_DATA/raw_spectro_data
export DESI_TARGET=$DESI_DATA/target

# used by the desispec library
export DESI_SPECTRO_DATA=$DESI_DATA/raw_spectro_data
export DESI_SPECTRO_REDUX=$DESI_ROOT/spectro/redux
export DESI_SPECTRO_CALIB=$DESI_ROOT/spectro/desi_spectro_calib
export DESI_TARGET=$DESI_DATA/target

# Symlink to NERSC-like directories
ln -s $DESI_ROOT/spectro $DESI_NERSC/spectro
ln -s $DESI_ROOT/survey $DESI_NERSC/survey
ln -s $DESI_TARGET $DESI_NERSC/target
Expand Down
6 changes: 3 additions & 3 deletions welcome.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
" * `$DESI_ROOT` points to **~/desidata/edr** unless you specified another `$DESI_RELEASE` when running this container.\n",
"* Unlike at NERSC, raw spectrographic and targeting data that are shared across data releases\n",
" have been moved their own directories, outside the releases themselves.\n",
" * `$DESI_RAW` points to **~/desidata/raw_spectro_data**, corresponding to `$DESI_ROOT/spectro/data` at NERSC.\n",
" * `$DESI_SPECTRO_DATA` points to **~/desidata/raw_spectro_data**, corresponding to `$DESI_ROOT/spectro/data` at NERSC.\n",
" * `$DESI_TARGET` points to **~/desidata/target**, corresponding to `$DESI_ROOT/target` at NERSC.\n",
"* Example code for analyzing the data can be found at **~/tutorials**.\n",
"* Pipeline code for processing the data are installed at **~/desihub**.\n",
Expand Down Expand Up @@ -471,7 +471,7 @@
"source": [
"### Relocated raw spectroscopic and targeting data\n",
"\n",
"Because they have significant duplicates across data releases, raw spectroscopic data have been relocated from `$DESI_ROOT/spectro/data` to **~/desihub/raw_spectro_data** (`$DESI_RAW`), and targeting data have been removed from `$DESI_ROOT/target` to **~/desihub/target** (`$DESI_TARGET`). They can be accessed like so:"
"Because they have significant duplicates across data releases, raw spectroscopic data have been relocated from `$DESI_ROOT/spectro/data` to **~/desihub/raw_spectro_data** (`$DESI_SPECTRO_DATA`), and targeting data have been removed from `$DESI_ROOT/target` to **~/desihub/target** (`$DESI_TARGET`). They can be accessed like so:"
]
},
{
Expand Down Expand Up @@ -502,7 +502,7 @@
}
],
"source": [
"fits_path = os.path.expandvars(\"$DESI_RAW/20200201/00045677/gfa-00045677.fits.fz\")\n",
"fits_path = os.path.expandvars(\"$DESI_SPECTRO_DATA/20200201/00045677/gfa-00045677.fits.fz\")\n",
"hdul = fits.open(fits_path)\n",
"hdul.info()"
]
Expand Down

0 comments on commit 94f3501

Please sign in to comment.