SCOC-Science Collaborations Workshop: Metric Analysis Information (NOIRLab DataLab)

To help facilitate metric analysis of the LSST Operations Simulations outputs for participants of the SCOC workshop #1 happening this week, we have partnered with NOIRLab’s Community Science & Data Centre (CSDC), who have generously agreed to add the LSST MAF software packages and simulations outputs to their Astro Data Lab science platform.

This is really helpful – instead of installing and downloading software and simulations to your own computer, participants can simply test or run metrics in a Jupyter notebook on DataLab!

The instructions for accessing MAF through the DataLab’s Jupyterlab are as follows:

  1. Sign up for a DataLab account. If you need an account - please go to https://datalab.noao.edu/ and click ‘Signup’; please add a reference to “LSST Simulations” or “LSST MAF” in the comment box so they can track signups related to the workshop. If you already have an account, just sign in with your existing account.
  2. Under ‘Quick Start’ on the DataLab page choose “Launch a Jupyter Notebook”. This will launch you into Jupyterlab. There is also a large blue button at the bottom of the page to “Launch a Jupyter Notebook”.
  3. If you are not familiar with Jupyterlab, you may find one of the DataLab tutorials available as part of your account in the “notebooks-latest” directory to be helpful. “notebooks-latest” is a link to a read-only directory containing the most up-to-date notebooks from the Data Lab notebook repository. To make a writeable copy of this directory, open a Terminal and type “getlatest” at the prompt.
  4. To start a new notebook with the LSST Sims MAF software loaded, double click on the “LSST SIMS MAF” icon in the “Notebook” section of the “Launcher” tab. You should see “LSST SIMS MAF (Py3, w.2020.45)” listed as the kernel in the top right of the notebook next to the open circle. If you do not have a “Launcher” tab open, go to File -> New Launcher to open a new “Launcher” tab.
  5. You are now in a Jupyter notebook that has the LSST simulations packages loaded. Test your setup by trying to run “import lsst.sims.maf.db as db” in a cell. If this works you are now set up. If this does not work, check that the “LSST Sims MAF” kernel is selected. You will know if you’re not in the LSST SIMS MAF kernel because you will get an error message saying that the lsst module is not available. Once you are in the correct kernel, the MAF modules should import without error. If you still have problems, please seek help on the workshop slack channel #scoc2020
  6. If you would like to try some of the tutorial notebooks from sims_maf_contrib (https://github.com/LSST-nonproject/sims_maf_contrib/tree/master/tutorials), you can copy the notebooks into your home directory like so: (In a jupyterlab notebook)

%%bash

cp -r '/data0/lsst_stack/repos/sims_maf_contrib/tutorials/' .

You should then see a directory (in the left column of jupyterlab ) called ‘tutorials’ which contains a copy of the tutorial notebooks. You can run any of these – but please be sure to select the “LSST SIMS MAF” kernel (to the upper right next to the open circle) after opening the notebook.

I suggest starting with the “Introduction Notebook” – please update the line where you connect to the database from

opsdb = db.OpsimDatabase('baseline2018a.db')

to

opsdb = db.OpsimDatabase('/sims_maf/fbs_1.5/baseline/baseline_v1.5_10yrs.db')

  1. For hands-on help during the workshop (for getting setup or for more specific metric work), please ask on the workshop slack channel #scoc2020, or post on community.lsst.org in the Science / SurveyStrategy category to discuss and enlist help from a wider audience.
  2. When you are ready for more opsim outputs: the opsim databases are available on the DataLab science platform at:

/sims_maf/fbs_1.5 (for the 1.5 outputs) and

/sims_maf/fbs_1.6 (for the 1.6 outputs)

  1. *** An important note: ***

There is a bug in the DataLab setup and how it is interacting with the LSST software, that we haven’t solved yet, that causes notebook cells using “!” to escape to the shell to hang. However, using %%bash magic inside a notebook cell will work – so please use that, or some of the python ‘os’ module commands if you need to issue shell commands from a notebook.


If you have questions or need help during the workshop, please send a message on workshop Slack channel #scoc2020 or post on community.lsst.org to enlist help from a wider audience.


We hope the DataLab science platform is useful and can help people get working with MAF quickly.