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: <a href=\"https://dp1.lsst.io/\">Data Preview 1</a> <br>\n",
Comment thread
galaxyumi marked this conversation as resolved.
Comment thread
galaxyumi marked this conversation as resolved.
"Container Size: large <br>\n",
"LSST Science Pipelines version: Release r29.2.0 <br>\n",
"Last verified to run: 2026-01-29 <br>\n",
"Last verified to run: 2026-03-20 <br>\n",
"Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>\n",
"DOI: [10.11578/rubin/dc.20250909.20](https://doi.org/10.11578/rubin/dc.20250909.20)"
]
Expand Down Expand Up @@ -321,7 +321,7 @@
"id": "c6850c41-c942-4a4c-903b-4969751866f4",
"metadata": {},
"source": [
"> Figure 1: Lightcurve statistics of all candidates from the TAP search as a function of r magnitude. Upper left: `r_psfFluxSigma` vs. magnitude. Upper right: `r_psfFluxChi2` vs. magnitude. Lower left: `r_psfFluxStetsonJ` vs. magnitude. Lower right: `r_psfFluxIQRFrac` (the interquartile range) vs. magnitude."
"> **Figure 1:** Lightcurve statistics of all candidates from the TAP search as a function of r magnitude. Upper left: `r_psfFluxSigma` vs. magnitude. Upper right: `r_psfFluxChi2` vs. magnitude. Lower left: `r_psfFluxStetsonJ` vs. magnitude. Lower right: `r_psfFluxIQRFrac` (the interquartile range) vs. magnitude."
]
},
{
Expand Down Expand Up @@ -440,7 +440,7 @@
"id": "ad83ae9b-e0af-40a0-a032-66292d7f7806",
"metadata": {},
"source": [
"> Figure 2: Panels the same as in Figure 1, but with the selected candidate variables highlighted as black stars, demonstrating that the candidates are all well above the thresholds used for selection."
"> **Figure 2:** Panels the same as in Figure 1, but with the selected candidate variables highlighted as black stars, demonstrating that the candidates are all well above the thresholds used for selection."
]
},
{
Expand Down Expand Up @@ -480,7 +480,7 @@
" \"FROM dp1.ForcedSourceOnDiaObject as fsodo \"\n",
" \"JOIN dp1.CcdVisit as cv \"\n",
" \"ON (cv.visitId = fsodo.visit AND cv.detector = fsodo.detector)\"\n",
" \"WHERE diaObjectId = \"+str(id))\n",
" \"WHERE pixelFlags_bad = 0 AND diaObjectId = \"+str(id))\n",
"\n",
" results = results.to_table()\n",
" results_dict[id] = results\n",
Expand Down Expand Up @@ -508,7 +508,7 @@
"id": "72cb849d-7663-43ce-8802-8ae9b729ceb8",
"metadata": {},
"source": [
"> Figure 3: Lightcurves of all selected candidates. Each panel shows the measured difference-image flux (`psfDiffFlux`) in nanoJanskies vs. observation time in MJD days."
"> **Figure 3:** Lightcurves of all selected candidates. Each panel shows the measured difference-image flux (`psfDiffFlux`) in nanoJanskies vs. observation time in MJD days."
]
},
{
Expand Down Expand Up @@ -538,19 +538,23 @@
" results = results_dict[id]\n",
" print(f\"number of measurements: {len(results)}\")\n",
"\n",
" ############################\n",
" ### Plot a phased lightcurve\n",
" minfreq = 1 / (1.0*u.d)\n",
" maxfreq = 1 / (0.05*u.d)\n",
"\n",
" obj_mjd_days = np.array(results['expMidptMJD']) * u.day\n",
" obj_fluxes = np.array(results['psfFlux'])\n",
" obj_flux_errs = np.array(results['psfFluxErr'])\n",
" obj_frequency, obj_power =\\\n",
" LombScargleMultiband(obj_mjd_days, obj_fluxes,\n",
" results['band'], obj_flux_errs).autopower(minimum_frequency=minfreq,\n",
" maximum_frequency=maxfreq,\n",
" samples_per_peak=20)\n",
" ls_model = LombScargleMultiband(\n",
" obj_mjd_days,\n",
" obj_fluxes,\n",
" results['band'],\n",
" obj_flux_errs\n",
" )\n",
" obj_frequency, obj_power = ls_model.autopower(\n",
" minimum_frequency=minfreq,\n",
" maximum_frequency=maxfreq,\n",
" samples_per_peak=20\n",
" )\n",
" max_power = np.argmax(obj_power)\n",
" obj_freq = obj_frequency[max_power]\n",
" obj_period = 1.0 / obj_freq\n",
Expand Down Expand Up @@ -590,7 +594,7 @@
"id": "cf33e572-eaaf-498e-b937-30ead59b6ccd",
"metadata": {},
"source": [
"> Figure 4: As in Figure 3, the figure shows lightcurves of all selected candidates. In this plot, vertical axis shows PSF magnitudes from forced measurements on the direct images. The horizontal axis shows phase, which runs from 0 to 1, placing each observed point into the proper phase of the variable's measured period."
"> **Figure 4:** As in Figure 3, the figure shows lightcurves of all selected candidates. In this plot, the vertical axis shows PSF magnitudes from forced measurements on the direct images. The horizontal axis shows phase, which runs from 0 to 1, placing each observed point into the proper phase of the variable's measured period."
]
},
{
Expand Down Expand Up @@ -628,11 +632,9 @@
" min_freq = 1.0 / max_period\n",
" max_freq = 1.0 / min_period\n",
"\n",
" # Select the star based on its ID, and measurements in the requested band\n",
" results = results_dict[my_id]\n",
" results_band = results[results['band'] == pick_band]\n",
"\n",
" # Run Lomb-Scargle and pick the \"best\" frequency\n",
" obj_mjd_days_band = np.array(results_band['expMidptMJD']) * u.day\n",
" obj_fluxes_band = np.array(results_band['psfFlux'])\n",
" obj_frequency, obj_power =\\\n",
Expand All @@ -643,7 +645,6 @@
" peakbin = np.argmax(obj_power)\n",
" mean_peak_freq = obj_frequency[peakbin].value\n",
"\n",
" # Plot the frequency and power from Lomb-Scargle\n",
" fig, ax = plt.subplots(1, 2, figsize=(6, 3))\n",
"\n",
" plt.sca(ax[0])\n",
Expand Down Expand Up @@ -677,7 +678,6 @@
"\n",
" mag = (obj_fluxes*u.nJy).to(u.ABmag).value\n",
"\n",
" # Plot a phased lightcurve\n",
" fig = plt.figure(figsize=(6.5, 3))\n",
"\n",
" for band in ['g', 'r', 'i', 'z']:\n",
Expand All @@ -688,15 +688,23 @@
" ms=8, mew=0, alpha=0.5, label=band)\n",
"\n",
" plt.gca().invert_yaxis()\n",
" plt.legend()\n",
" plt.title(f\"{my_id}; period: {obj_period: .8F}\")\n",
" plt.legend(ncol=4, loc=\"lower right\")\n",
" plt.title(f\"Period: {obj_period: .8F}\")\n",
" plt.xlabel('phase')\n",
" plt.ylabel('magnitude')\n",
" plt.ylim(np.nanpercentile(mag, 95)+0.3, np.nanpercentile(mag, 5)-0.3)\n",
" plt.minorticks_on()\n",
" plt.show()"
]
},
{
"cell_type": "markdown",
"id": "287b30df-e721-4c3f-9e4e-e3e0657015b9",
"metadata": {},
"source": [
"Execute the period refinement function to improve the precision of each candidate and review the resulting phased light curves."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -713,7 +721,7 @@
"id": "47f3948a-64e6-435d-bfdc-880534d79e76",
"metadata": {},
"source": [
"> Figure 5: As in Figure 4, the lower panel of each figure shows a lightcurve for each selected candidate, in magnitude vs. phase. The upper plot for each candidate shows Lomb-Scargle \"power\" vs. frequency on the left, and power vs. period on the right. The selected \"best\" period is marked with a vertical red line in each panel. The lightcurves are phased with this period, and the period is labeled at the top of the lightcurve."
"> **Figure 5:** As in Figure 4, the lower panel of each figure shows a lightcurve for each selected candidate, in magnitude vs. phase. The upper plot for each candidate shows Lomb-Scargle \"power\" vs. frequency on the left, and power vs. period on the right. The selected \"best\" period is marked with a vertical red line in each panel. The lightcurves are phased with this period, and the period is labeled at the top of the lightcurve."
]
},
{
Expand Down Expand Up @@ -755,26 +763,26 @@
" if i == 0:\n",
" tab = simbad_dict[key]\n",
" else:\n",
" tab = vstack([tab, simbad_dict[key]])"
" tab = vstack(list(simbad_dict.values()), metadata_conflicts='silent')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cbfb7d26-e64d-4f24-97c5-32b44ca49c60",
"cell_type": "markdown",
"id": "7980ebe4-e6fe-4960-932f-c460d8963f05",
"metadata": {},
"outputs": [],
"source": [
"tab"
"Print out the stacked table."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "17b494c9-9a90-49f3-a57d-2673378d53ce",
"id": "cbfb7d26-e64d-4f24-97c5-32b44ca49c60",
"metadata": {},
"outputs": [],
"source": []
"source": [
"tab"
]
}
],
"metadata": {
Expand All @@ -793,7 +801,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.9"
"version": "3.12.11"
},
"toc-autonumbering": false
},
Expand Down
Loading