Skip to content

Commit f2a1269

Browse files
authored
Merge pull request #101 from bsipocz/MAINT_add_astroqeury_version_note
DOC: adding note about having recent enough versions
2 parents 24823d8 + b4a2c8d commit f2a1269

8 files changed

Lines changed: 43 additions & 10 deletions

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ data/
55
output/
66
# "cache" dir is created by nway in the forced photometry notebook. ignore it and any other "cache" directory
77
cache/
8+
# Other random download/output dirs, etc, these should ideally be generalized to be one of the aboves
9+
downloaded_hdf5_files/
810

911
# Data and Output files
1012
# data and output files should not be committed to the code repository
@@ -21,6 +23,7 @@ cache/
2123
*.parquet
2224
*.pdf
2325
*.png
26+
*.gif
2427

2528
# Tests and reports
2629
htmlcov/
@@ -33,6 +36,7 @@ htmlcov/
3336
*.ipynb
3437
_build/
3538

39+
3640
# PyCharm
3741
.idea
3842

tutorials/cloud_access/euclid-cloud-access.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ If you have questions, please contact the [IRSA helpdesk](https://irsa.ipac.calt
4242
## 2. Imports
4343
- `s3fs` for browsing S3 buckets
4444
- `astropy` for handling coordinates, units, FITS I/O, tables, images, etc.
45-
- `astroquery` for querying Euclid data products from IRSA
45+
- `astroquery>=0.4.10` for querying Euclid data products from IRSA
4646
- `matplotlib` for visualization
4747
- `json` for decoding JSON strings
4848

49+
```{important}
50+
We rely on ``astroquery`` features that have been recently added, so please make sure you have version v0.4.10 or newer installed.
51+
```
52+
4953
```{code-cell} ipython3
5054
# Uncomment the next line to install dependencies if needed.
5155
# !pip install s3fs astropy 'astroquery>=0.4.10' matplotlib

tutorials/euclid_access/1_Euclid_intro_MER_images.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ Each MER image is approximately 1.47 GB. Downloading can take some time.
5656

5757
## Imports
5858

59+
```{important}
60+
We rely on ``astroquery`` and ``sep`` features that have been recently added, so please make sure you have the respective version v0.4.10 and v1.4 or newer installed.
61+
```
62+
5963
```{code-cell} ipython3
6064
# Uncomment the next line to install dependencies if needed.
6165
# !pip install numpy 'astropy>=5.3' matplotlib 'astroquery>=0.4.10' 'sep>=1.4' fsspec

tutorials/euclid_access/2_Euclid_intro_MER_catalog.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ If you have questions about this notebook, please contact the [IRSA helpdesk](ht
4848

4949
## Imports
5050

51+
```{important}
52+
We rely on ``astroquery`` features that have been recently added, so please make sure you have version v0.4.10 or newer installed.
53+
```
54+
5155
```{code-cell} ipython3
5256
# Uncomment the next line to install dependencies if needed
5357
# !pip install numpy matplotlib 'astroquery>=0.4.10'
@@ -101,7 +105,7 @@ The MER catalog contains 476 columns, below are a few highlights:
101105

102106
### Define the following ADQL query to find the first 10k stars in the MER catalog
103107

104-
Since we are just using the MER catalog alone, it does not have a column for classification.
108+
Since we are just using the MER catalog alone, it does not have a column for classification.
105109
We can use the `point_like_flag = 1` or `point_like_prob > 0.99` for stars.
106110

107111
Set all the fluxes to be greater than 0 so the object is detected in all four Euclid MER mosaic images.
@@ -132,7 +136,7 @@ result_stars[:5]
132136
- Plot the color-magnitude diagram
133137

134138
```{code-cell} ipython3
135-
mag_y = -2.5 * np.log10(result_stars["flux_y_templfit"]) + 23.9
139+
mag_y = -2.5 * np.log10(result_stars["flux_y_templfit"]) + 23.9
136140
mag_h = -2.5 * np.log10(result_stars["flux_h_templfit"]) + 23.9
137141
138142
x = mag_y - mag_h # Y - H

tutorials/euclid_access/3_Euclid_intro_1D_spectra.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ If you have questions about it, please contact the [IRSA helpdesk](https://irsa.
4545

4646
## Imports
4747

48+
```{important}
49+
We rely on ``astroquery`` features that have been recently added, so please make sure you have version v0.4.10 or newer installed.
50+
```
51+
4852
```{code-cell} ipython3
4953
# Uncomment the next line to install dependencies if needed
5054
# !pip install matplotlib astropy 'astroquery>=0.4.10'

tutorials/euclid_access/4_Euclid_intro_PHZ_catalog.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ If you have questions about this notebook, please contact the [IRSA helpdesk](ht
4949

5050
## Imports
5151

52+
```{important}
53+
We rely on ``astroquery`` features that have been recently added, so please make sure you have version v0.4.10 or newer installed.
54+
```
55+
5256
```{code-cell} ipython3
5357
# Uncomment the next line to install dependencies if needed.
5458
# !pip install matplotlib 'astropy>=5.3' 'astroquery>=0.4.10' fsspec firefly_client
@@ -94,7 +98,7 @@ This searches specifically in the euclid_DpdMerBksMosaic "collection" which is t
9498
+++
9599

96100
```{note}
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.
101+
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.
98102
```
99103

100104
```{code-cell} ipython3
@@ -217,7 +221,7 @@ result_galaxies[:5]
217221
```
218222

219223
```{warning}
220-
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.
224+
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.
221225
222226
Once the bug is fixed, we plan to update the code in this notebook and simplify some of the approaches below.
223227
```
@@ -263,9 +267,9 @@ For more info, please visit the [WCSAxes documentation](https://docs.astropy.org
263267
```{code-cell} ipython3
264268
ax = plt.subplot(projection=cutout_image.wcs)
265269
266-
ax.imshow(cutout_image.data, cmap='gray', origin='lower',
270+
ax.imshow(cutout_image.data, cmap='gray', origin='lower',
267271
norm=ImageNormalize(cutout_image.data, interval=PercentileInterval(99.9), stretch=LogStretch()))
268-
plt.scatter(result_galaxies['ra'], result_galaxies['dec'], s=36, facecolors='none', edgecolors='red',
272+
plt.scatter(result_galaxies['ra'], result_galaxies['dec'], s=36, facecolors='none', edgecolors='red',
269273
transform=ax.get_transform('world'))
270274
271275
_ = plt.title('Galaxies between z = 1.4 and 1.6')
@@ -281,7 +285,7 @@ result_galaxies.sort(keys='flux_h_unif', reverse=True)
281285
result_galaxies[:3]
282286
```
283287

284-
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.
288+
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.
285289

286290
```{code-cell} ipython3
287291
index = 2
@@ -363,7 +367,7 @@ Plot to show the cutout on the galaxy
363367
```{code-cell} ipython3
364368
ax = plt.subplot(projection=cutout_galaxy.wcs)
365369
366-
ax.imshow(cutout_galaxy.data, cmap='gray', origin='lower',
370+
ax.imshow(cutout_galaxy.data, cmap='gray', origin='lower',
367371
norm=ImageNormalize(cutout_galaxy.data, interval=PercentileInterval(99.9), stretch=AsinhStretch()))
368372
```
369373

tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ If you have questions about this notebook, please contact the [IRSA helpdesk](ht
4848

4949
## Imports
5050

51+
```{important}
52+
We rely on ``astroquery`` features that have been recently added, so please make sure you have version v0.4.10 or newer installed.
53+
```
54+
5155
```{code-cell} ipython3
5256
# Uncomment the next line to install dependencies if needed
5357
# !pip install matplotlib astropy 'astroquery>=0.4.10'

tutorials/euclid_access/Euclid_ERO.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,18 @@ The total data volume required for running this notebook is less than 20 MB.
4949

5050
## Imports
5151

52-
First, we import all necessary packages.
52+
```{important}
53+
We rely on ``astroquery``, ``firefly_client``, ``photutils``, and ``sep`` features that have been recently added, so please make sure you have the respective versions v0.4.10, v3.2, v2.0, and v1.4 or newer installed.
54+
```
5355

5456
```{code-cell} ipython3
5557
# Uncomment the next line to install dependencies if needed.
5658
# !pip install tqdm numpy matplotlib astropy 'photutils>=2.0' 'astroquery>=0.4.10' 'sep>=1.4' 'firefly_client>=3.2'
5759
```
5860

61+
First, we import all necessary packages.
62+
63+
5964
```{code-cell} ipython3
6065
# General imports
6166
import os

0 commit comments

Comments
 (0)