Skip to content

Commit

Permalink
Updated demo notebook: example/Demo_make_simlibs.ipynb
Browse files Browse the repository at this point in the history
- demo notebook updated for the latest version
- correct small typo
- correct last typo
- update version

Fix version number before release
  • Loading branch information
Catarina-Alves authored and Rahul Bswas committed Mar 14, 2022
1 parent befb2fd commit cce606a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 32 deletions.
55 changes: 24 additions & 31 deletions example/Demo_make_simlibs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"The following commands can be run from the terminal or from a notebook.\n",
"\n",
"## Index<a name=\"index\"></a>\n",
"* [Options](#options)\n",
"* [Example of usage](#usage)\n",
"1. [Options](#options)\n",
"2. [Example of usage](#usage)\n",
" 1. [Download the desired file](#download)\n",
" * [Set up options](#chooseOptions)\n",
" * [Run the script](#run)\n",
" * [Output](#output)\n",
" 2. [Set up options](#chooseOptions)\n",
" 3. [Run the script](#run)\n",
" 4. [Output](#output)\n",
"\n",
"## Options<a name=\"options\"></a>\n",
"\n",
Expand All @@ -42,22 +42,22 @@
"\n",
"### 1. Download the desired file<a name=\"download\"></a>\n",
"\n",
"In this example, we will download the `baseline_v1.4_10yrs.db` file from [here](https://lsst-web.ncsa.illinois.edu/sim-data/) via the use of the nix Command Line `curl` tool. After downloaded, I will move it to the Downloads folder in order to showcase some more options of `make_simlibs`.\n",
"In this example, we will download the `baseline_v2.0_10yrs.db` file from [here](https://epyc.astro.washington.edu/~lynnej/opsim_downloads/) via the use of the nix Command Line `curl` tool. After downloaded, I will move it to the Downloads folder in order to showcase some more options of `make_simlibs`.\n",
"\n",
"```shell\n",
"curl -O https://lsst.ncsa.illinois.edu/sim-data/sims_featureScheduler_runs1.4/baseline/baseline_v1.4_10yrs.db\n",
"curl -O https://epyc.astro.washington.edu/~lynnej/opsim_downloads/fbs_2.0/baseline/baseline_v2.0_10yrs.db\n",
"\n",
"mv baseline_v1.4_10yrs.db ${HOME}/Downloads/\n",
"mv baseline_v2.0_10yrs.db ${HOME}/Downloads/\n",
"\n",
"# The database file is now in ${HOME}/Downloads/baseline_v1.4_10yrs.db\n",
"# The database file is now in ${HOME}/Downloads/baseline_v2.0_10yrs.db\n",
"```\n",
"\n",
"### 2. Set up options<a name=\"chooseOptions\"></a>\n",
"\n",
"- `data_root` $\\rightarrow$ path to the directory containing `dbname`. In this case the package is in `${HOME}`.\n",
"- `dbname` $\\rightarrow$ relative path to the OpSim DataBase file from `data_root`. In this case it is `Downloads/baseline_v1.4_10yrs.db`. (This could have also been done as `data_root` $\\rightarrow$ `${HOME}/Downloads` and `dbname` $\\rightarrow$ `baseline_v1.4_10yrs.db` as used below.)\n",
"- `dbname` $\\rightarrow$ relative path to the OpSim DataBase file from `data_root`. In this case it is `Downloads/baseline_v2.0_10yrs.db`. (This could have also been done as `data_root` $\\rightarrow$ `${HOME}/Downloads` and `dbname` $\\rightarrow$ `baseline_v2.0_10yrs.db` as used below.)\n",
"\n",
"- `opsimversion` $\\rightarrow$ version of opsim used. Here we used `fbsv1p3`.\n",
"- `opsimversion` $\\rightarrow$ version of opsim used. Here we used `fbsv2`.\n",
"\n",
"If no `ddf_simlibfilename` and `wfd_simlibfilename` paths are given, the generated files will be output in the current working directory given by `PWD`.\n",
"\n",
Expand All @@ -72,7 +72,7 @@
"We can then run the script\n",
"\n",
"```shell\n",
"python make_simlibs.py --data_root /Users/user_name/Downloads --dbname baseline_v1.4_10yrs.db --opsimversion 'fbsv1p3'\n",
"make_simlibs.py --dbname baseline_v2.0_10yrs.db --data_root /Users/user_name/Downloads --opsimversion fbsv2\n",
"```\n",
"\n",
"All the above following commands can be run from the terminal but they can also be run from a notebook by adding `!` before the command. Ex:"
Expand All @@ -93,16 +93,16 @@
"source": [
"#### Alternatives\n",
"\n",
"The `make_simlibs` script prints several messages while running, and can take some time to run. Hence, it is often convenient to run in the background, and store the output in a log file. Naming the log file `simlib_v1.4.log`, the command to run the script then becames:\n",
"The `make_simlibs` script prints several messages while running, and can take some time to run. Hence, it is often convenient to run in the background, and store the output in a log file. Naming the log file `simlib_v2.0.log`, the command to run the script then becames:\n",
"\n",
"```shell\n",
"python make_simlibs.py --data_root /Users/user_name/Downloads --dbname baseline_v1.4_10yrs.db --opsimversion 'fbsv1p3' > simlib_v1.4.log 2>&1 &\n",
"python make_simlibs.py --dbname baseline_v2.0_10yrs.db --data_root /Users/user_name/Downloads --opsimversion fbsv2 > simlib_v2.0.log 2>&1 &\n",
"```\n",
"\n",
"If you want to leave this running on a remote machine\n",
"\n",
"```shell\n",
"nice nohup python make_simlibs.py --data_root /Users/user_name/Downloads --dbname baseline_v1.4_10yrs.db --opsimversion 'fbsv1p3' > simlib_v1.4.log 2>&1 &\n",
"nice nohup python make_simlibs.py --dbname baseline_v2.0_10yrs.db --data_root /Users/user_name/Downloads --opsimversion fbsv2 > simlib_v2.0.log 2>&1 &\n",
"```\n",
"should do the job.\n",
"\n",
Expand All @@ -112,15 +112,15 @@
"Using the above command, the output files will be in the `~/OpSimSummary/scripts` folder.\n",
"\n",
"The files generated are:\n",
"- `baseline_v1.4_10yrs_DDF.simlib`\n",
"- `baseline_v1.4_10yrs_DDF_avail.csv`\n",
"- `baseline_v1.4_10yrs_DDF_sel.csv`\n",
"- `baseline_v1.4_10yrs_WFD.simlib`\n",
"- `baseline_v1.4_10yrs_WFD_avail.csv`\n",
"- `baseline_v1.4_10yrs_WFD_sel.csv`\n",
"- `ddf_minion_1016_sqlite.csv`\n",
"- `simlib_v1.4.log`\n",
"- `wfd_minion_1016_sqlite.csv`\n",
"- `baseline_v2.0_10yrs_DDF.simlib`\n",
"- `baseline_v2.0_10yrs_DDF_avail.csv`\n",
"- `baseline_v2.0_10yrs_DDF_sel.csv`\n",
"- `baseline_v2.0_10yrs_WFD.simlib`\n",
"- `baseline_v2.0_10yrs_WFD_avail.csv`\n",
"- `baseline_v2.0_10yrs_WFD_sel.csv`\n",
"- `testingDDF`\n",
"- `simlib_v2.0.log`\n",
"- `testingWFD`\n",
"\n",
"\n",
"The files ending in `simlib` are the files that can be used as input to `SNANA`. If appropriate for the use, one can further using the `simlib_coadd` script of `SNANA`, which can coadd observations over time intervals to produce more compact simlib files that help `SNANA` generate faster simulations.\n",
Expand All @@ -130,13 +130,6 @@
"\n",
"Go to [Index](#index)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion opsimsummary/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__VERSION__ = "3.0.0.dev2"
__VERSION__ = "3.0.0"

0 comments on commit cce606a

Please sign in to comment.