Skip to content

Commit abaef4c

Browse files
committed
Update image handling in notebooks
1 parent 6b2ffb0 commit abaef4c

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

notebook_sandbox/jwst_boxcar/boxcar_extraction.ipynb

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"source": [
9191
"# use a jwst datamodel to provide a good interface to the data and wcs info\n",
9292
"s2d = datamodels.open(s2dfile)\n",
93-
"image = s2d.slits[0].data"
93+
"image = np.array(s2d.slits[0].data)"
9494
]
9595
},
9696
{
@@ -361,7 +361,7 @@
361361
],
362362
"source": [
363363
"plt.figure(figsize=(15, 15))\n",
364-
"plt.imshow(bg.bkg_wimage[::,0:100], origin=\"lower\")\n",
364+
"plt.imshow(bg.bkg_wimage[::,0:100].data, origin=\"lower\")\n",
365365
"plt.title(\"slit[0] slice\")"
366366
]
367367
},
@@ -395,7 +395,7 @@
395395
],
396396
"source": [
397397
"plt.figure(figsize=(15, 15))\n",
398-
"plt.imshow(bg.bkg_image(image)[::,0:100], norm=norm_data, origin=\"lower\")\n",
398+
"plt.imshow(bg.bkg_image(image)[::,0:100].data, norm=norm_data, origin=\"lower\")\n",
399399
"plt.title(\"slit[0] slice\")"
400400
]
401401
},
@@ -429,7 +429,7 @@
429429
],
430430
"source": [
431431
"plt.figure(figsize=(15, 15))\n",
432-
"plt.imshow(bg.sub_image(image)[::,0:100], norm=norm_data, origin=\"lower\")\n",
432+
"plt.imshow(bg.sub_image(image)[::,0:100].data, norm=norm_data, origin=\"lower\")\n",
433433
"plt.title(\"slit[0] slice\")"
434434
]
435435
},
@@ -471,7 +471,7 @@
471471
"source": [
472472
"bg_med = Background.two_sided(image, ext_center, bkg_sep, width=bkg_width, statistic='median')\n",
473473
"plt.figure(figsize=(15, 15))\n",
474-
"plt.imshow(bg_med.bkg_wimage[::,0:100], origin=\"lower\")\n",
474+
"plt.imshow(bg_med.bkg_wimage[::,0:100].data, origin=\"lower\")\n",
475475
"plt.title(\"slit[0] slice\")"
476476
]
477477
},
@@ -548,7 +548,7 @@
548548
"## About this notebook\n",
549549
"\n",
550550
"**Author:** Ivo Busko, JWST\n",
551-
"**Updated On:** 2022-11-11"
551+
"**Updated On:** 2022-12-05"
552552
]
553553
},
554554
{
@@ -565,13 +565,6 @@
565565
"[Top of Page](#top)\n",
566566
"<img style=\"float: right;\" src=\"https://raw.githubusercontent.com/spacetelescope/notebooks/master/assets/stsci_pri_combo_mark_horizonal_white_bkgd.png\" alt=\"Space Telescope Logo\" width=\"200px\"/> "
567567
]
568-
},
569-
{
570-
"cell_type": "code",
571-
"execution_count": null,
572-
"metadata": {},
573-
"outputs": [],
574-
"source": []
575568
}
576569
],
577570
"metadata": {

notebook_sandbox/tracing_options.ipynb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"source": [
7272
"# use a jwst datamodel to provide a good interface to the data and wcs info\n",
7373
"s2d = datamodels.open(s2dfile)\n",
74-
"image = s2d.slits[0].data\n",
74+
"image = np.array(s2d.slits[0].data)\n",
7575
"norm_data = simple_norm(image, \"sqrt\")"
7676
]
7777
},
@@ -154,7 +154,7 @@
154154
],
155155
"source": [
156156
"plt.figure(figsize=(15, 15))\n",
157-
"plt.imshow(bg.sub_image(image), norm=norm_data, aspect=5, origin=\"lower\")\n",
157+
"plt.imshow(bg.sub_image(image).data, norm=norm_data, aspect=5, origin=\"lower\")\n",
158158
"plt.plot(auto_trace_gauss.trace, color='r')\n",
159159
"plt.title(\"slit[0] slice\")"
160160
]
@@ -338,7 +338,7 @@
338338
"## About this notebook\n",
339339
"\n",
340340
"**Author:** Kyle Conroy, JWST\n",
341-
"**Updated On:** 2022-11-16"
341+
"**Updated On:** 2022-12-05"
342342
]
343343
},
344344
{
@@ -348,13 +348,6 @@
348348
"[Top of Page](#top)\n",
349349
"<img style=\"float: right;\" src=\"https://raw.githubusercontent.com/spacetelescope/notebooks/master/assets/stsci_pri_combo_mark_horizonal_white_bkgd.png\" alt=\"Space Telescope Logo\" width=\"200px\"/> "
350350
]
351-
},
352-
{
353-
"cell_type": "code",
354-
"execution_count": null,
355-
"metadata": {},
356-
"outputs": [],
357-
"source": []
358351
}
359352
],
360353
"metadata": {

0 commit comments

Comments
 (0)