Operations Simulator (OpSim) Docker Image
What is OpSim?
The Operations Simulator is an astronomical survey simulator that has been developed for the LSST to understand how to optimize the LSST survey strategy by simulating sequences of observations or visits (i.e. pairs of 15 second exposures). To accomplish this, the simulator takes as an input a description of the configuration of the LSST system including its dynamical and mechanical properties (e.g. the slew time, dome acceleration, readout time for the camera, filter exchange time etc), a simplified model for the weather (based on 10 years of historical records from the Cerro Tololo Inter-American Observatory), a model for the sky brightness, and series of observing proposals, each of which defines the values of parameters that tune the scheduler algorithms to deliver an efficient observing sequence in accordance with science requirements.
How to start an OpSim instance
docker run -it --name OpSim lsst/opsim
This will start an interactive bash shell in the directory /home/opsim/runs with all of the appropriate environment variables set and the mysql daemon running. In the working directory there are the following directories:
- log directory for logging output from the simulator
- output directory for post-processing output of simulator runs
All further references to directories and command executions will assume you are in the /home/opsim/runs directory.
How to run OpSim
Note: The configuration files provided in the /home/opsim/conf directory by default set OpSim to perform a 10 year simulation with the baseline cadence configuration. To limit the length of the simulation edit /home/opsim/conf/survey/LSST.conf and change to nRun = 0.009 (for a 3 day run) for a short test run. If you wish to switch configurations to another available from here, run git checkout SHA1 in the /home/opsim/conf where SHA1 corresponds to the commit on the branch that you want to use.
opsim.py --track=no --config=/home/opsim/conf/survey/LSST.conf --startup_comment="Some Comment"
The simulator will output a set of log information into the log directory in a file called lsst.log_<SessionID> and another set to standard out. For record-keeping, it is a good idea to capture this information. One can do so by redirecting the output to a log file in the log directory.
More information about the operations simulator can be found here.
Post-processing an OpSim run
In order to run MAF on a simulator run, it is necessary to perform the post-processing step in order to produce a SQLite DB file. The command for the post-processing is
where the <SessionID> is the number associated with the simulator run. This value can be found from the standard out log information or the most recent log/lsst.log_<SessionID> filename. Among the results of running the above command is output/<hostname>_<SessionID>_sqlite.db. This is the file that MAF can then be run on.
To persist the OpSim database
Exiting will not remove the OpSim container and the associated data (deleting the container will cause the results of all OpSim runs to be lost). To re-enter the container (e.g. to run another simulation)
docker start -i OpSim