diff --git a/docs/gettingstarted/quickstart.ipynb b/docs/gettingstarted/quickstart.ipynb index 199c6b20..8ced1893 100644 --- a/docs/gettingstarted/quickstart.ipynb +++ b/docs/gettingstarted/quickstart.ipynb @@ -120,13 +120,68 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The result is a table of delta times (dts) and structure function (sf2) for each unique lightcurve (labeled by lc_id)." + "The result is a table of delta times (dts) and structure function (sf2) for each unique lightcurve (labeled by lc_id). We can now visualize our delta times versus the computed structure function for each unique object." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "from matplotlib import rcParams\n", + "\n", + "%matplotlib inline\n", + "%config InlineBackend.figure_format = \"retina\"\n", + "rcParams[\"savefig.dpi\"] = 550\n", + "rcParams[\"font.size\"] = 20\n", + "plt.rc(\"font\", family=\"serif\")\n", + "\n", + "fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(5, 4))\n", + "plt.scatter(result[\"dt\"], result[\"sf2\"], s=20, alpha=1, color=\"#353935\")\n", + "plt.yscale(\"log\")\n", + "plt.ylabel(\"Log(SF) (mag)\")\n", + "plt.xlabel(\"Time Lag (days)\")\n", + "plt.ylim(1e-3, 1e1)\n", + "plt.xlim(0, 2e3)" ] }, { "cell_type": "markdown", "metadata": {}, - "source": [] + "source": [ + "Finally, suppose we want to select the ID with the maximum sf2 value from the computed feature. Using the available `ens.to_timeseries()` that creates a TimeSeries object, we can access the light curve for the target ID." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "max_id = result.compute()[\"sf2\"].idxmax()[0]\n", + "lc = ens.to_timeseries(max_id)\n", + "lc" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "filter_r = lc.band == \"r\" # select filter\n", + "\n", + "plt.figure(figsize=(8, 5))\n", + "plt.errorbar(\n", + " lc.time[filter_r], lc.flux[filter_r], lc.flux_err[filter_r], fmt=\"o\", color=\"red\", alpha=0.8, label=\"r\"\n", + ")\n", + "plt.minorticks_on()\n", + "plt.ylabel(\"Flux (mJy)\")\n", + "plt.xlabel(\"Time (MJD)\")\n", + "plt.legend(title=\"Band\", loc=\"upper left\")" + ] } ], "metadata": { @@ -145,7 +200,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.10.13" }, "vscode": { "interpreter": {