Skip to content

Commit 99c1a17

Browse files
authored
Merge pull request #120 from lsst/tickets/SP-2937
SP-2937: updating the existing NB 302.3 to incorporate the revised ComCam->SDSS transformation equations from RTN-099 and to address user feedback provided in this Forum post.
2 parents 78489c5 + 3d6cb01 commit 99c1a17

1 file changed

Lines changed: 87 additions & 17 deletions

File tree

DP1/300_Science_Demos/302_Stars_MilkyWay_LocalVolume/302_3_Derived_stellar_properties.ipynb

Lines changed: 87 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"Data Release: <a href=\"https://dp1.lsst.io\">Data Preview 1</a> <br>\n",
2323
"Container Size: large <br>\n",
2424
"LSST Science Pipelines version: r29.2.0 <br>\n",
25-
"Last verified to run: 2025-10-29 <br>\n",
25+
"Last verified to run: 2026-02-17 <br>\n",
2626
"Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>\n",
2727
"DOI: <a href=\"https://doi.org/10.11578/rubin/dc.20250909.20\">10.11578/rubin/dc.20250909.20</a> <br>"
2828
]
@@ -74,6 +74,8 @@
7474
"\n",
7575
"This notebook converts photometry from the Rubin's ComCam system to SDSS system and applies these calibrated relations to photometric data for F- and G-type main-sequence stars with 0.2 < $g–r$ < 0.6 to infer $T_{eff}$ and [Fe/H]. The expected precision is ∼100 K in temperature and ∼0.2 dex in metallicity, limited mainly by $u$-band photometric errors.\n",
7676
"\n",
77+
"**Note:** This tutorial provides a pedagogical framework for illustrating how to handle the DP1 photometry and is not intended to serve as a definitive catalog of stellar parameters. Users should be aware that the derived physical quantities—particularly [Fe/H] and Galactocentric coordinates—are sensitive to systematic uncertainties in distance estimation and interstellar extinction.\n",
78+
"\n",
7779
"**References:** See [Ivezić et al. (2008)](https://ui.adsabs.harvard.edu/abs/2008ApJ...684..287I/abstract) for stellar parameter derivation using their colors, and [RTN-099](https://rtn-099.lsst.io/) for photometric transformation from the Rubin's ComCam photometry to SDSS system.\n",
7880
"\n",
7981
"**Related tutorials:** See the 300-level DP1 tutorial on the Milky Way foreground dust correction."
@@ -351,24 +353,91 @@
351353
"source": [
352354
"### 2.3. Convert photometry to SDSS system\n",
353355
"\n",
354-
"Transform the dust-corrected photometry to the SDSS system, following the equations from [RTN-099](https://rtn-099.lsst.io/)."
356+
"First, calculate various stellar colors using dust-corrected magnitudes and store them as arrays for use in subsequent color-color transformation task."
355357
]
356358
},
357359
{
358360
"cell_type": "code",
359361
"execution_count": null,
360-
"id": "1341ffdc-c169-454c-9689-c441bf90f669",
362+
"id": "7b6df3e3-cac8-4ea9-950e-024f53171a14",
361363
"metadata": {},
362364
"outputs": [],
363365
"source": [
364366
"ug = objtab[\"u_psfMag0\"] - objtab[\"g_psfMag0\"]\n",
365367
"gr = objtab[\"g_psfMag0\"] - objtab[\"r_psfMag0\"]\n",
366368
"gi = objtab[\"g_psfMag0\"] - objtab[\"i_psfMag0\"]\n",
367-
"ri = objtab[\"r_psfMag0\"] - objtab[\"i_psfMag0\"]\n",
369+
"ri = objtab[\"r_psfMag0\"] - objtab[\"i_psfMag0\"]"
370+
]
371+
},
372+
{
373+
"cell_type": "markdown",
374+
"id": "0534d9c7-c0dc-4bc8-ac78-4bfacb1899ec",
375+
"metadata": {},
376+
"source": [
377+
"Transform the LSSTComCam photometry in $gri$ to the SDSS system, following the equations in Section 1.3.5 of [RTN-099](https://rtn-099.lsst.io/). The valid color range of these transformations is $0.2 < (g-i)_{ComCam} < 3.0$."
378+
]
379+
},
380+
{
381+
"cell_type": "code",
382+
"execution_count": null,
383+
"id": "1341ffdc-c169-454c-9689-c441bf90f669",
384+
"metadata": {},
385+
"outputs": [],
386+
"source": [
387+
"gi_mask = (gi > 0.2) & (gi <= 3.0)\n",
368388
"\n",
369-
"gi_sdss = 1.065*gi + 0.005\n",
370-
"gr_sdss = 1.058*gr + 0.058*ri - 0.002\n",
371-
"u_sdss = objtab[\"u_psfMag0\"] + 0.063*gi**2 - 0.192*gi + 0.263"
389+
"g_sdss = np.where(gi_mask, objtab[\"g_psfMag0\"] + 0.066*gi - 0.006, np.nan)\n",
390+
"r_sdss = np.where(gi_mask, objtab[\"r_psfMag0\"] + 0.007*gi - 0.005, np.nan)\n",
391+
"i_sdss = np.where(gi_mask, objtab[\"i_psfMag0\"] + 0.012*gi - 0.020, np.nan)"
392+
]
393+
},
394+
{
395+
"cell_type": "markdown",
396+
"id": "2c60a63e-fe42-4d38-a79e-7b72ae546b9b",
397+
"metadata": {},
398+
"source": [
399+
"Since LSSTComCam DP1 $u$-band exposures do not overlap with SDSS footprints, utilize synthetic photometry based on the Pickles Stellar Spectra Library ([Pickles 1998](https://iopscience.iop.org/article/10.1086/316197)) to derive the $u$-band transformations. Refer to Section 1.2.3 of [RTN-099](https://rtn-099.lsst.io/) for the detailed derivation and validation of these synthetic coefficients."
400+
]
401+
},
402+
{
403+
"cell_type": "code",
404+
"execution_count": null,
405+
"id": "6c8dcb6b-bc9b-45f3-a220-211329952ca2",
406+
"metadata": {},
407+
"outputs": [],
408+
"source": [
409+
"u_masks = [\n",
410+
" (gi > -1.1) & (gi <= -0.4),\n",
411+
" (gi > -0.4) & (gi <= 0.8),\n",
412+
" (gi > 0.8) & (gi <= 3.9)\n",
413+
"]\n",
414+
"u_outputs = [\n",
415+
" objtab[\"u_psfMag0\"] + 0.587*gi**2 + 1.424*gi + 0.758,\n",
416+
" objtab[\"u_psfMag0\"] + 0.063*gi**2 - 0.192*gi + 0.263,\n",
417+
" objtab[\"u_psfMag0\"] - 0.0003*gi**2 + 0.174*gi + 0.059\n",
418+
"]\n",
419+
"u_sdss = np.select(u_masks, u_outputs, default=np.nan)"
420+
]
421+
},
422+
{
423+
"cell_type": "markdown",
424+
"id": "46f6a525-cd24-4b97-881f-04d8993a070b",
425+
"metadata": {},
426+
"source": [
427+
"Calculate the required SDSS stellar colors and store them as new arrays for subsequent analysis."
428+
]
429+
},
430+
{
431+
"cell_type": "code",
432+
"execution_count": null,
433+
"id": "c97d1db9-7c50-409d-b7fc-7a78b7b3dfea",
434+
"metadata": {},
435+
"outputs": [],
436+
"source": [
437+
"ug_sdss = u_sdss - g_sdss\n",
438+
"gr_sdss = g_sdss - r_sdss\n",
439+
"gi_sdss = g_sdss - i_sdss\n",
440+
"ri_sdss = r_sdss - i_sdss"
372441
]
373442
},
374443
{
@@ -388,11 +457,11 @@
388457
"metadata": {},
389458
"outputs": [],
390459
"source": [
391-
"g_cri = (objtab[\"g_psfMag0\"] > 14) & (objtab[\"g_psfMag0\"] < 19.5)\n",
392-
"gr_cri = (gr > 0.2) & (gr < 0.6)\n",
393-
"ug_gr_cri = ((ug > 0.7) & (ug < 2.0) &\n",
394-
" (gr - 0.5 * ug > -0.25) & (gr - 0.5 * ug < 0.05))\n",
395-
"gr_ri_cri = (0.35*gr - ri > -0.2) & (0.35*gr - ri < 0.1)"
460+
"g_cri = (g_sdss > 14) & (g_sdss < 19.5)\n",
461+
"gr_cri = (gr_sdss > 0.2) & (gr_sdss < 0.6)\n",
462+
"ug_gr_cri = ((ug_sdss > 0.7) & (ug_sdss < 2.0) &\n",
463+
" (gr_sdss - 0.5*ug_sdss > -0.25) & (gr_sdss - 0.5*ug_sdss < 0.05))\n",
464+
"gr_ri_cri = (0.35*gr_sdss - ri_sdss > -0.2) & (0.35*gr_sdss - ri_sdss < 0.1)"
396465
]
397466
},
398467
{
@@ -403,7 +472,7 @@
403472
"outputs": [],
404473
"source": [
405474
"sel = (A_band[\"r\"] < 0.3) & g_cri & gr_cri & ug_gr_cri & gr_ri_cri\n",
406-
"print(f\"There are {len(gr[sel])} stars suitable for this analysis.\")"
475+
"print(f\"There are {len(gr_sdss[sel])} stars suitable for this analysis.\")"
407476
]
408477
},
409478
{
@@ -451,7 +520,8 @@
451520
"metadata": {},
452521
"outputs": [],
453522
"source": [
454-
"plt.scatter(np.ma.filled(ug[sel], np.nan), np.ma.filled(gr[sel], np.nan),\n",
523+
"plt.scatter(np.ma.filled(ug_sdss[sel], np.nan),\n",
524+
" np.ma.filled(gr_sdss[sel], np.nan),\n",
455525
" c=10**np.ma.filled(log_teff, np.nan), cmap=plt.cm.jet_r)\n",
456526
"plt.xlabel('u-g')\n",
457527
"plt.ylabel('g-r')\n",
@@ -535,7 +605,7 @@
535605
"metadata": {},
536606
"outputs": [],
537607
"source": [
538-
"feh = feh_phot_ivezic2008(ug[sel], gr[sel])"
608+
"feh = feh_phot_ivezic2008(ug_sdss[sel], gr_sdss[sel])"
539609
]
540610
},
541611
{
@@ -553,7 +623,7 @@
553623
"metadata": {},
554624
"outputs": [],
555625
"source": [
556-
"plt.scatter(ug[sel], gr[sel], c=feh, cmap=plt.cm.jet)\n",
626+
"plt.scatter(ug_sdss[sel], gr_sdss[sel], c=feh, cmap=plt.cm.jet)\n",
557627
"plt.xlabel('u-g')\n",
558628
"plt.ylabel('g-r')\n",
559629
"cb = plt.colorbar()\n",
@@ -631,7 +701,7 @@
631701
"metadata": {},
632702
"outputs": [],
633703
"source": [
634-
"dmod = objtab[\"r_psfMag0\"][sel] - mr_phot_ivezic2008(gi[sel], feh)\n",
704+
"dmod = r_sdss[sel] - mr_phot_ivezic2008(gi_sdss[sel], feh)\n",
635705
"dist = 10**(0.2*(dmod+5))/1e3"
636706
]
637707
},

0 commit comments

Comments
 (0)