Skip to content

Commit 02077b8

Browse files
authored
Merge pull request #57 from bsipocz/update_astroquery_0410
Updating tutorials with new astroquery features
2 parents 7fa76be + 04d050f commit 02077b8

File tree

3 files changed

+14
-24
lines changed

3 files changed

+14
-24
lines changed

.binder/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ numpy
44
matplotlib
55
astropy
66
pyvo>=1.5
7-
astroquery
7+
astroquery>=0.4.10
88
scipy
99
pyarrow>=10.0.1
1010
hpgeom

tutorials/cloud_access/euclid-cloud-access.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ Euclid Q1 data were released on-premises at IPAC and in the cloud via Amazon Web
3535
## 2. Imports
3636
- `s3fs` for browsing S3 buckets
3737
- `astropy` for handling coordinates, units, FITS I/O, tables, images, etc.
38-
- `astroquery` for querying Euclid data products from IRSA
38+
- `astroquery` for querying Euclid data products from IRSA
3939
- `matplotlib` for visualization
4040
- `json` for decoding JSON strings
4141

4242
```{code-cell} ipython3
4343
# Uncomment the next line to install dependencies if needed.
44-
# !pip install s3fs astropy astroquery matploltib
44+
# !pip install s3fs astropy astroquery>=0.4.10 matploltib
4545
```
4646

4747
```{code-cell} ipython3
@@ -104,17 +104,11 @@ coord = SkyCoord.from_name(target_name)
104104
search_radius = 10 * u.arcsec
105105
```
106106

107-
List all Simple Image Access (SIA) collections for IRSA:
107+
List all Simple Image Access (SIA) collections for IRSA with names containing "euclid":
108108

109109
```{code-cell} ipython3
110-
collections = Irsa.list_collections(servicetype='SIA')
111-
len(collections)
112-
```
113-
114-
Filter to only those containing "euclid":
115-
116-
```{code-cell} ipython3
117-
collections[['euclid' in v for v in collections['collection']]]
110+
collections = Irsa.list_collections(servicetype='SIA', filter='euclid')
111+
collections
118112
```
119113

120114
As per "Data Products Overview" in [user guide](https://irsa.ipac.caltech.edu/data/Euclid/docs/euclid_archive_at_irsa_user_guide.pdf) and above table, we identify that MER Mosiacs are available as the following collection:
@@ -126,7 +120,7 @@ img_collection = 'euclid_DpdMerBksMosaic'
126120
Now query this collection for our target's coordinates and search radius:
127121

128122
```{code-cell} ipython3
129-
img_tbl = Irsa.query_sia(pos=(coord, search_radius), collection=img_collection).to_table()
123+
img_tbl = Irsa.query_sia(pos=(coord, search_radius), collection=img_collection)
130124
img_tbl
131125
```
132126

@@ -182,9 +176,9 @@ for row in euclid_sci_img_tbl:
182176
183177
with fits.open(f's3://{s3_fpath}', fsspec_kwargs={"anon": True}) as hdul:
184178
print(f'Retrieving cutout for {filter_name} ...')
185-
cutout = Cutout2D(hdul[0].section,
186-
position=coord,
187-
size=cutout_size,
179+
cutout = Cutout2D(hdul[0].section,
180+
position=coord,
181+
size=cutout_size,
188182
wcs=WCS(hdul[0].header))
189183
cutouts.append(cutout)
190184
filters.append(filter_name)
@@ -231,12 +225,8 @@ Once the catalogs are available as Parquet files in the cloud, we can efficientl
231225
First, list the Euclid catalogs provided by IRSA:
232226

233227
```{code-cell} ipython3
234-
catalogs = Irsa.list_catalogs(full=True).to_table()
235-
len(catalogs)
236-
```
237-
238-
```{code-cell} ipython3
239-
catalogs[['euclid' in v for v in catalogs['schema_name']]]
228+
catalogs = Irsa.list_catalogs(full=True, filter='euclid')
229+
catalogs
240230
```
241231

242232
From this table, we can extract the MER catalog name. We also see several other interesting catalogs, let's also extract spectral file association catalog for retrieving spectra later.

tutorials/euclid_access/Euclid_ERO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ First, we import all necessary packages.
5353

5454
```{code-cell} ipython3
5555
# Uncomment the next line to install dependencies if needed.
56-
# !pip install tqdm numpy matplotlib astropy photutils astroquery>0.4.10 sep>=1.4 firefly_client>=3.2
56+
# !pip install tqdm numpy matplotlib astropy photutils astroquery>=0.4.10 sep>=1.4 firefly_client>=3.2
5757
```
5858

5959
```{code-cell} ipython3
@@ -161,7 +161,7 @@ Here we use the collection *euclid_ero*, containing the Euclid ERO images. We fi
161161

162162

163163
```{code-cell} ipython3
164-
image_tab = Irsa.query_sia(pos=(coord, search_radius), collection='euclid_ero').to_table()
164+
image_tab = Irsa.query_sia(pos=(coord, search_radius), collection='euclid_ero')
165165
print("Number of images available: {}".format(len(image_tab)))
166166
```
167167

0 commit comments

Comments
 (0)