Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit dbea37c

Browse files
author
Leanne Guy
committed
WIP
1 parent 21ccba3 commit dbea37c

2 files changed

Lines changed: 35 additions & 22 deletions

File tree

08a_Interactive_Image_Visualization.ipynb

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Last verified to run on <b>2021-09-17</b> with LSST Science Pipelines release <b>w_2021_33</b> <br>\n",
1111
"Contact authors: Leanne Guy <br>\n",
1212
"Target audience: All DP0 delegates. <br>\n",
13-
"Container Size: medium or large <br>\n",
13+
"Minimum Container Size: medium <br>\n",
1414
"Questions welcome at <a href=\"https://community.lsst.org/c/support/dp0\">community.lsst.org/c/support/dp0</a> <br>\n",
1515
"Find DP0 documentation and resources at <a href=\"https://dp0-1.lsst.io\">dp0-1.lsst.io</a> <br>"
1616
]
@@ -110,10 +110,9 @@
110110
"metadata": {},
111111
"outputs": [],
112112
"source": [
113-
"# Prevent some helpful but ancillary warning messages from printing\n",
114-
"# during some LSST DM Release calls\n",
115-
"warnings.simplefilter(\"ignore\", category=FutureWarning)\n",
116-
"warnings.simplefilter(\"ignore\", category=UserWarning)"
113+
"# Ignore warnings\n",
114+
"import warnings\n",
115+
"warnings.simplefilter(\"ignore\", category='UnitsWarning')"
117116
]
118117
},
119118
{
@@ -166,7 +165,17 @@
166165
"calexpId = {'visit': 192350, 'detector': 175, 'band': 'i'}\n",
167166
"calexp = butler.get('calexp', **calexpId)\n",
168167
"assert calexp is not None\n",
169-
"# Source table for this exposure\n",
168+
"# 'physical_filter': 'HSC-R'\n",
169+
"f\"Visit: {calexp.visitInfo.getExposureId()}, Band:{calexp.getFilterLabel().bandLabel}, Detector: {calexp.detector.getId()}\""
170+
]
171+
},
172+
{
173+
"cell_type": "code",
174+
"execution_count": null,
175+
"metadata": {},
176+
"outputs": [],
177+
"source": [
178+
"# Source table for this calexp exposure\n",
170179
"calexpSrc = butler.get('src', **calexpId)"
171180
]
172181
},
@@ -179,7 +188,15 @@
179188
"# Define a deep coadded image and retrieve it via the Butler\n",
180189
"coaddId = {'tract': 4226, 'patch': 17, 'band': 'r'}\n",
181190
"coadd = butler.get('deepCoadd', **coaddId)\n",
182-
"assert coadd is not None\n",
191+
"assert coadd is not None"
192+
]
193+
},
194+
{
195+
"cell_type": "code",
196+
"execution_count": null,
197+
"metadata": {},
198+
"outputs": [],
199+
"source": [
183200
"# Source table for this coadd\n",
184201
"coaddSrc = butler.get('deepCoadd_forced_src', coaddId)"
185202
]
@@ -257,7 +274,7 @@
257274
"outputs": [],
258275
"source": [
259276
"# Define some default plot options for the Image\n",
260-
"img_opts = dict(height=400, width=500, \n",
277+
"img_opts = dict(height=600, width=700, \n",
261278
" xaxis=\"bottom\", \n",
262279
" padding = 0.01, fontsize={'title': '8pt'},\n",
263280
" colorbar=True, toolbar='right', show_grid=True,\n",

08b_Interactive_Catalog_Visualization.ipynb

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Last verified to run on <b>2021-10-05</b> with LSST Science Pipelines release <b>w_2021_33</b> <br>\n",
1111
"Contact authors: Leanne Guy <br>\n",
1212
"Target audience: All DP0 delegates. <br>\n",
13-
"Container Size: medium or large <br>\n",
13+
"Minimum Container Size: medium <br>\n",
1414
"Questions welcome at <a href=\"https://community.lsst.org/c/support/dp0\">community.lsst.org/c/support/dp0</a> <br>\n",
1515
"Find DP0 documentation and resources at <a href=\"https://dp0-1.lsst.io\">dp0-1.lsst.io</a> <br>"
1616
]
@@ -71,7 +71,7 @@
7171
"from astropy.units.quantity import Quantity\n",
7272
"\n",
7373
"# LSST imports\n",
74-
"from rubin_jupyter_utils.lab.notebook import get_tap_service\n",
74+
"from lsst.rsp import get_tap_service\n",
7575
"\n",
7676
"# Bokeh and Holoviews for visualization\n",
7777
"import bokeh\n",
@@ -123,10 +123,9 @@
123123
"metadata": {},
124124
"outputs": [],
125125
"source": [
126-
"# Prevent some helpful but ancillary warning messages from printing\n",
127-
"# during some LSST DM Release calls\n",
128-
"warnings.simplefilter(\"ignore\", category=FutureWarning)\n",
129-
"warnings.simplefilter(\"ignore\", category=UserWarning)"
126+
"# Ignore warnings\n",
127+
"import warnings\n",
128+
"warnings.simplefilter(\"ignore\", category='UnitsWarning')"
130129
]
131130
},
132131
{
@@ -269,7 +268,7 @@
269268
"metadata": {},
270269
"outputs": [],
271270
"source": [
272-
"assert len(data) == 23155236"
271+
"# assert len(data) == 23155236"
273272
]
274273
},
275274
{
@@ -416,8 +415,6 @@
416415
"\n",
417416
"# Construct a layout using the `+` operator\n",
418417
"skyplots = skyplot + \\\n",
419-
" skyplot[52.75:60.07, -42.71:-38.95].opts(\n",
420-
" title=\"Skyplot region\", tools=[]) + \\\n",
421418
" ra_distribution.options(height=350, width=350)"
422419
]
423420
},
@@ -434,7 +431,7 @@
434431
"cell_type": "markdown",
435432
"metadata": {},
436433
"source": [
437-
"A few things to note about these three plots. The first two are the same plot, with the second one plotting only a subset of the data. When you zooom in on either of these two plots, they will both change in the same manner. The third plot is a different plot object and is not linked to the other two. It will not change in response to actions on either of the first two. Try zooming in on the RA distribution plot, you will notice that the data are not rebinned and that the two skyplots do not change. This is because the plots are not linked. We will see how to link plots in Section 3."
434+
"Note that these two plots are not linked, they are two independent plots layed out next to each other. Try zooming in on the skyplot, you will notice that the data are not rebinned in the RA Distribution plot. We will see how to link plots in Section 3. The tools however do apply to both plots. Try modifying both plots and the used the `reset` tool. Notice that both plots are reset to their original states. "
438435
]
439436
},
440437
{
@@ -564,7 +561,7 @@
564561
"outputs": [],
565562
"source": [
566563
"%%opts Scatter [tools=['hover'], toolbar='above',height=400, width=400](color='grey')\n",
567-
"hv.Scatter(data20K).opts(alpha=0.2, size=2)"
564+
"hv.Scatter(data20K).opts(alpha=0.3, size=3)"
568565
]
569566
},
570567
{
@@ -898,7 +895,6 @@
898895
"p = dynspread(datashade(points, cmap=\"Viridis\"))\n",
899896
"p = p.opts(width=800, height=300,\n",
900897
" padding=0.05, show_grid=True,\n",
901-
" #xlim=(-2.0, 3.0), ylim=(-2.0, 3.0),\n",
902898
" xlim=(-8.0, 18.0), ylim=(-18.0, 8.0),\n",
903899
" xlabel=\"(g-r)\", ylabel=\"(r-i)\")"
904900
]
@@ -1036,7 +1032,7 @@
10361032
" return np.log(x) if x > 0 else 0\n",
10371033
"\n",
10381034
"\n",
1039-
"def update_histogram(bounds=bounds) ->hv.Histogram:\n",
1035+
"def update_histogram(bounds=bounds) -> hv.Histogram:\n",
10401036
" selection = (ds.data['ra'] > bounds[0]) & \\\n",
10411037
" (ds.data['dec'] > bounds[1]) & \\\n",
10421038
" (ds.data['ra'] < bounds[2]) & \\\n",
@@ -1087,7 +1083,7 @@
10871083
"\n",
10881084
" 1. Holoviews works with a wide range of plotting libraries, Bokeh, matplotlib, plotly, mpld3, pygal to name a few. As an exercise, try changing the Holoviews plotting library to be `matplotlib` instead of `bokeh` in the `Setup` cell at the beginning of the notebook with `hv.extension('matplotlib')`. You will see the holoviews + matplotlib icons displayed when the library is loaded successfully. Run the cells in section 2.1 again and compare the outputs. Try again with some other plotting library. Don't forget to set the plotting library back to whichever you prefer to use for the rest of this tutorial.\n",
10891085
" \n",
1090-
" 2. Try writing a different callback function to use in section 6.2. "
1086+
" 2. Try writing a different callback function to use in section 5.2. "
10911087
]
10921088
}
10931089
],

0 commit comments

Comments
 (0)