Skip to content

Commit 36e5d2f

Browse files
committed
Remove user directory
1 parent ff1ea6d commit 36e5d2f

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

tutorials/euclid_access/1_Euclid_intro_MER_images.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ kernelspec:
1919

2020
+++
2121

22-
By the end of this tutorial, you will:
22+
By the end of this tutorial, you will:
2323
- Understand the basic characteristics of Euclid Q1 MER mosaics.
2424
- How do download full MER mosaics.
2525
- How to make smaller cutouts of MER mosaics.
@@ -82,8 +82,8 @@ search_radius = 10 * u.arcsec
8282
coord = SkyCoord.from_name('HD 168151')
8383
```
8484

85-
Use IRSA to search for all Euclid data on this target.
86-
This searches specifically in the euclid_DpdMerBksMosaic "collection" which is the MER images and catalogs.
85+
Use IRSA to search for all Euclid data on this target.
86+
This searches specifically in the euclid_DpdMerBksMosaic "collection" which is the MER images and catalogs.
8787
This query will return any image with pixels that overlap the search region.
8888

8989
```{code-cell} ipython3
@@ -157,11 +157,12 @@ print(hdu_mer_irsa.info())
157157
head_mer_irsa = hdu_mer_irsa[0].header
158158
```
159159

160-
Now you've downloaded this large file, if you would like to save it to disk, uncomment the following cell
160+
Now you've downloaded this large file, if you would like to save it to disk, uncomment the following cell.
161+
Please also define a suitable download directory; by default it will be `data` at the same location as your notebook.
161162

162163
```{code-cell} ipython3
163-
# download_path='/Users/meshkat/data/Euclid/'
164-
# hdu_mer_irsa.writeto(download_path+'./MER_image_VIS.fits', overwrite=True)
164+
# download_path = 'data'
165+
# hdu_mer_irsa.writeto(os.path.join(download_path, 'MER_image_VIS.fits'), overwrite=True)
165166
```
166167

167168
Have a look at the header information for this image
@@ -229,8 +230,8 @@ filters
229230
## How large do you want the image cutout to be?
230231
im_cutout= 1.0 * u.arcmin
231232
232-
## What is the center of the cutout?
233-
## For now choosing a random location on the image
233+
## What is the center of the cutout?
234+
## For now choosing a random location on the image
234235
## because the star itself is saturated
235236
ra = 273.8667
236237
dec = 64.525
@@ -253,14 +254,14 @@ for url in urls:
253254
print(f"Opened {url}")
254255
255256
## Store the header
256-
header = hdu[0].header
257+
header = hdu[0].header
257258
258259
## Read in the cutout of the image that you want
259260
cutout_data = Cutout2D(hdu[0].section, position=coords_cutout, size=im_cutout, wcs=WCS(hdu[0].header))
260261
261262
## Close the file
262263
# hdu.close()
263-
264+
264265
## Define a new fits file based on this smaller cutout, with accurate WCS based on the cutout size
265266
new_hdu = fits.PrimaryHDU(data=cutout_data.data, header=header)
266267
new_hdu.header.update(cutout_data.wcs.to_header())
@@ -280,7 +281,7 @@ Need to determine the number of images for the grid layout, then we iterate thro
280281
```{code-cell} ipython3
281282
num_images = len(final_hdulist)
282283
columns = 4
283-
rows = -(-num_images // columns)
284+
rows = -(-num_images // columns)
284285
285286
fig, axes = plt.subplots(rows, columns, figsize=(4 * columns, 4 * rows), subplot_kw={'projection': WCS(final_hdulist[0].header)})
286287
axes = axes.flatten()
@@ -310,7 +311,7 @@ filters
310311
```
311312

312313
```{code-cell} ipython3
313-
filt_index = np.where(filters == 'VIS')[0][0]
314+
filt_index = np.where(filters == 'VIS')[0][0]
314315
315316
img1=final_hdulist[filt_index].data
316317
```
@@ -324,7 +325,7 @@ Need to do some initial steps (swap byte order) with the cutout to prevent sep f
324325

325326
```{code-cell} ipython3
326327
img2 = img1.byteswap().view(img1.dtype.newbyteorder())
327-
c_contiguous_data = np.array(img2, dtype=np.float32)
328+
c_contiguous_data = np.array(img2, dtype=np.float32)
328329
329330
bkg = sep.Background(c_contiguous_data)
330331

0 commit comments

Comments
 (0)