Example on NERSCΒΆ

First, create your legacysim directory and copy/link the legacy survey data:

mkdir -p ${CSCRATCH}/legacysim/dr9/data/
cp /global/cfs/cdirs/cosmo/data/legacysurvey/dr9/ccds-annotated-* ${CSCRATCH}/legacysim/dr9/data/
cp /global/cfs/cdirs/cosmo/data/legacysurvey/dr9/survey-* ${CSCRATCH}/legacysim/dr9/data/
ln -s /global/cfs/cdirs/cosmo/data/legacysurvey/dr9/calib/ ${CSCRATCH}/legacysim/dr9/data/
ln -s /global/cfs/cdirs/cosmo/work/legacysurvey/dr9/images/ ${CSCRATCH}/legacysim/dr9/data/

Next, clone the legacysim repo and pull the docker image (see Building):

cd
git clone https://github.com/adematti/legacysim.git
shifterimg -v pull adematti/legacysim:DR9

Note

legacysim executable is in the Docker image. In the following we just use bin.

Enter your shifter image, generate catalog of sources to be injected (see Pre-processing):

shifter --volume ${HOME}:/homedir/ --image=adematti/legacysim:DR9 /bin/bash
cd legacysim/bin
source legacypipe-env.sh
python preprocess.py --do injected

Create run list, taking into account legacypipe versions used for bricks in $LEGACYPIPE_SURVEY_DIR/north/ (see Running):

python /src/legacysim/py/legacysim/scripts/runlist.py --outdir $LEGACYPIPE_SURVEY_DIR/north/ --brick bricklist.txt --write-list runlist.txt --modules docker

Exit the shifter image and run legacysim (see Running):

exit
srun -n 2 shifter --module=mpich-cle6 --volume ${HOME}:/homedir/ --image=adematti/legacysim:DR9 ./mpi_runbricks.sh

Check everything ran, match, plot the comparison (see Post-processing):

shifter --volume ${HOME}:/homedir/ --image=adematti/legacysim:DR9 /bin/bash
python /src/legacysim/py/legacysim/scripts/check.py --outdir ${CSCRATCH}/legacysim/dr9/test --list runlist.txt
python /src/legacysim/py/legacysim/scripts/match.py --cat-dir ${CSCRATCH}/legacysim/dr9/test/merged --outdir ${CSCRATCH}/legacysim/dr9/test --plot-hist plots/hist.png

You can also merge catalogs, plot cpu and memory usage, image cutouts:

python /src/legacysim/py/legacysim/scripts/merge.py --filetype tractor --cat-dir ${CSCRATCH}/legacysim/dr9/test/merged --outdir ${CSCRATCH}/legacysim/dr9/test
python /src/legacysim/py/legacysim/scripts/resources.py --outdir ${CSCRATCH}/legacysim/dr9/test --plot-fn plots/resources-summary.png
python /src/legacysim/py/legacysim/scripts/cutout.py --outdir ${CSCRATCH}/legacysim/dr9/test --plot-fn "plots/cutout_%(brickname)s-%(icut)d.png" --ncuts 2