|
14 | 14 | "Contact author: Alex Drlica-Wagner (kadrlica@fnal.gov) <br>\n", |
15 | 15 | "Credit: Brant Robertson and the LSST Stack Club <br>\n", |
16 | 16 | "Target audience: All DP0 delegates, especially those new to Notebooks. <br>\n", |
| 17 | + "Container Size: medium <br>\n", |
17 | 18 | "<br>\n", |
18 | 19 | "Questions welcome at <a href=\"https://community.lsst.org/c/support/dp0\">community.lsst.org/c/support/dp0</a> <br>\n", |
19 | 20 | "Find DP0 documentation and resources at <a href=\"https://dp0-1.lsst.io\">dp0-1.lsst.io</a> <br>\n", |
|
22 | 23 | "\n", |
23 | 24 | "This tutorial is designed to help users get a brief feel for the `lsst.afw.display` library that enables the visual inspection of data. The [`lsst.afw` library](https://github.com/lsst/afw) provides an \"Astronomical Framework\" (afw) while the `lsst.daf.*` libraries (see, e.g., [daf_base](https://github.com/lsst/daf_base)) provides a Data Access Framework (daf). Both libraries are used in this tutorial, with the `lsst.daf.persistence` library used to access a calibrated exposure (calexp) and the `lsst.afw.display` library used to show the exposure image on the screen.\n", |
24 | 25 | "\n", |
25 | | - "### Credit:\n", |
26 | | - "This tutorial is based on the [`AFW_Display_Demo.ipynb`](https://github.com/LSSTScienceCollaborations/StackClub/blob/master/Visualization/AFW_Display_Demo.ipynb) notebook originally written by Brant Robertson and maintained by the LSST Stack Club. More examples of the use of `lsst.afw.display` can be found in the [Stack ](https://pipelines.lsst.io/getting-started/display.html).\n", |
| 26 | + "**Credit:** This tutorial is based on the [`AFW_Display_Demo.ipynb`](https://github.com/LSSTScienceCollaborations/StackClub/blob/master/Visualization/AFW_Display_Demo.ipynb) notebook originally written by Brant Robertson and maintained by the LSST Stack Club. More examples of the use of `lsst.afw.display` can be found in the [Stack ](https://pipelines.lsst.io/getting-started/display.html).\n", |
27 | 27 | "\n", |
28 | 28 | "### Set Up" |
29 | 29 | ] |
|
65 | 65 | "import warnings #imports the warnings library" |
66 | 66 | ] |
67 | 67 | }, |
68 | | - { |
69 | | - "cell_type": "markdown", |
70 | | - "metadata": {}, |
71 | | - "source": [ |
72 | | - "Let's go ahead and import from `astropy` the image stretch limits from the familiar `zscale()` function." |
73 | | - ] |
74 | | - }, |
75 | | - { |
76 | | - "cell_type": "code", |
77 | | - "execution_count": null, |
78 | | - "metadata": {}, |
79 | | - "outputs": [], |
80 | | - "source": [ |
81 | | - "#from astropy.visualization import ZScaleInterval #This function allows use to use the `zscale()` rescaling limits function familiar from, e.g., DS9, to adjust the image stretch.\n", |
82 | | - "#zscale = ZScaleInterval() #create an alias to the `ZScaleInterval()` function" |
83 | | - ] |
84 | | - }, |
85 | 68 | { |
86 | 69 | "cell_type": "markdown", |
87 | 70 | "metadata": {}, |
|
95 | 78 | "metadata": {}, |
96 | 79 | "outputs": [], |
97 | 80 | "source": [ |
98 | | - "#warnings.simplefilter(\"ignore\", category=FutureWarning) #prevent some helpful but ancillary warning messages from printing during some LSST DM Release calls\n", |
99 | | - "#warnings.simplefilter(\"ignore\", category=UserWarning) #prevent some helpful but ancillary warning messages from printing during some LSST DM Release calls" |
| 81 | + "warnings.simplefilter(\"ignore\", category=FutureWarning) #prevent some helpful but ancillary warning messages from printing during some LSST DM Release calls\n", |
| 82 | + "warnings.simplefilter(\"ignore\", category=UserWarning) #prevent some helpful but ancillary warning messages from printing during some LSST DM Release calls" |
100 | 83 | ] |
101 | 84 | }, |
102 | 85 | { |
|
219 | 202 | ] |
220 | 203 | }, |
221 | 204 | { |
222 | | - "cell_type": "raw", |
| 205 | + "cell_type": "code", |
| 206 | + "execution_count": null, |
223 | 207 | "metadata": {}, |
| 208 | + "outputs": [], |
224 | 209 | "source": [ |
225 | 210 | "fig,ax = plt.subplots(1,2,figsize=(14,7))\n", |
226 | 211 | "\n", |
|
245 | 230 | ] |
246 | 231 | }, |
247 | 232 | { |
248 | | - "cell_type": "raw", |
| 233 | + "cell_type": "code", |
| 234 | + "execution_count": null, |
249 | 235 | "metadata": {}, |
| 236 | + "outputs": [], |
250 | 237 | "source": [ |
251 | 238 | "fig = plt.figure()\n", |
252 | 239 | "display = afwDisplay.Display()\n", |
|
255 | 242 | "plt.show()" |
256 | 243 | ] |
257 | 244 | }, |
258 | | - { |
259 | | - "cell_type": "code", |
260 | | - "execution_count": null, |
261 | | - "metadata": {}, |
262 | | - "outputs": [], |
263 | | - "source": [ |
264 | | - "print('hello')" |
265 | | - ] |
266 | | - }, |
267 | 245 | { |
268 | 246 | "cell_type": "markdown", |
269 | 247 | "metadata": {}, |
270 | 248 | "source": [ |
271 | | - "**Congrats!** We've plotted an image using `lsst.afw.display`!" |
272 | | - ] |
273 | | - }, |
274 | | - { |
275 | | - "cell_type": "code", |
276 | | - "execution_count": null, |
277 | | - "metadata": {}, |
278 | | - "outputs": [], |
279 | | - "source": [ |
280 | | - "print('hello')" |
| 249 | + "**Congratulations!** We've plotted an image using `lsst.afw.display`!" |
281 | 250 | ] |
282 | 251 | }, |
283 | 252 | { |
|
289 | 258 | "The `calexp` returned by the butler contains more than just the image pixel values (see the Stack Club [calexp tutorial](https://github.com/LSSTScienceCollaborations/StackClub/blob/master/Basics/Calexp_guided_tour.ipynb) for more details). One other component is the mask plane associated with the image. `AFWDisplay` provides a nice pre-packaged interface for overplotting the mask associated with an image. A mask is composed of a set of \"mask planes\", 2D binary bit maps corresponding to pixels that are masked for various reasons (see [here](https://pipelines.lsst.io/v/DM-11392/getting-started/display.html#interpreting-displayed-mask-colors) for more details)." |
290 | 259 | ] |
291 | 260 | }, |
292 | | - { |
293 | | - "cell_type": "code", |
294 | | - "execution_count": null, |
295 | | - "metadata": {}, |
296 | | - "outputs": [], |
297 | | - "source": [ |
298 | | - "print(\"hello\")" |
299 | | - ] |
300 | | - }, |
301 | 261 | { |
302 | 262 | "cell_type": "markdown", |
303 | 263 | "metadata": {}, |
304 | 264 | "source": [ |
305 | 265 | "We'll follow the same steps as above to display the image, but we'll add a few modifications\n", |
306 | 266 | "\n", |
307 | | - "* We explicitly set the transparency of the overplotted mask (0 = transparent, 1 = opaque)\n", |
308 | | - "* We explicitly set the color of the 'DETECTED' mask plane to 'blue' (i.e. all pixels associated with detected objects).\n", |
309 | | - "* We pass the full `calexp` object to `mtv` instead of just the image plane." |
310 | | - ] |
311 | | - }, |
312 | | - { |
313 | | - "cell_type": "code", |
314 | | - "execution_count": null, |
315 | | - "metadata": {}, |
316 | | - "outputs": [], |
317 | | - "source": [ |
318 | | - "print(\"hello\")" |
| 267 | + "1. We explicitly set the transparency of the overplotted mask (0 = transparent, 1 = opaque)\n", |
| 268 | + "2. We explicitly set the color of the 'DETECTED' mask plane to 'blue' (i.e. all pixels associated with detected objects).\n", |
| 269 | + "3. We pass the full `calexp` object to `mtv` instead of just the image plane." |
319 | 270 | ] |
320 | 271 | }, |
321 | 272 | { |
|
0 commit comments