Skip to content

Commit e9155bd

Browse files
committed
Apply review feedback from Brigitta and Jaladh
1 parent 3736f2b commit e9155bd

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

tutorials/parquet-catalog-demos/euclid-q1-hats/1-euclid-q1-hats-intro.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ external_flux_columns[:4]
334334
+++
335335

336336
Euclid Q1 includes data from three Euclid Deep Fields: EDF-N (North), EDF-S (South), EDF-F (Fornax; also in the southern hemisphere).
337-
There is also a small amount of data from a fourth field: LDN1641 (Lynds' Dark Nebula 1641), which was observed for technical reasons during Euclid's verification phase and mostly ignored here.
337+
There is also a small amount of data from a fourth field: LDN1641 (Lynds' Dark Nebula 1641), which was observed for technical reasons during Euclid's verification phase.
338338
The fields are described in [Euclid Collaboration: Aussel et al., 2025](https://arxiv.org/pdf/2503.15302) and can be seen on this [skymap](https://irsa.ipac.caltech.edu/data/download/parquet/euclid/q1/merged_objects/hats/euclid_q1_merged_objects-hats/skymap.png).
339339

340340
The regions are well separated, so we can distinguish them using a simple cone search without having to be too picky about the radius.
@@ -362,7 +362,8 @@ ldn_k9_pixels = hpgeom.query_circle(hpgeom.order_to_nside(9), ra, dec, radius, i
362362
## 6. Basic Query
363363

364364
To demonstrate a basic query, we'll search for objects with a galaxy photometric redshift estimate of 6.0 (largest possible).
365-
Other tutorials in this series will show more complex queries and describe the redshifts and other data in more detail.
365+
Other tutorials in this series will show more complex queries, and describe the redshifts and other data in more detail.
366+
PyArrow dataset filters are described at [Filtering by Expressions](https://arrow.apache.org/docs/python/compute.html#filtering-by-expressions), and the list of available functions is at [Compute Functions](https://arrow.apache.org/docs/python/api/compute.html).
366367

367368
```{code-cell} ipython3
368369
dataset = pyarrow.dataset.dataset(dataset_path, partitioning="hive", filesystem=s3, schema=schema)
@@ -377,6 +378,6 @@ highz_objects
377378

378379
**Authors:** Troy Raen, Vandana Desai, Andreas Faisst, Shoubaneh Hemmati, Jaladh Singhal, Brigitta Sipőcz, Jessica Krick, the IRSA Data Science Team, and the Euclid NASA Science Center at IPAC (ENSCI).
379380

380-
**Updated:** 2025-12-22
381+
**Updated:** 2025-12-23
381382

382383
**Contact:** [IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html)

tutorials/parquet-catalog-demos/euclid-q1-hats/4-euclid-q1-hats-magnitudes.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ PHZ_CLASS = "phz_phz_classification"
107107
```
108108

109109
We'll convert the catalog fluxes to magnitudes following the [MER Photometry Cookbook](http://st-dm.pages.euclid-sgs.uk/data-product-doc/dmq1/merdpd/merphotometrycookbook.html).
110-
For convenience, we'll have PyArrow do the conversion during the read operation and return only the magnitudes.
110+
PyArrow can do the conversion during the read operation and return only the magnitudes.
111+
To do this, we'll use the following function to define the magnitudes as `pyarrow.compute` (`pc`) functions, which are described at [Compute Functions](https://arrow.apache.org/docs/python/api/compute.html).
111112

112113
```{code-cell} ipython3
113114
def flux_to_magnitude(flux_col_name: str) -> pc.Expression:
@@ -151,7 +152,9 @@ def flux_to_magnitude(flux_col_name: str) -> pc.Expression:
151152
```
152153

153154
Define the columns we want to load.
154-
This needs to be a dictionary of PyArrow expressions (rather than a simple list of column names) because we're asking PyArrow to convert flux -> magnitude before returning the data.
155+
This needs to be a dictionary (rather than a simple list of column names) because we're asking PyArrow to compute the magnitudes dynamically from the catalog fluxes.
156+
The dictionary keys will be the column names in the resultant table.
157+
The values must be `pyarrow.compute` expressions (described above).
155158

156159
```{code-cell} ipython3
157160
I_MAG = "I (mag)"
@@ -215,6 +218,14 @@ Since the template-fit photometry is recommended for extended objects, we'll sep
215218
[Euclid Collaboration: Tucci et al., 2025](https://arxiv.org/pdf/2503.15306) defines point-like objects as having `MUMAX_MINUS_MAG < -2.5`.
216219

217220
```{code-cell} ipython3
221+
222+
```
223+
224+
```{code-cell} ipython3
225+
---
226+
jupyter:
227+
source_hidden: true
228+
---
218229
# Galaxy + any. Star + galaxy. QSO + galaxy.
219230
classes = {"Galaxy": (2, 3, 6, 7), "Star": (1, 3), "QSO": (4, 6)}
220231
class_colors = ["tab:green", "tab:blue", "tab:orange"]
@@ -252,6 +263,7 @@ for ax in axes[:, 0]:
252263
for axs, band in zip(axes.transpose(), bands):
253264
axs[0].set_title(band.split()[0])
254265
axs[-1].set_xlabel(band)
266+
plt.title("Magnitude Distributions by Object Type")
255267
plt.tight_layout()
256268
```
257269

@@ -282,11 +294,18 @@ This comparison reveals systematic offsets that depend on factors including morp
282294
This figure is inspired by Romelli Fig. 6 (top panel).
283295

284296
```{code-cell} ipython3
297+
298+
```
299+
300+
```{code-cell} ipython3
301+
---
302+
jupyter:
303+
source_hidden: true
304+
---
285305
# Only consider objects within these mag and mag difference limits.
286306
mag_limits, mag_diff_limits = (16, 24), (-1, 1)
287307
mag_limited_df = mags_df.loc[(mags_df[I_MAG] > mag_limits[0]) & (mags_df[I_MAG] < mag_limits[1])]
288308
289-
fig, axes = plt.subplots(2, 3, figsize=(18, 9), sharey=True, sharex=True)
290309
bands = [
291310
("Y templfit (mag)", "Y aperture (mag)"),
292311
("J templfit (mag)", "J aperture (mag)"),
@@ -300,6 +319,7 @@ annotate_kwargs = dict(
300319
)
301320
302321
# Plot
322+
fig, axes = plt.subplots(2, 3, figsize=(18, 9), sharey=True, sharex=True)
303323
for axs, (ref_band, aper_band) in zip(axes.transpose(), bands):
304324
# Extended objects, top row.
305325
ax = axs[0]
@@ -338,6 +358,7 @@ for i, ax in enumerate(axes.flatten()):
338358
ax.set_title("Point-like objects")
339359
if i > 2:
340360
ax.set_xlabel(I_MAG)
361+
plt.title("Magnitude Differences: Template-fit - Aperture")
341362
plt.tight_layout()
342363
```
343364

@@ -352,6 +373,6 @@ The offset is more pronounced for point-like objects (bottom row), likely due to
352373

353374
**Authors:** Troy Raen, Vandana Desai, Andreas Faisst, Shoubaneh Hemmati, Jaladh Singhal, Brigitta Sipőcz, Jessica Krick, the IRSA Data Science Team, and the Euclid NASA Science Center at IPAC (ENSCI).
354375

355-
**Updated:** 2025-12-22
376+
**Updated:** 2025-12-23
356377

357378
**Contact:** [IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html)

0 commit comments

Comments
 (0)