Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"Data Release: [Prompt Products](https://prompt-products.lsst.io/)\\\n",
"Container Size: Large\\\n",
"LSST Science Pipelines version: r30.0.11\\\n",
"Last verified to run: 2026-11-24\\\n",
"Last verified to run: 2026-12-01\\\n",
"Repository: [github.com/lsst/tutorial-notebooks](https://github.com/lsst/tutorial-notebooks)\\\n",
"DOI: [10.11578/rubin/dc.20250909.20](https://doi.org/10.11578/rubin/dc.20250909.20)"
]
Expand All @@ -34,7 +34,7 @@
"source": [
"**Learning objective:** Cross match to a list of extragalactic transients and retrieve light curves.\n",
"\n",
"**LSST data products:** `ppdb.DiaForcedSource`, `ppdb.DiaObject`\n",
"**LSST data products:** `ppdb.DiaSource`, `ppdb.DiaObject`, `ppdb.DiaForcedSource`\n",
"\n",
"**Packages:** `lsst.rsp`\n",
"\n",
Expand All @@ -43,7 +43,7 @@
"Please consider acknowledging them if this notebook is used for the preparation of journal articles, software releases, or other notebooks.\n",
"\n",
"**Get Support:**\n",
"Everyone is encouraged to ask questions or raise issues in the [Support Category](https://community.lsst.org/c/support) of the Rubin Community Forum.\n",
"Everyone is encouraged to ask questions or raise issues in the [Support Category](https://rubin.community/c/support) of the Rubin Community Forum.\n",
"Rubin staff will respond to all questions posted there."
]
},
Expand All @@ -57,11 +57,11 @@
"This tutorial demonstrates how to make efficient queries for the common question of \"does LSST have difference-image light curves at these sky coordinates?\" \n",
"\n",
"**Do not query source tables by coordinate.**\n",
"Queries *by coordinate* on the `DiaSource` or `DiaForcedSource` table are very inefficient, because these tables contain measurements on many images at the exact same coordinates.\n",
"Queries *by coordinate* on the `DiaSource` or `DiaForcedSource` table are very inefficient, because these tables contain measurements on many images at the same coordinates.\n",
"It is more efficient to do the spatial cross-match with `DiaObject` once, and then retrieve fluxes for successful matches based on the diaObjectId.\n",
"\n",
"**Avoid putting asynchronous queries into `for` loops.**\n",
"Although it is possible loop over a set of RA/Dec and make a spatial cross-match query for each coordinate, this should be avoided.\n",
"Although it is possible to loop over a set of RA/Dec and make a spatial cross-match query for each coordinate, this should be avoided.\n",
"TAP queries have a rate limit to prevent the shared system from being overloaded by a single user with many queries executing simultaneously.\n",
"\n",
"**The correct method is to upload a table of coordinates and cross-match using a TAP table join.**\n",
Expand All @@ -83,12 +83,8 @@
"id": "ccb4fe61-835a-47ac-a691-e086ce766e79",
"metadata": {},
"source": [
"Import `numpy`, a fundamental package for scientific computing with arrays in Python\n",
"(<a href=\"https://numpy.org\">numpy.org</a>), and\n",
"`matplotlib`, a comprehensive library for data visualization\n",
"(<a href=\"https://matplotlib.org/\">matplotlib.org</a>; \n",
"<a href=\"https://matplotlib.org/stable/gallery/index.html\">matplotlib gallery</a>).\n",
"From the `lsst` package, import modules for accessing the Table Access Protocol (TAP) service and image display functions from the LSST Science Pipelines (<a href=\"https://pipelines.lsst.io/\">pipelines.lsst.io</a>)."
"Import `numpy`, a fundamental package for scientific computing with arrays in Python ([numpy.org](https://numpy.org)); `matplotlib`, a comprehensive library for data visualization ([matplotlib.org](https://matplotlib.org/); [matplotlib gallery](https://matplotlib.org/stable/gallery/index.html)); and `astropy`, package contains key functionality and common tools needed for performing astronomy and astrophysics with Python ([docs.astropy.org](https://docs.astropy.org/en/stable/index.html)).\n",
"From the `lsst` package, import modules for accessing the Table Access Protocol (TAP) service and plot-style utilities from the LSST Science Pipelines ([pipelines.lsst.io](https://pipelines.lsst.io/))."
]
},
{
Expand Down Expand Up @@ -140,7 +136,7 @@
"id": "9b02d9d2-23ce-48c4-8265-460604817467",
"metadata": {},
"source": [
"Define filter names, plot markers, and colors for plotting"
"Define filter names, plot markers, and colors for plotting."
]
},
{
Expand All @@ -163,10 +159,10 @@
"source": [
"## 2. Load the coordinate list\n",
"\n",
"A list of classified supernovae that were reported to the [Transient Name Server](https://www.wis-tns.org/) (TNS) around the time when Prompt Processing restarted in Oct 2026 has been generated for this demonstration.\n",
"A list of classified supernovae (SN) that were reported to the [Transient Name Server](https://www.wis-tns.org/) (TNS) around the time when Prompt Processing restarted in Oct 2026 has been generated for this demonstration.\n",
"The file was generated on Nov 24 2026.\n",
"\n",
"The TNS search query was executed by:\n",
"The following [TNS Search](https://www.wis-tns.org/search) page query settings were used:\n",
"* setting \"reported within the last\" 3 months\n",
"* checking the box \"Limit to classified supernovae\" \n",
"* setting the Discovery Date Range to Oct 1 2026 to Nov 24 2026\n",
Expand Down Expand Up @@ -225,8 +221,7 @@
"date_run = Time(\"2026-11-24\", format=\"iso\", scale=\"utc\")\n",
"query = \"\"\"\n",
" SELECT diao.diaObjectId, diao.ra, diao.dec, diao.nDiaSources,\n",
" ut.ra AS ut_ra, ut.dec AS ut_dec,\n",
" ut.name AS ut_name, ut.type AS ut_type, ut.disc_mjd AS ut_disc_mjd,\n",
" ut.ra AS ut_ra, ut.dec AS ut_dec, ut.name AS ut_name,\n",
" DISTANCE(POINT('ICRS', diao.ra, diao.dec),\n",
" POINT('ICRS', ut.ra, ut.dec)) AS distance\n",
" FROM ppdb.DiaObject AS diao\n",
Expand Down Expand Up @@ -327,7 +322,7 @@
"metadata": {},
"source": [
"For any SN that had more than one cross-match result to the `DiaObject` table, the following cell would print its name and the number of matches, and also the identifier, number of diaSources, and the sky distances for each match.\n",
"When a cross-match yields duplicates, the real astrophyscial transients are usually the closest diaObject or the one with lots of detections (as spurious artifacts are often only detected once).\n",
"When a cross-match yields duplicates, the real astrophysical transients are usually the closest diaObject or the one with lots of detections (as spurious artifacts are often only detected once).\n",
"This is not needed for this sample, as there were no duplicates."
]
},
Expand Down Expand Up @@ -366,7 +361,7 @@
"id": "64cdae6d-aa97-4001-bef6-ef6cab0956a1",
"metadata": {},
"source": [
"### 3.2. Histogram of nDiaSource\n",
"### 3.2. Histogram of nDiaSources\n",
"\n",
"Plot a histogram of the number of detections (`nDiaSources`) per object."
]
Expand Down Expand Up @@ -477,7 +472,7 @@
"id": "c6a93cbe-5150-4695-a901-4802329dfec9",
"metadata": {},
"source": [
"For SN 2026ahhp, plot the lightcurve with both the detections (diaSources) and forced flux measurements."
"For SN 2026ahhp ([Forster et al. 2026](https://scixplorer.org/abs/2026TNSTR4361....1F/)), which has relatively good light curve sampling, plot the light curve with both the detections (diaSources) and forced flux measurements."
]
},
{
Expand All @@ -491,7 +486,7 @@
"dsx = np.where(dias_fluxes['diaObjectId'] == diao_table['diaObjectId'][i])[0]\n",
"dfsx = np.where(diafs_fluxes['diaObjectId'] == diao_table['diaObjectId'][i])[0]\n",
"fig = plt.figure(figsize=(10, 4))\n",
"for f, filt in enumerate(filter_names):\n",
"for filt in filter_names:\n",
" fx = np.where(dias_fluxes['band'][dsx] == filt)[0]\n",
" plt.errorbar(dias_fluxes['midpointMjdTai'][dsx[fx]],\n",
" dias_fluxes['psfFlux'][dsx[fx]],\n",
Expand Down Expand Up @@ -519,15 +514,15 @@
"id": "c5084a51-5522-44c1-a901-a4c4147fee12",
"metadata": {},
"source": [
">**Figure 2:** The lightcurve for the diaObject cross-matched to SN 2026ahhp. The SNR>5 detected diaSources are shown as empty symbols (as in the legend), and the forced fluxes as solid transparent symbols."
">**Figure 2:** The light curve for the diaObject cross-matched to SN 2026ahhp. The SNR>5 detected diaSources are shown as empty symbols (as in the legend), and the forced fluxes as solid transparent symbols."
]
},
{
"cell_type": "markdown",
"id": "4f25bd28-d65b-4dfb-8401-81a3a79af93f",
"metadata": {},
"source": [
"Option to create lightcurves for all matched diaObjects."
"Option to create light curves for all matched diaObjects."
]
},
{
Expand All @@ -541,7 +536,7 @@
"# dsx = np.where(dias_fluxes['diaObjectId'] == diao_table['diaObjectId'][i])[0]\n",
"# dfsx = np.where(diafs_fluxes['diaObjectId'] == diao_table['diaObjectId'][i])[0]\n",
"# fig = plt.figure(figsize=(10, 2))\n",
"# for f, filt in enumerate(filter_names):\n",
"# for filt in filter_names:\n",
"# fx = np.where(dias_fluxes['band'][dsx] == filt)[0]\n",
"# plt.errorbar(dias_fluxes['midpointMjdTai'][dsx[fx]],\n",
"# dias_fluxes['psfFlux'][dsx[fx]],\n",
Expand Down
Loading