|
112 | 112 | "source": [ |
113 | 113 | "# Ignore warnings\n", |
114 | 114 | "import warnings\n", |
115 | | - "warnings.simplefilter(\"ignore\", category='UnitsWarning')" |
| 115 | + "warnings.simplefilter(\"ignore\", category='UnitsWarning')\n", |
| 116 | + "warnings.simplefilter(\"ignore\", category=UserWarning)" |
116 | 117 | ] |
117 | 118 | }, |
118 | 119 | { |
|
163 | 164 | "source": [ |
164 | 165 | "# Define a calibrated exposure and retrieve it via the Butler\n", |
165 | 166 | "calexpId = {'visit': 192350, 'detector': 175, 'band': 'i'}\n", |
166 | | - "calexp = butler.get('calexp', **calexpId)\n", |
| 167 | + "calexp = butler.get('calexp', calexpId)\n", |
167 | 168 | "assert calexp is not None\n", |
168 | | - "# 'physical_filter': 'HSC-R'\n", |
169 | 169 | "f\"Visit: {calexp.visitInfo.getExposureId()}, Band:{calexp.getFilterLabel().bandLabel}, Detector: {calexp.detector.getId()}\"" |
170 | 170 | ] |
171 | 171 | }, |
|
187 | 187 | "source": [ |
188 | 188 | "# Define a deep coadded image and retrieve it via the Butler\n", |
189 | 189 | "coaddId = {'tract': 4226, 'patch': 17, 'band': 'r'}\n", |
190 | | - "coadd = butler.get('deepCoadd', **coaddId)\n", |
| 190 | + "coadd = butler.get('deepCoadd', coaddId)\n", |
191 | 191 | "assert coadd is not None" |
192 | 192 | ] |
193 | 193 | }, |
| 194 | + { |
| 195 | + "cell_type": "markdown", |
| 196 | + "metadata": {}, |
| 197 | + "source": [ |
| 198 | + "Let's get some infomation about the coadd, such as which visits went into constructing it. As an exercise, explore the information in the coaddInfo object. " |
| 199 | + ] |
| 200 | + }, |
| 201 | + { |
| 202 | + "cell_type": "code", |
| 203 | + "execution_count": null, |
| 204 | + "metadata": {}, |
| 205 | + "outputs": [], |
| 206 | + "source": [ |
| 207 | + "coaddInfo = coadd.getInfo()\n", |
| 208 | + "\n", |
| 209 | + "# Which visits went into constructin this coadd?\n", |
| 210 | + "coaddVisits = coaddInfo.getCoaddInputs().visits\n", |
| 211 | + "coaddVisits.asAstropy()" |
| 212 | + ] |
| 213 | + }, |
194 | 214 | { |
195 | 215 | "cell_type": "code", |
196 | 216 | "execution_count": null, |
|
352 | 372 | "metadata": {}, |
353 | 373 | "outputs": [], |
354 | 374 | "source": [ |
355 | | - "detections = hv.Points(coords).opts(\n", |
356 | | - " fill_color=None, size = 9, color=\"darkorange\")\n", |
357 | | - "\n", |
358 | 375 | "# Custom hover tool for the source detections\n", |
359 | 376 | "detHoverTool = HoverTool(\n", |
360 | 377 | " tooltips=[\n", |
361 | | - " ( 'X', '@x'),\n", |
362 | | - " ( 'Y', '@y'),\n", |
363 | | - " ]\n", |
364 | | - ")" |
| 378 | + " ( 'X', '@x{0.2f}'),\n", |
| 379 | + " ( 'Y', '@y{0.2f}'),\n", |
| 380 | + " ],\n", |
| 381 | + " formatters={\n", |
| 382 | + " 'X' : 'printf',\n", |
| 383 | + " 'Y' : 'printf',\n", |
| 384 | + " },\n", |
| 385 | + " \n", |
| 386 | + ")\n", |
| 387 | + "detections = hv.Points(coords).opts(\n", |
| 388 | + " fill_color=None, size = 9, color=\"darkorange\",\n", |
| 389 | + " tools=[detHoverTool])" |
365 | 390 | ] |
366 | 391 | }, |
367 | 392 | { |
|
377 | 402 | "metadata": {}, |
378 | 403 | "outputs": [], |
379 | 404 | "source": [ |
380 | | - "# Reset the tools on the image and add a hover on the detections. \n", |
381 | | - "rasterize(img.opts(tools=[])) * detections.opts(tools=[detHoverTool])" |
| 405 | + "# Reset the tools on the image and add a hover on the detections.\n", |
| 406 | + "rasterize(img).opts(tools=[]) * detections.opts(tools=[detHoverTool])" |
382 | 407 | ] |
383 | 408 | }, |
384 | 409 | { |
|
0 commit comments