Skip to content

Commit

Permalink
example dropping some cuts
Browse files Browse the repository at this point in the history
  • Loading branch information
yoachim committed Dec 4, 2023
1 parent 6a49391 commit e16864b
Showing 1 changed file with 218 additions and 5 deletions.
223 changes: 218 additions & 5 deletions scheduler/pointings_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down Expand Up @@ -299,7 +299,7 @@
"data": {
"text/markdown": [
"CoreScheduler(\n",
" surveys=[[<PointingsSurvey at 0x17a65ec90>]],\n",
" surveys=[[<PointingsSurvey at 0x1067babd0>]],\n",
" camera=\"LSST\",\n",
" nside=32,\n",
" rotator_limits=array([1.48352986, 4.79965544]),\n",
Expand All @@ -309,7 +309,7 @@
],
"text/plain": [
"CoreScheduler(\n",
" surveys=[[<PointingsSurvey at 0x17a65ec90>]],\n",
" surveys=[[<PointingsSurvey at 0x1067babd0>]],\n",
" camera=\"LSST\",\n",
" nside=32,\n",
" rotator_limits=array([1.48352986, 4.79965544]),\n",
Expand Down Expand Up @@ -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": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>method</th>\n",
" <th>blank</th>\n",
" <th>feasible</th>\n",
" <th>max_reward</th>\n",
" <th>n_possibles</th>\n",
" <th>weight</th>\n",
" <th>max_accum_reward</th>\n",
" <th>accum_n</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>visit_gap</td>\n",
" <td>None</td>\n",
" <td>True</td>\n",
" <td>0.000000</td>\n",
" <td>776</td>\n",
" <td>1.0</td>\n",
" <td>0.000000</td>\n",
" <td>776</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>balance_revisit</td>\n",
" <td>None</td>\n",
" <td>True</td>\n",
" <td>1.000000</td>\n",
" <td>799</td>\n",
" <td>1.0</td>\n",
" <td>1.000000</td>\n",
" <td>776</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>slew_time</td>\n",
" <td>None</td>\n",
" <td>True</td>\n",
" <td>-3.978996</td>\n",
" <td>313</td>\n",
" <td>-1.0</td>\n",
" <td>-3.017308</td>\n",
" <td>290</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>wind_limit</td>\n",
" <td>None</td>\n",
" <td>True</td>\n",
" <td>0.000000</td>\n",
" <td>799</td>\n",
" <td>0.0</td>\n",
" <td>-3.017308</td>\n",
" <td>290</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>ha_limit</td>\n",
" <td>None</td>\n",
" <td>True</td>\n",
" <td>0.000000</td>\n",
" <td>132</td>\n",
" <td>0.0</td>\n",
" <td>-3.017308</td>\n",
" <td>109</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>alt_limit</td>\n",
" <td>None</td>\n",
" <td>True</td>\n",
" <td>0.000000</td>\n",
" <td>313</td>\n",
" <td>0.0</td>\n",
" <td>-3.017308</td>\n",
" <td>109</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"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": []
}
Expand Down

0 comments on commit e16864b

Please sign in to comment.