From e16864b9d95e32b8a4c7f9684458c56bb774100c Mon Sep 17 00:00:00 2001 From: Peter Yoachim Date: Fri, 1 Dec 2023 16:24:27 -0800 Subject: [PATCH] example dropping some cuts --- scheduler/pointings_example.ipynb | 223 +++++++++++++++++++++++++++++- 1 file changed, 218 insertions(+), 5 deletions(-) diff --git a/scheduler/pointings_example.ipynb b/scheduler/pointings_example.ipynb index eaa550b..579ddc4 100644 --- a/scheduler/pointings_example.ipynb +++ b/scheduler/pointings_example.ipynb @@ -213,9 +213,9 @@ "name": "stderr", "output_type": "stream", "text": [ - "/Users/yoachim/git_repos/rubin_scheduler/rubin_scheduler/scheduler/surveys/pointings_survey.py:203: RuntimeWarning: divide by zero encountered in divide\n", + "/Users/yoachim/git_repos/rubin_scheduler/rubin_scheduler/scheduler/surveys/pointings_survey.py:210: RuntimeWarning: divide by zero encountered in divide\n", " result = np.floor(1.0 + self.n_obs / sum_obs)\n", - "/Users/yoachim/git_repos/rubin_scheduler/rubin_scheduler/scheduler/surveys/pointings_survey.py:203: RuntimeWarning: invalid value encountered in divide\n", + "/Users/yoachim/git_repos/rubin_scheduler/rubin_scheduler/scheduler/surveys/pointings_survey.py:210: RuntimeWarning: invalid value encountered in divide\n", " result = np.floor(1.0 + self.n_obs / sum_obs)\n" ] }, @@ -299,7 +299,7 @@ "data": { "text/markdown": [ "CoreScheduler(\n", - " surveys=[[]],\n", + " surveys=[[]],\n", " camera=\"LSST\",\n", " nside=32,\n", " rotator_limits=array([1.48352986, 4.79965544]),\n", @@ -309,7 +309,7 @@ ], "text/plain": [ "CoreScheduler(\n", - " surveys=[[]],\n", + " surveys=[[]],\n", " camera=\"LSST\",\n", " nside=32,\n", " rotator_limits=array([1.48352986, 4.79965544]),\n", @@ -587,9 +587,222 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "901ad52c-8e6f-4fbb-85be-fc5990bf7ee5", "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "-rw-r--r-- 1 yoachim staff 3.9M Dec 4 10:17 save_test.pkl\n" + ] + } + ], + "source": [ + "# Say we want to lift the m5 and moon limits. Just remove them from the weights dict\n", + "weights = {\"visit_gap\": 1.0, \"balance_revisit\": 1.0, \"slew_time\": -1.0,\n", + " \"wind_limit\": 0.0, \"ha_limit\": 0, \"alt_limit\": 0}\n", + "ps = PointingsSurvey(obs, detailers=[], weights=weights)\n", + "sched = CoreScheduler([ps])\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "e6058702-572b-4f1e-a361-5ef59370c504", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/yoachim/git_repos/rubin_scheduler/rubin_scheduler/scheduler/surveys/pointings_survey.py:210: RuntimeWarning: divide by zero encountered in divide\n", + " result = np.floor(1.0 + self.n_obs / sum_obs)\n", + "/Users/yoachim/git_repos/rubin_scheduler/rubin_scheduler/scheduler/surveys/pointings_survey.py:210: RuntimeWarning: invalid value encountered in divide\n", + " result = np.floor(1.0 + self.n_obs / sum_obs)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "progress = 65.27%" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/yoachim/git_repos/rubin_scheduler/rubin_scheduler/skybrightness_pre/sky_model_pre.py:280: UserWarning: Requested MJD between sunrise and sunset, returning closest maps\n", + " warnings.warn(\"Requested MJD between sunrise and sunset, returning closest maps\")\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "progress = 100.00%Skipped 0 observations\n", + "Flushed 0 observations from queue for being stale\n", + "Completed 1884 observations\n", + "ran in 0 min = 0.0 hours\n" + ] + } + ], + "source": [ + "mo = ModelObservatory()\n", + "mo, sched, completed_obs = sim_runner(mo, sched, survey_length=3)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "f46f1ff3-d9af-4119-bed5-84a7904958f7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
methodblankfeasiblemax_rewardn_possiblesweightmax_accum_rewardaccum_n
0visit_gapNoneTrue0.0000007761.00.000000776
1balance_revisitNoneTrue1.0000007991.01.000000776
2slew_timeNoneTrue-3.978996313-1.0-3.017308290
3wind_limitNoneTrue0.0000007990.0-3.017308290
4ha_limitNoneTrue0.0000001320.0-3.017308109
5alt_limitNoneTrue0.0000003130.0-3.017308109
\n", + "
" + ], + "text/plain": [ + " method blank feasible max_reward n_possibles weight \\\n", + "0 visit_gap None True 0.000000 776 1.0 \n", + "1 balance_revisit None True 1.000000 799 1.0 \n", + "2 slew_time None True -3.978996 313 -1.0 \n", + "3 wind_limit None True 0.000000 799 0.0 \n", + "4 ha_limit None True 0.000000 132 0.0 \n", + "5 alt_limit None True 0.000000 313 0.0 \n", + "\n", + " max_accum_reward accum_n \n", + "0 0.000000 776 \n", + "1 1.000000 776 \n", + "2 -3.017308 290 \n", + "3 -3.017308 290 \n", + "4 -3.017308 109 \n", + "5 -3.017308 109 " + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "conditions = mo.return_conditions()\n", + "sched.survey_lists[0][0].make_reward_df(conditions)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fe6cf877-d028-49f0-b7ff-63f557fd2507", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83f375d6-f9ec-4f8e-9828-cf6b15a4fdcc", + "metadata": {}, "outputs": [], "source": [] }