Skip to content

Commit 2a0f8b8

Browse files
committed
Fix fits.open in NB02c to avoid caching
1 parent 0856433 commit 2a0f8b8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

DP0.2/02c_Image_Queries_with_TAP.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,9 +1397,9 @@
13971397
"metadata": {},
13981398
"outputs": [],
13991399
"source": [
1400-
"hdulist = fits.open(image_url, cache=False)\n",
1401-
"for hdu in hdulist:\n",
1402-
" print(hdu.name)"
1400+
"with fits.open(image_url, cache=False, use_fsspec=True) as hdulist:\n",
1401+
" for hdu in hdulist:\n",
1402+
" print(hdu.name)"
14031403
]
14041404
},
14051405
{
@@ -1710,9 +1710,9 @@
17101710
" dl_results = DatalinkResults.from_result_url(result['access_url'],\n",
17111711
" session=auth_session)\n",
17121712
" image_url = dl_results['access_url'][0]\n",
1713-
" hdulist = fits.open(image_url, cache=False)\n",
1714-
" img_hdr = hdulist[1].header\n",
1715-
" img_wcs = WCS(img_hdr)\n",
1713+
" with fits.open(image_url, cache=False, use_fsspec=True) as hdulist:\n",
1714+
" img_hdr = hdulist[1].header\n",
1715+
" img_wcs = WCS(img_hdr)\n",
17161716
" print(r, img_wcs.footprint_contains(targetCoord))\n",
17171717
" del dl_results, image_url, hdulist, img_hdr, img_wcs"
17181718
]

0 commit comments

Comments
 (0)