Skip to content

Commit

Permalink
Update example notebook for observability heatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
HealthyPear committed Oct 31, 2024
1 parent 69c538b commit fd3fa1e
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion docs/source/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
" source_detection,\n",
" calculate,\n",
")\n",
"from iact_estimator.observability import define_constraints, get_days_in_this_year\n",
"from iact_estimator.plots import (\n",
" plot_spectrum,\n",
" plot_sed,\n",
" plot_transit,\n",
" plot_altitude_airmass,\n",
" create_observability_heatmap,\n",
")"
]
},
Expand Down Expand Up @@ -242,7 +244,36 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"constraints = define_constraints(config)\n",
"\n",
"start_datetime = (\n",
" Time(config[\"observation\"][\"start_datetime\"])\n",
" if config[\"observation\"][\"start_datetime\"] is not None\n",
" else Time(datetime.now(tz=observer.timezone))\n",
")\n",
"year_days = get_days_in_this_year()\n",
"end_datetime = (\n",
" Time(config[\"observation\"][\"end_datetime\"])\n",
" if config[\"observation\"][\"end_datetime\"] is not None\n",
" else start_datetime + year_days\n",
")\n",
"\n",
"create_observability_heatmap(\n",
" target_source,\n",
" observer,\n",
" constraints,\n",
" start_datetime,\n",
" end_datetime,\n",
" time_resolution=1 * u.hour,\n",
" cmap=\"YlGnBu\",\n",
" sns_plotting_context=\"paper\",\n",
" sns_axes_style=\"whitegrid\",\n",
" savefig=True,\n",
" output_path=None,\n",
" save_format=\"png\",\n",
")"
]
}
],
"metadata": {
Expand Down

0 comments on commit fd3fa1e

Please sign in to comment.