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

Commit 307a027

Browse files
committed
revision after memory error identified
1 parent ccbde9e commit 307a027

1 file changed

Lines changed: 14 additions & 63 deletions

File tree

03_Intro_to_AFW_Display.ipynb

Lines changed: 14 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"Contact author: Alex Drlica-Wagner (kadrlica@fnal.gov) <br>\n",
1515
"Credit: Brant Robertson and the LSST Stack Club <br>\n",
1616
"Target audience: All DP0 delegates, especially those new to Notebooks. <br>\n",
17+
"Container Size: medium <br>\n",
1718
"<br>\n",
1819
"Questions welcome at <a href=\"https://community.lsst.org/c/support/dp0\">community.lsst.org/c/support/dp0</a> <br>\n",
1920
"Find DP0 documentation and resources at <a href=\"https://dp0-1.lsst.io\">dp0-1.lsst.io</a> <br>\n",
@@ -22,8 +23,7 @@
2223
"\n",
2324
"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",
2425
"\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",
2727
"\n",
2828
"### Set Up"
2929
]
@@ -65,23 +65,6 @@
6565
"import warnings #imports the warnings library"
6666
]
6767
},
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-
},
8568
{
8669
"cell_type": "markdown",
8770
"metadata": {},
@@ -95,8 +78,8 @@
9578
"metadata": {},
9679
"outputs": [],
9780
"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"
10083
]
10184
},
10285
{
@@ -219,8 +202,10 @@
219202
]
220203
},
221204
{
222-
"cell_type": "raw",
205+
"cell_type": "code",
206+
"execution_count": null,
223207
"metadata": {},
208+
"outputs": [],
224209
"source": [
225210
"fig,ax = plt.subplots(1,2,figsize=(14,7))\n",
226211
"\n",
@@ -245,8 +230,10 @@
245230
]
246231
},
247232
{
248-
"cell_type": "raw",
233+
"cell_type": "code",
234+
"execution_count": null,
249235
"metadata": {},
236+
"outputs": [],
250237
"source": [
251238
"fig = plt.figure()\n",
252239
"display = afwDisplay.Display()\n",
@@ -255,29 +242,11 @@
255242
"plt.show()"
256243
]
257244
},
258-
{
259-
"cell_type": "code",
260-
"execution_count": null,
261-
"metadata": {},
262-
"outputs": [],
263-
"source": [
264-
"print('hello')"
265-
]
266-
},
267245
{
268246
"cell_type": "markdown",
269247
"metadata": {},
270248
"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`!"
281250
]
282251
},
283252
{
@@ -289,33 +258,15 @@
289258
"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)."
290259
]
291260
},
292-
{
293-
"cell_type": "code",
294-
"execution_count": null,
295-
"metadata": {},
296-
"outputs": [],
297-
"source": [
298-
"print(\"hello\")"
299-
]
300-
},
301261
{
302262
"cell_type": "markdown",
303263
"metadata": {},
304264
"source": [
305265
"We'll follow the same steps as above to display the image, but we'll add a few modifications\n",
306266
"\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."
319270
]
320271
},
321272
{

0 commit comments

Comments
 (0)