@@ -50,7 +50,7 @@ If you have questions about this notebook, please contact the [IRSA helpdesk](ht
5050
5151``` {code-cell} ipython3
5252# Uncomment the next line to install dependencies if needed
53- # !pip install matplotlib pandas astropy pyvo
53+ # !pip install matplotlib pandas astropy 'astroquery>=0.4.10'
5454```
5555
5656``` {code-cell} ipython3
@@ -69,7 +69,7 @@ from astropy import units as u
6969from astropy.utils.data import download_file
7070from astropy.visualization import ImageNormalize, PercentileInterval, AsinhStretch
7171
72- import pyvo as vo
72+ from astroquery.ipac.irsa import Irsa
7373```
7474
7575## 1. Find the MER Tile ID that corresponds to a given RA and Dec
@@ -86,12 +86,10 @@ coord = SkyCoord.from_name('HD 168151')
8686This searches specifically in the euclid_DpdMerBksMosaic "collection" which is the MER images and catalogs.
8787
8888``` {code-cell} ipython3
89- irsa_service= vo.dal.sia2.SIA2Service('https://irsa.ipac.caltech.edu/SIA')
90-
91- im_table = irsa_service.search(pos=(coord, search_radius), collection='euclid_DpdMerBksMosaic')
89+ im_table = Irsa.query_sia(pos=(coord, search_radius), collection='euclid_DpdMerBksMosaic')
9290
9391## Convert the table to pandas dataframe
94- df_im_irsa=im_table.to_table(). to_pandas()
92+ df_im_irsa=im_table.to_pandas()
9593```
9694
9795``` {code-cell} ipython3
@@ -125,45 +123,28 @@ print('The MER tile ID for this object is :',tileID)
125123Search for all tables in IRSA labeled as euclid
126124
127125``` {code-cell} ipython3
128- service = vo.dal.TAPService("https://irsa.ipac.caltech.edu/TAP")
129-
130- tables = service.tables
131- for tablename in tables.keys():
132- if "tap_schema" not in tablename and "euclid" in tablename:
133- tables[tablename].describe()
126+ Irsa.list_catalogs(filter='euclid')
134127```
135128
136129``` {code-cell} ipython3
137- table_mer= 'euclid_q1_mer_catalogue'
138- table_galaxy_candidates= 'euclid_q1_spectro_zcatalog_spe_galaxy_candidates'
139- table_1dspectra= 'euclid.objectid_spectrafile_association_q1'
140- table_lines= 'euclid_q1_spe_lines_line_features'
130+ table_mer = 'euclid_q1_mer_catalogue'
131+ table_galaxy_candidates = 'euclid_q1_spectro_zcatalog_spe_galaxy_candidates'
132+ table_1dspectra = 'euclid.objectid_spectrafile_association_q1'
133+ table_lines = 'euclid_q1_spe_lines_line_features'
141134```
142135
143136### Learn some information about the table:
144137- How many columns are there?
145138- List the column names
146139
147140``` {code-cell} ipython3
148- columns = tables[table_lines].columns
149- print(len(columns))
150- ```
151-
152- ``` {code-cell} ipython3
153- for col in columns:
154- print(f'{f"{col.name}":30s} {col.unit} {col.description}') ## Currently no descriptions
141+ columns_info = Irsa.list_columns(catalog=table_lines)
142+ print(len(columns_info))
155143```
156144
157145``` {code-cell} ipython3
158- ## Change the settings so we can see all the columns in the dataframe and the full column width
159- ## (to see the full long URL)
160- pd.set_option('display.max_columns', None)
161- pd.set_option('display.max_colwidth', None)
162-
163-
164- ## Can use the following lines to reset the max columns and column width of pandas
165- # pd.reset_option('display.max_columns')
166- # pd.reset_option('display.max_colwidth')
146+ # Full list of columns and their description
147+ columns_info
167148```
168149
169150## Find some objects with spectra in our tileID
@@ -196,8 +177,8 @@ AND lines.spe_line_flux_gf > 2E-16 \
196177ORDER BY lines.spe_line_snr_gf DESC \
197178"
198179
199- # Use TAP with this ADQL string using pyvo
200- result = service.search (adql)
180+ # Use TAP with this ADQL string
181+ result = Irsa.query_tap (adql)
201182
202183# Convert table to pandas dataframe and drop duplicates
203184result_table = result.to_qtable()
@@ -222,7 +203,7 @@ obj_tab
222203``` {code-cell} ipython3
223204adql_object = f"SELECT * FROM {table_1dspectra} WHERE objectid = {obj_id}"
224205
225- result2 = service.search (adql_object)
206+ result2 = Irsa.query_tap (adql_object)
226207df2 = result2.to_table().to_pandas()
227208df2
228209```
0 commit comments