|
22 | 22 | "Data Release: <a href=\"https://dp1.lsst.io/\">Data Preview 1</a> <br>\n", |
23 | 23 | "Container Size: large <br>\n", |
24 | 24 | "LSST Science Pipelines version: Release r29.2.0 <br>\n", |
25 | | - "Last verified to run: 2026-01-29 <br>\n", |
| 25 | + "Last verified to run: 2026-03-20 <br>\n", |
26 | 26 | "Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>\n", |
27 | 27 | "DOI: [10.11578/rubin/dc.20250909.20](https://doi.org/10.11578/rubin/dc.20250909.20)" |
28 | 28 | ] |
|
321 | 321 | "id": "c6850c41-c942-4a4c-903b-4969751866f4", |
322 | 322 | "metadata": {}, |
323 | 323 | "source": [ |
324 | | - "> 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." |
| 324 | + "> **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." |
325 | 325 | ] |
326 | 326 | }, |
327 | 327 | { |
|
440 | 440 | "id": "ad83ae9b-e0af-40a0-a032-66292d7f7806", |
441 | 441 | "metadata": {}, |
442 | 442 | "source": [ |
443 | | - "> 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." |
| 443 | + "> **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." |
444 | 444 | ] |
445 | 445 | }, |
446 | 446 | { |
|
480 | 480 | " \"FROM dp1.ForcedSourceOnDiaObject as fsodo \"\n", |
481 | 481 | " \"JOIN dp1.CcdVisit as cv \"\n", |
482 | 482 | " \"ON (cv.visitId = fsodo.visit AND cv.detector = fsodo.detector)\"\n", |
483 | | - " \"WHERE diaObjectId = \"+str(id))\n", |
| 483 | + " \"WHERE pixelFlags_bad = 0 AND diaObjectId = \"+str(id))\n", |
484 | 484 | "\n", |
485 | 485 | " results = results.to_table()\n", |
486 | 486 | " results_dict[id] = results\n", |
|
508 | 508 | "id": "72cb849d-7663-43ce-8802-8ae9b729ceb8", |
509 | 509 | "metadata": {}, |
510 | 510 | "source": [ |
511 | | - "> Figure 3: Lightcurves of all selected candidates. Each panel shows the measured difference-image flux (`psfDiffFlux`) in nanoJanskies vs. observation time in MJD days." |
| 511 | + "> **Figure 3:** Lightcurves of all selected candidates. Each panel shows the measured difference-image flux (`psfDiffFlux`) in nanoJanskies vs. observation time in MJD days." |
512 | 512 | ] |
513 | 513 | }, |
514 | 514 | { |
|
538 | 538 | " results = results_dict[id]\n", |
539 | 539 | " print(f\"number of measurements: {len(results)}\")\n", |
540 | 540 | "\n", |
541 | | - " ############################\n", |
542 | | - " ### Plot a phased lightcurve\n", |
543 | 541 | " minfreq = 1 / (1.0*u.d)\n", |
544 | 542 | " maxfreq = 1 / (0.05*u.d)\n", |
545 | 543 | "\n", |
546 | 544 | " obj_mjd_days = np.array(results['expMidptMJD']) * u.day\n", |
547 | 545 | " obj_fluxes = np.array(results['psfFlux'])\n", |
548 | 546 | " obj_flux_errs = np.array(results['psfFluxErr'])\n", |
549 | | - " obj_frequency, obj_power =\\\n", |
550 | | - " LombScargleMultiband(obj_mjd_days, obj_fluxes,\n", |
551 | | - " results['band'], obj_flux_errs).autopower(minimum_frequency=minfreq,\n", |
552 | | - " maximum_frequency=maxfreq,\n", |
553 | | - " samples_per_peak=20)\n", |
| 547 | + " ls_model = LombScargleMultiband(\n", |
| 548 | + " obj_mjd_days,\n", |
| 549 | + " obj_fluxes,\n", |
| 550 | + " results['band'],\n", |
| 551 | + " obj_flux_errs\n", |
| 552 | + " )\n", |
| 553 | + " obj_frequency, obj_power = ls_model.autopower(\n", |
| 554 | + " minimum_frequency=minfreq,\n", |
| 555 | + " maximum_frequency=maxfreq,\n", |
| 556 | + " samples_per_peak=20\n", |
| 557 | + " )\n", |
554 | 558 | " max_power = np.argmax(obj_power)\n", |
555 | 559 | " obj_freq = obj_frequency[max_power]\n", |
556 | 560 | " obj_period = 1.0 / obj_freq\n", |
|
590 | 594 | "id": "cf33e572-eaaf-498e-b937-30ead59b6ccd", |
591 | 595 | "metadata": {}, |
592 | 596 | "source": [ |
593 | | - "> 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." |
| 597 | + "> **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." |
594 | 598 | ] |
595 | 599 | }, |
596 | 600 | { |
|
628 | 632 | " min_freq = 1.0 / max_period\n", |
629 | 633 | " max_freq = 1.0 / min_period\n", |
630 | 634 | "\n", |
631 | | - " # Select the star based on its ID, and measurements in the requested band\n", |
632 | 635 | " results = results_dict[my_id]\n", |
633 | 636 | " results_band = results[results['band'] == pick_band]\n", |
634 | 637 | "\n", |
635 | | - " # Run Lomb-Scargle and pick the \"best\" frequency\n", |
636 | 638 | " obj_mjd_days_band = np.array(results_band['expMidptMJD']) * u.day\n", |
637 | 639 | " obj_fluxes_band = np.array(results_band['psfFlux'])\n", |
638 | 640 | " obj_frequency, obj_power =\\\n", |
|
643 | 645 | " peakbin = np.argmax(obj_power)\n", |
644 | 646 | " mean_peak_freq = obj_frequency[peakbin].value\n", |
645 | 647 | "\n", |
646 | | - " # Plot the frequency and power from Lomb-Scargle\n", |
647 | 648 | " fig, ax = plt.subplots(1, 2, figsize=(6, 3))\n", |
648 | 649 | "\n", |
649 | 650 | " plt.sca(ax[0])\n", |
|
677 | 678 | "\n", |
678 | 679 | " mag = (obj_fluxes*u.nJy).to(u.ABmag).value\n", |
679 | 680 | "\n", |
680 | | - " # Plot a phased lightcurve\n", |
681 | 681 | " fig = plt.figure(figsize=(6.5, 3))\n", |
682 | 682 | "\n", |
683 | 683 | " for band in ['g', 'r', 'i', 'z']:\n", |
|
688 | 688 | " ms=8, mew=0, alpha=0.5, label=band)\n", |
689 | 689 | "\n", |
690 | 690 | " plt.gca().invert_yaxis()\n", |
691 | | - " plt.legend()\n", |
692 | | - " plt.title(f\"{my_id}; period: {obj_period: .8F}\")\n", |
| 691 | + " plt.legend(ncol=4, loc=\"lower right\")\n", |
| 692 | + " plt.title(f\"Period: {obj_period: .8F}\")\n", |
693 | 693 | " plt.xlabel('phase')\n", |
694 | 694 | " plt.ylabel('magnitude')\n", |
695 | 695 | " plt.ylim(np.nanpercentile(mag, 95)+0.3, np.nanpercentile(mag, 5)-0.3)\n", |
696 | 696 | " plt.minorticks_on()\n", |
697 | 697 | " plt.show()" |
698 | 698 | ] |
699 | 699 | }, |
| 700 | + { |
| 701 | + "cell_type": "markdown", |
| 702 | + "id": "287b30df-e721-4c3f-9e4e-e3e0657015b9", |
| 703 | + "metadata": {}, |
| 704 | + "source": [ |
| 705 | + "Execute the period refinement function to improve the precision of each candidate and review the resulting phased light curves." |
| 706 | + ] |
| 707 | + }, |
700 | 708 | { |
701 | 709 | "cell_type": "code", |
702 | 710 | "execution_count": null, |
|
713 | 721 | "id": "47f3948a-64e6-435d-bfdc-880534d79e76", |
714 | 722 | "metadata": {}, |
715 | 723 | "source": [ |
716 | | - "> 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." |
| 724 | + "> **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." |
717 | 725 | ] |
718 | 726 | }, |
719 | 727 | { |
|
755 | 763 | " if i == 0:\n", |
756 | 764 | " tab = simbad_dict[key]\n", |
757 | 765 | " else:\n", |
758 | | - " tab = vstack([tab, simbad_dict[key]])" |
| 766 | + " tab = vstack(list(simbad_dict.values()), metadata_conflicts='silent')" |
759 | 767 | ] |
760 | 768 | }, |
761 | 769 | { |
762 | | - "cell_type": "code", |
763 | | - "execution_count": null, |
764 | | - "id": "cbfb7d26-e64d-4f24-97c5-32b44ca49c60", |
| 770 | + "cell_type": "markdown", |
| 771 | + "id": "7980ebe4-e6fe-4960-932f-c460d8963f05", |
765 | 772 | "metadata": {}, |
766 | | - "outputs": [], |
767 | 773 | "source": [ |
768 | | - "tab" |
| 774 | + "Print out the stacked table." |
769 | 775 | ] |
770 | 776 | }, |
771 | 777 | { |
772 | 778 | "cell_type": "code", |
773 | 779 | "execution_count": null, |
774 | | - "id": "17b494c9-9a90-49f3-a57d-2673378d53ce", |
| 780 | + "id": "cbfb7d26-e64d-4f24-97c5-32b44ca49c60", |
775 | 781 | "metadata": {}, |
776 | 782 | "outputs": [], |
777 | | - "source": [] |
| 783 | + "source": [ |
| 784 | + "tab" |
| 785 | + ] |
778 | 786 | } |
779 | 787 | ], |
780 | 788 | "metadata": { |
|
793 | 801 | "name": "python", |
794 | 802 | "nbconvert_exporter": "python", |
795 | 803 | "pygments_lexer": "ipython3", |
796 | | - "version": "3.13.9" |
| 804 | + "version": "3.12.11" |
797 | 805 | }, |
798 | 806 | "toc-autonumbering": false |
799 | 807 | }, |
|
0 commit comments