You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This table lists all MER mosaic images available in this position. These mosaics include the Euclid VIS, Y, J, H images, as well as ground-based telescopes which have been put on the same pixel scale. For more information, see the [Euclid documentation at IPAC](https://euclid.caltech.edu/page/euclid-faq-tech/).
97
+
This table lists all MER mosaic images available in this position. These mosaics include the Euclid VIS, Y, J, H images, as well as ground-based telescopes which have been put on the same pixel scale. For more information, see the [Euclid documentation at IPAC](https://euclid.caltech.edu/page/euclid-faq-tech/). We use the ``facility`` argument below to query for Euclid images only.
Note that we use `to_table` above rather than `to_qtable`. While astropy's `QTable` is more powerful than its `Table`, as it e.g. handles the column units properly, we cannot use it here due to a known bug; it mishandles the large integer numbers in the `object_id` column and recast them as float during which process some precision is being lost.
229
221
230
-
# Display first few rows
231
-
df_g_irsa.head()
222
+
Once the bug is fixed, we plan to update the code in this notebook and simplify some of the approaches below.
232
223
```
233
224
234
-
```{code-cell} ipython3
235
-
len(df_g_irsa)
236
-
```
225
+
+++
237
226
238
227
## 3. Read in a cutout of the MER image from IRSA directly
239
228
229
+
+++
230
+
231
+
Due to the large field of view of the MER mosaic, let's cut out a smaller section (5'x5') of the MER mosaic to inspect the image.
232
+
240
233
```{code-cell} ipython3
241
234
## Use fsspec to interact with the fits file without downloading the full file
We can rely on astropy's WCSAxes framework for making plots of Astronomical data in Matplotlib. Please note the usage of `projection` and `transform` arguments in the code example below.
259
+
260
+
For more info, please visit the [WCSAxes documentation](https://docs.astropy.org/en/stable/visualization/wcsaxes/index.html).
279
261
```
280
262
281
263
```{code-cell} ipython3
282
-
df_g_irsa['x_pix']=xy_irsa[0]
283
-
df_g_irsa['y_pix']=xy_irsa[1]
284
-
```
264
+
ax = plt.subplot(projection=cutout_image.wcs)
285
265
286
-
Due to the large field of view of the MER mosaic, let's cut out a smaller section (3'x3')of the MER mosaic to inspect the image
Let's pick one of these galaxies. Note that the table has been sorted above, we can use the same index here and below to access the data for this particular galaxy.
285
+
307
286
```{code-cell} ipython3
308
-
df_g_irsa_sort.iloc[0:3]
287
+
index = 2
288
+
289
+
obj_id = result_galaxies['object_id'][index]
290
+
redshift = result_galaxies['phz_median'][index]
309
291
```
310
292
311
-
```{code-cell} ipython3
312
-
obj_id=df_g_irsa_sort['object_id'].iloc[2]
313
-
redshift = df_g_irsa_sort['phz_median'].iloc[2]
293
+
We will use TAP and an ASQL query to find the spectral data for this particular galaxy.
314
294
315
-
## Pull the data on these objects
316
-
adql_object = f"SELECT * \
317
-
FROM {table_1dspectra} \
318
-
WHERE objectid = {obj_id}"
295
+
```{code-cell} ipython3
296
+
adql_object = f"SELECT * FROM {table_1dspectra} WHERE objectid = {obj_id}"
plt.title('Object ID is '+str(obj_id)+'with phz_median='+str(redshift))
330
+
plt.ylim(-0.5,0.5)
331
+
_ = plt.title(f"Object {obj_id} with phz_median={redshift}")
352
332
```
353
333
354
-
Let's cut out a very small patch of the MER image to see what this galaxy looks like
334
+
Let's cut out a very small patch of the MER image to see what this galaxy looks like. Remember that we sorted the table above, so can reuse the same index to pick up the coordinates for the galaxy. Otherwise we could filter on the object ID.
355
335
356
336
```{code-cell} ipython3
357
-
## How large do you want the image cutout to be?
358
-
im_cutout= 2.0 * u.arcsec
359
-
360
-
## Use the ra and dec of the galaxy
361
-
ra = df_g_irsa[df_g_irsa['object_id']==obj_id]['ra'].iloc[0]
362
-
dec = df_g_irsa[df_g_irsa['object_id']==obj_id]['dec'].iloc[0]
0 commit comments