|
19 | 19 | "id": "1a3d4bff-443a-4cb9-9342-09f059bed6df", |
20 | 20 | "metadata": {}, |
21 | 21 | "source": [ |
22 | | - "# Run simulation for {params.day_obs} " |
| 22 | + "# Run simulation for {{ params.day_obs }} for {{ params.sim_nights }} nights." |
23 | 23 | ] |
24 | 24 | }, |
25 | 25 | { |
|
123 | 123 | "if ts_config_scheduler_root is None:\n", |
124 | 124 | " # Just make a new clone for ts_config_scheduler in a temporary directory\n", |
125 | 125 | " import tempfile\n", |
126 | | - " ts_config_scheduler_root = tempfile.mkdtemp()\n", |
| 126 | + " tmpdir = tempfile.mkdtemp()\n", |
| 127 | + " ts_config_scheduler_root = os.path.join(tmpdir, \"ts_config_scheduler\")\n", |
127 | 128 | " ts_config_is_temp = True\n", |
128 | 129 | " do_git_stuff = True\n", |
129 | 130 | "else:\n", |
|
190 | 191 | "#%load_ext memory_profiler" |
191 | 192 | ] |
192 | 193 | }, |
| 194 | + { |
| 195 | + "cell_type": "code", |
| 196 | + "execution_count": null, |
| 197 | + "id": "52639da3-457d-4bc2-8dd8-f0a06b59f526", |
| 198 | + "metadata": {}, |
| 199 | + "outputs": [], |
| 200 | + "source": [ |
| 201 | + "day_obs = int(day_obs)\n", |
| 202 | + "sim_nights = int(sim_nights)" |
| 203 | + ] |
| 204 | + }, |
193 | 205 | { |
194 | 206 | "cell_type": "code", |
195 | 207 | "execution_count": null, |
|
273 | 285 | "metadata": {}, |
274 | 286 | "outputs": [], |
275 | 287 | "source": [ |
276 | | - "# Some configuration information ... I'm not sure whether we can/will use this at present.\n", |
| 288 | + "# # Some configuration information ... I'm not sure whether we can/will use this at present.\n", |
277 | 289 | "\n", |
278 | | - "# run branch\n", |
279 | | - "q = endpoints['obsenv'].select_top_n(\"lsst.obsenv.run_branch\", ['branch_name'], 1, time_cut=sunset)\n", |
280 | | - "q2 = endpoints['obsenv'].select_time_series(\"lsst.obsenv.run_branch\", [\"branch_name\"], sunset, sunrise)\n", |
281 | | - "runbranch = pd.concat([q, q2])\n", |
282 | | - "display(runbranch)\n", |
283 | | - "current_runbranch = runbranch.branch_name.iloc[-1]\n", |
284 | | - "print(f\"Current run branch {current_runbranch}\")\n", |
285 | | - "# configuration information\n", |
286 | | - "q = endpoints['efd'].select_top_n('lsst.sal.Scheduler.logevent_configurationApplied', [\"configurations\", \"salIndex\", \"private_origin\", \"url\", \"version\"], 1, time_cut=sunset, index=1)\n", |
287 | | - "q2 = endpoints['efd'].select_time_series('lsst.sal.Scheduler.logevent_configurationApplied', [\"configurations\", \"salIndex\", \"private_origin\", \"url\", \"version\"], sunset, sunrise, index=1)\n", |
288 | | - "q = pd.concat([q, q2])\n", |
289 | | - "def strip_repo(x: pd.Series):\n", |
290 | | - " return x.url.split(\"/\")[-3]\n", |
291 | | - "def strip_version(x: pd.Series):\n", |
292 | | - " return x.version.replace(\"heads/\", \"\")\n", |
293 | | - "def strip_yaml(x: pd.Series):\n", |
294 | | - " return x.configurations.split(\",\")[-1]\n", |
295 | | - "config_repo = q.apply(strip_repo, axis=1)\n", |
296 | | - "config_version = q.apply(strip_version, axis=1)\n", |
297 | | - "config_yaml = q.apply(strip_yaml, axis=1)\n", |
298 | | - "configs = pd.DataFrame([config_repo, config_version, config_yaml], columns=q.index, index=['config_repo', 'config_commit', 'config_yaml']).T\n", |
299 | | - "current_commit = config_version.iloc[0]\n", |
300 | | - "display(configs)\n", |
301 | | - "print(f\"Current commit {current_commit}\")" |
| 290 | + "# # run branch\n", |
| 291 | + "# q = endpoints['obsenv'].select_top_n(\"lsst.obsenv.run_branch\", ['branch_name'], 1, time_cut=sunset)\n", |
| 292 | + "# q2 = endpoints['obsenv'].select_time_series(\"lsst.obsenv.run_branch\", [\"branch_name\"], sunset, sunrise)\n", |
| 293 | + "# runbranch = pd.concat([q, q2])\n", |
| 294 | + "# display(runbranch)\n", |
| 295 | + "# current_runbranch = runbranch.branch_name.iloc[-1]\n", |
| 296 | + "# print(f\"Current run branch {current_runbranch}\")\n", |
| 297 | + "# # configuration information\n", |
| 298 | + "# q = endpoints['efd'].select_top_n('lsst.sal.Scheduler.logevent_configurationApplied', [\"configurations\", \"salIndex\", \"private_origin\", \"url\", \"version\"], 1, time_cut=sunset, index=1)\n", |
| 299 | + "# q2 = endpoints['efd'].select_time_series('lsst.sal.Scheduler.logevent_configurationApplied', [\"configurations\", \"salIndex\", \"private_origin\", \"url\", \"version\"], sunset, sunrise, index=1)\n", |
| 300 | + "# q = pd.concat([q, q2])\n", |
| 301 | + "# def strip_repo(x: pd.Series):\n", |
| 302 | + "# return x.url.split(\"/\")[-3]\n", |
| 303 | + "# def strip_version(x: pd.Series):\n", |
| 304 | + "# return x.version.replace(\"heads/\", \"\")\n", |
| 305 | + "# def strip_yaml(x: pd.Series):\n", |
| 306 | + "# return x.configurations.split(\",\")[-1]\n", |
| 307 | + "# config_repo = q.apply(strip_repo, axis=1)\n", |
| 308 | + "# config_version = q.apply(strip_version, axis=1)\n", |
| 309 | + "# config_yaml = q.apply(strip_yaml, axis=1)\n", |
| 310 | + "# configs = pd.DataFrame([config_repo, config_version, config_yaml], columns=q.index, index=['config_repo', 'config_commit', 'config_yaml']).T\n", |
| 311 | + "# current_commit = config_version.iloc[0]\n", |
| 312 | + "# display(configs)\n", |
| 313 | + "# print(f\"Current commit {current_commit}\")" |
302 | 314 | ] |
303 | 315 | }, |
304 | 316 | { |
|
383 | 395 | " except FileNotFoundError:\n", |
384 | 396 | " toos = None\n", |
385 | 397 | "\n", |
386 | | - "print(f\"Retrieved {len(toos)} ToOs\")\n", |
387 | | - "# Wrap up ToOs for sim target server - only last currently relevant\n", |
388 | | - "too_server = SimTargetooServer(toos)" |
| 398 | + "if toos is not None:\n", |
| 399 | + " print(f\"Retrieved {len(toos)} ToOs\")\n", |
| 400 | + " # Wrap up ToOs for sim target server \n", |
| 401 | + " too_server = SimTargetooServer(toos)\n", |
| 402 | + "else:\n", |
| 403 | + " print(\"No ToO information\")\n", |
| 404 | + " too_server = None" |
389 | 405 | ] |
390 | 406 | }, |
391 | 407 | { |
|
456 | 472 | "source": [ |
457 | 473 | "if ts_config_is_temp:\n", |
458 | 474 | " import shutil\n", |
459 | | - " shutil.rmtree(ts_config_scheduler_root)" |
| 475 | + " shutil.rmtree(tmpdir)" |
460 | 476 | ] |
461 | 477 | }, |
462 | 478 | { |
|
1008 | 1024 | " if vnvis['all'].metric_values is not None:\n", |
1009 | 1025 | " mval = vnvis['all'].metric_values\n", |
1010 | 1026 | " vmax = np.percentile(mval.compressed(), 95)\n", |
| 1027 | + " alpha = np.where(np.isnan(background), 0, background)\n", |
| 1028 | + " alpha = np.where(alpha> 0.5, 0.5, alpha)\n", |
| 1029 | + " alpha = np.where(mval.filled(0) > 0, 1, alpha)\n", |
1011 | 1030 | " plot.hp_moll(mval.filled(0), alpha=alpha, vmin=0, vmax=vmax, label='Consdb night')" |
1012 | 1031 | ] |
1013 | 1032 | }, |
|
0 commit comments