@@ -118,34 +118,7 @@ tileID=re.search(r'TILE\s*(\d{9})', filename).group(1)
118118print('The MER tile ID for this object is :',tileID)
119119```
120120
121- ## 2. Read in the MER image from IRSA directly
122-
123- ### Download the MER image to this notebook
124- Note this file is about 1.46 GB
125-
126- ``` {code-cell} ipython3
127- fname = download_file(filename, cache=True)
128- hdu_mer_irsa = fits.open(fname)
129- head_mer_irsa = hdu_mer_irsa[0].header
130-
131- print(hdu_mer_irsa.info())
132- ```
133-
134- #### Extract just the primary image
135-
136- ``` {code-cell} ipython3
137- im_mer_irsa=hdu_mer_irsa[0].data
138- ```
139-
140- #### Make a quick and simple plot to show the full MER image, with its large FOV
141-
142- ``` {code-cell} ipython3
143- plt.imshow(im_mer_irsa, cmap='gray', origin='lower',
144- norm=ImageNormalize(im_mer_irsa, interval=PercentileInterval(99.9), stretch=AsinhStretch()))
145- colorbar = plt.colorbar()
146- ```
147-
148- ## 3. Download SPE catalog from IRSA directly to this notebook
121+ ## 2. Download SPE catalog from IRSA directly to this notebook
149122
150123Search for all tables in IRSA labeled as euclid
151124
@@ -162,15 +135,15 @@ for tablename in tables.keys():
162135table_mer= 'euclid_q1_mer_catalogue'
163136table_galaxy_candidates= 'euclid_q1_spectro_zcatalog_spe_galaxy_candidates'
164137table_1dspectra= 'euclid.objectid_spectrafile_association_q1'
165- table_spe = 'euclid_q1_spe_lines_line_features'
138+ table_lines = 'euclid_q1_spe_lines_line_features'
166139```
167140
168141### Learn some information about the table:
169142- How many columns are there?
170143- List the column names
171144
172145``` {code-cell} ipython3
173- columns = tables[table_spe ].columns
146+ columns = tables[table_lines ].columns
174147print(len(columns))
175148```
176149
@@ -205,20 +178,20 @@ Finally we sort the data by descending spe_line_snr_gf to have the largest SNR H
205178
206179``` {code-cell} ipython3
207180adql = f"SELECT DISTINCT mer.object_id,mer.ra, mer.dec, mer.tileid, mer.flux_y_templfit, \
208- spe .spe_line_snr_gf,spe .spe_line_snr_di, spe .spe_line_name, spe .spe_line_central_wl_gf,\
209- spe .spe_line_ew_gf, galaxy.spe_z_err, galaxy.spe_z,galaxy.spe_z_prob, spe .spe_line_flux_gf, spe .spe_line_flux_err_gf \
181+ lines .spe_line_snr_gf,lines .spe_line_snr_di, lines .spe_line_name, lines .spe_line_central_wl_gf,\
182+ lines .spe_line_ew_gf, galaxy.spe_z_err, galaxy.spe_z,galaxy.spe_z_prob, lines .spe_line_flux_gf, lines .spe_line_flux_err_gf \
210183FROM {table_mer} AS mer \
211- JOIN {table_spe } AS spe \
212- ON mer.object_id = spe .object_id \
184+ JOIN {table_lines } AS lines \
185+ ON mer.object_id = lines .object_id \
213186JOIN {table_galaxy_candidates} AS galaxy \
214- ON spe .object_id = galaxy.object_id AND spe .spe_rank = galaxy.spe_rank \
215- WHERE spe .spe_line_snr_gf >5 \
216- AND spe .spe_line_name = 'Halpha' \
187+ ON lines .object_id = galaxy.object_id AND lines .spe_rank = galaxy.spe_rank \
188+ WHERE lines .spe_line_snr_gf >5 \
189+ AND lines .spe_line_name = 'Halpha' \
217190AND mer.tileid = {tileID} \
218191AND galaxy.spe_z_prob > 0.99 \
219192AND galaxy.spe_z BETWEEN 1.4 AND 1.6 \
220- AND spe .spe_line_flux_gf > 2E-16 \
221- ORDER BY spe .spe_line_snr_gf DESC \
193+ AND lines .spe_line_flux_gf > 2E-16 \
194+ ORDER BY lines .spe_line_snr_gf DESC \
222195"
223196
224197# Use TAP with this ADQL string using pyvo
@@ -245,7 +218,7 @@ obj_tab
245218### Pull the spectrum of this object
246219
247220``` {code-cell} ipython3
248- adql_object = f"SELECT * FROM {table_1dspectra} WHERE objectid = {obj_id} AND uri IS NOT NULL "
221+ adql_object = f"SELECT * FROM {table_1dspectra} WHERE objectid = {obj_id}"
249222
250223result2 = service.search(adql_object)
251224df2 = result2.to_table().to_pandas()
@@ -275,19 +248,20 @@ with fits.open(BytesIO(response.content), memmap=True) as hdul:
275248Divide by 10000 to convert from Angstrom to micron
276249
277250``` {code-cell} ipython3
278- wavelengths = obj_2739401293646823742 ['spe_line_central_wl_gf']/10000.
279- line_names = obj_2739401293646823742 ['spe_line_name']
280- snr_gf = obj_2739401293646823742 ['spe_line_snr_gf']
251+ wavelengths = obj_tab ['spe_line_central_wl_gf']/10000.
252+ line_names = obj_tab ['spe_line_name']
253+ snr_gf = obj_tab ['spe_line_snr_gf']
281254
282255plt.plot(df_obj_irsa['WAVELENGTH']/10000., df_obj_irsa['SIGNAL'])
283256
284257for wl, name, snr in zip(np.atleast_1d(wavelengths), np.atleast_1d(line_names), np.atleast_1d(snr_gf)):
285258 plt.axvline(wl, color='b', linestyle='--', alpha=0.3)
286- plt.text(wl+0.02, .1 , name+' SNR='+str(round(snr)), rotation=90, ha='center', va='bottom', fontsize=10)
259+ plt.text(wl+0.02, .2 , name+' SNR='+str(round(snr)), rotation=90, ha='center', va='bottom', fontsize=10)
287260
288261plt.xlabel('Wavelength (microns)')
289- plt.ylabel('Flux (erg / (Angstrom s cm2))')
290- plt.title(obj_id)
262+ plt.ylabel('Flux (erg / (s cm2))')
263+ plt.xlim(1.25, 1.85)
264+ plt.title('Object ID is '+str(obj_id))
291265```
292266
293267## About this Notebook
0 commit comments