-
Notifications
You must be signed in to change notification settings - Fork 8
SP-3313: review and improve the 301 series NBs #195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,8 +21,8 @@ | |
| "For the Rubin Science Platform at data.lsst.cloud. \\\n", | ||
| "Data Release: [Data Preview 2](http://dp2.lsst.io) \\\n", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line #19. "Rubin_SV_320_-15": [320.2, -15.1, 4.51], Would it make more sense to leave it as 4.5 to match the other fields? Reply via ReviewNB
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately the number of visits I get with 4.5 is not the same as what's reported in the documentation (because when Melissa calculated those originally she used a different calculation). To get the numbers to match up I had to extend it to 4.51.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line #6. tx = np.where(sc_region.separation(sc_patches).value <= rad)[0] Is this supposed to be <= radius instead? The plot produced is more zoomed in and I wasn't sure if that was an intentional choice or a copy paste error. tx = np.where(sc_region.separation(sc_patches).value <= radius)[0]
Though I noticed that doing this shows more patches around the corners than in the original notebook. Reply via ReviewNB
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - good catch! |
||
| "Container Size: Large \\\n", | ||
| "LSST Science Pipelines version: r30.0.10 \\\n", | ||
| "Last verified to run: 2026-07-24 \\\n", | ||
| "LSST Science Pipelines version: r30.0.11 \\\n", | ||
| "Last verified to run: 2026-08-17 \\\n", | ||
| "Repository: [github.com/lsst/tutorial-notebooks](https://github.com/lsst/tutorial-notebooks)" | ||
| ] | ||
| }, | ||
|
|
@@ -53,7 +53,7 @@ | |
| "\n", | ||
| "This notebook provides an overview of the observations that were obtained during commissioning and science validation with the LSST Camera ([lsstcam.lsst.io](https://lsstcam.lsst.io/)), processed with v30 of the Rubin Science Pipelines ([pipelines.lsst.io](https://pipelines.lsst.io/)), and released as Data Preview 2 (DP2; [dp2.lsst.io](https://dp2.lsst.io/)).\n", | ||
| "\n", | ||
| "The code in this notebook was used to generated the [DP2 observations overview webpage](https://dp2.lsst.io/).\n", | ||
| "The code in this notebook was used to generate the [DP2 observations overview webpage](https://dp2.lsst.io/).\n", | ||
| "\n", | ||
| "**Key concepts for the DP2 dataset**\n", | ||
| "\n", | ||
|
|
@@ -63,7 +63,7 @@ | |
| "**Skymap, tract, and patch:**\n", | ||
| "One tract is one square region of LSST's all-sky tesselation, the \"skymap\".\n", | ||
| "Tracts are $~1.66$ deg per side, identified by a unique four-digit number, and are subdivided into 100 overlapping patches.\n", | ||
| "One deep coadd image is created per patch, provided sufficient input visits exist.\n", | ||
| "One deep coadd image is created per patch in each band, provided sufficient input visits exist.\n", | ||
| "The tract and patch numbers together with the filter uniquely identify a deep coadd image.\n", | ||
| "\n", | ||
| "**For DP2, the area covered by visits is greater than the area covered by deep coadd images.**\n", | ||
|
|
@@ -100,8 +100,10 @@ | |
| "import numpy as np\n", | ||
| "import matplotlib.pyplot as plt\n", | ||
| "import matplotlib.colors as mcolors\n", | ||
| "from astropy.coordinates import SkyCoord\n", | ||
| "from astropy.table import Table, join\n", | ||
| "from astropy.time import Time\n", | ||
| "import astropy.units as u\n", | ||
| "import skyproj\n", | ||
| "import healpy as hp\n", | ||
| "import hpgeom as hpg\n", | ||
|
|
@@ -205,7 +207,7 @@ | |
| "id": "dd00d543-04cf-45a4-891e-e6f80313b59d", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Define dictionaries with the Data Preview 2 names and centers for Deep Drilling Fields (DDFs) and small survey fields (SFS). \n", | ||
| "Define dictionaries with the Data Preview 2 names and centers for Deep Drilling Fields (DDFs) and small field surveys (SFS). \n", | ||
| "The coordinates are Right Ascension and Declination as International Celestial Reference System (ICRS) coordinates in decimal degrees.\n", | ||
| "\n", | ||
| "A radius in degrees is defined with the coordinates: it is *approximate*, and encompasses only the *boresight* (field-of-view center) coordinates for all individual visits of that field. It does not encompass every detector, or every skymap patch, or every detected source or object associated with that field." | ||
|
|
@@ -236,7 +238,7 @@ | |
| " \"Rubin_SV_225_-40\": [225.0, -39.5, 1.9],\n", | ||
| " \"Rubin_SV_280_-48\": [280.1, -48.0, 2.0],\n", | ||
| " \"Rubin_SV_300_-41\": [300.3, -41.0, 1.8],\n", | ||
| " \"Rubin_SV_320_-15\": [320.2, -15.1, 4.5],\n", | ||
| " \"Rubin_SV_320_-15\": [320.2, -15.1, 4.51],\n", | ||
| "}\n", | ||
| "region_names = list(regions.keys())" | ||
| ] | ||
|
|
@@ -246,7 +248,7 @@ | |
| "id": "a500c7ca-134b-45e0-80ba-dec5e7397ccb", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Define a function that will remove a figure and all it's data, to help clear memory." | ||
| "Define a function that will remove a figure and all its data, to help clear memory." | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -376,7 +378,7 @@ | |
| "id": "ce49c560-766b-407c-b74e-a804b85a9d36", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Use the `skyproj` package with a McBryde skyprojection to visualize the distribution of DP2 visits on the sky in HEALPix that are approximately the same size as the LSSTCam FOV (`nside`=19)." | ||
| "Use the `skyproj` package with a McBryde sky projection to visualize the distribution of DP2 visits on the sky in HEALPix that are approximately the same size as the LSSTCam FOV (`nside`=19)." | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -387,12 +389,12 @@ | |
| "outputs": [], | ||
| "source": [ | ||
| "orig_cmap = plt.get_cmap('Blues')\n", | ||
| "new_cmap = truncate_colormap(orig_cmap, 0.10, 0.75)\n", | ||
| "new_cmap = truncate_colormap(orig_cmap, 0.20, 0.8)\n", | ||
| "\n", | ||
| "fig, ax = plt.subplots(figsize=(12, 8))\n", | ||
| "sp = skyproj.McBrydeSkyproj(ax=ax)\n", | ||
| "vras = np.asarray(visit_table['ra'], dtype='float')\n", | ||
| "vdecs = np.asarray(visit_table['dec'], dtype='float')\n", | ||
| "vras = visit_table['ra'].value.data\n", | ||
| "vdecs = visit_table['dec'].value.data\n", | ||
| "sp.draw_hpxbin(vras, vdecs, nside=19, alpha=1, cmap=new_cmap)\n", | ||
| "sp.draw_colorbar(label='Number of visits (any filter)', shrink=0.5, pad=0.01)\n", | ||
| "for r, name in enumerate(region_names):\n", | ||
|
|
@@ -409,7 +411,7 @@ | |
| "sp.ax.legend(loc=\"lower center\", bbox_to_anchor=(0.5, 1.1), ncol=5, handletextpad=0)\n", | ||
| "plt.tight_layout()\n", | ||
| "plt.show()\n", | ||
| "del sp, vras, vdecs" | ||
| "del sp" | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -461,15 +463,16 @@ | |
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "sc_all = SkyCoord(ra = vras*u.deg, dec = vdecs*u.deg, frame='icrs')\n", | ||
| "\n", | ||
| "for i, name in enumerate(region_names):\n", | ||
| " ra, dec, rad = regions[name]\n", | ||
| " cosdec = np.cos(np.deg2rad(dec))\n", | ||
| " offsets = np.sqrt((cosdec*(visit_table['ra']-ra))**2 + (visit_table['dec']-dec)**2)\n", | ||
| " tx = np.where(offsets < rad)[0]\n", | ||
| " sc_region = SkyCoord(ra = ra*u.deg, dec = dec*u.deg, frame='icrs')\n", | ||
| " tx = np.where(sc_region.separation(sc_all).value <= rad)[0]\n", | ||
| " for filt in filter_names:\n", | ||
| " field_filt_dist[filt][i] = len(np.where(visit_table['band'][tx] == filt)[0])\n", | ||
| " field_filt_dist['Total'][i] = len(tx)\n", | ||
| " del ra, dec, rad, offsets, tx\n", | ||
| " del ra, dec, rad, tx\n", | ||
| "\n", | ||
| "i = np.where(field_filt_dist['Field'] == \"All\")[0]\n", | ||
| "for filt in filter_names:\n", | ||
|
|
@@ -520,14 +523,13 @@ | |
| "\n", | ||
| "for i, name in enumerate(region_names):\n", | ||
| " ra, dec, rad = regions[name]\n", | ||
| " cosdec = np.cos(np.deg2rad(dec))\n", | ||
| " offsets = np.sqrt((cosdec*(visit_table['ra']-ra))**2 + (visit_table['dec']-dec)**2)\n", | ||
| " tx = np.where(offsets < rad)[0]\n", | ||
| " sc_region = SkyCoord(ra = ra*u.deg, dec = dec*u.deg, frame='icrs')\n", | ||
| " tx = np.where(sc_region.separation(sc_all).value <= rad)[0]\n", | ||
| " field_epochs['visits'][i] = len(tx)\n", | ||
| " unique_nights = np.unique(np.floor(visit_table['expMidptMJD'][tx]))\n", | ||
| " field_epochs['nights'][i] = len(unique_nights)\n", | ||
| " field_epochs['mean(visits/night)'][i] = int(np.round(len(tx)/len(unique_nights), 0))\n", | ||
| " del ra, dec, rad, offsets, tx, unique_nights\n", | ||
| " del ra, dec, rad, tx, unique_nights\n", | ||
| "\n", | ||
| "i = np.where(field_epochs['Field'] == \"All\")[0]\n", | ||
| "field_epochs['visits'][i] = len(visit_table)\n", | ||
|
|
@@ -627,7 +629,7 @@ | |
| "id": "c863cf20-d032-4340-a135-42109ca22515", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "> **Figure 3:** The cumulative distribution of visit airmass for all visits, for all filters combined. The 50% percentile for airmass is 1.2, and is marked with a dashed grey line." | ||
| "> **Figure 3:** The cumulative distribution of visit airmass for all visits, for all filters combined. The 50th percentile for airmass is 1.2, and is marked with a dashed grey line." | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -800,7 +802,7 @@ | |
| "source": [ | ||
| "Create tables of the mean seeing and magnitude limit, averaged over all visits in a given filter, per region.\n", | ||
| "\n", | ||
| "Because seeing and magnitude limit are filter-dependent, but an average over all filters is not calculated." | ||
| "Because seeing and magnitude limit are filter-dependent, an average over all filters is not calculated." | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -819,9 +821,8 @@ | |
| "\n", | ||
| "for i, name in enumerate(region_names):\n", | ||
| " ra, dec, rad = regions[name]\n", | ||
| " cosdec = np.cos(np.deg2rad(dec))\n", | ||
| " offsets = np.sqrt((cosdec*(joined_table['ra']-ra))**2 + (joined_table['dec']-dec)**2)\n", | ||
| " tx = np.where(offsets < rad)[0]\n", | ||
| " sc_region = SkyCoord(ra = ra*u.deg, dec = dec*u.deg, frame='icrs')\n", | ||
| " tx = np.where(sc_region.separation(sc_all).value <= rad)[0]\n", | ||
| " for filt in filter_names:\n", | ||
| " fx = np.where(joined_table['band'][tx] == filt)[0]\n", | ||
| " if len(fx) > 0:\n", | ||
|
|
@@ -831,7 +832,7 @@ | |
| " field_seeing[filt][i] = np.nan\n", | ||
| " field_maglim[filt][i] = np.nan\n", | ||
| " del fx\n", | ||
| " del ra, dec, rad, offsets, tx\n", | ||
| " del ra, dec, rad, tx\n", | ||
| "\n", | ||
| "i = np.where(field_seeing['Field'] == \"All\")[0]\n", | ||
| "for filt in filter_names:\n", | ||
|
|
@@ -923,7 +924,7 @@ | |
| "id": "a3aace34-9b8c-4c80-a4a7-531885d9d05c", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Get the unique tract number for DP2, and print their total number." | ||
| "Get the unique tract numbers for DP2, and print their total number." | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -979,9 +980,9 @@ | |
| " vertex_list = info.getVertexList()\n", | ||
| " ras = []\n", | ||
| " decs = []\n", | ||
| " for vertice in vertex_list:\n", | ||
| " ras.append(vertice.getRa().asDegrees())\n", | ||
| " decs.append(vertice.getDec().asDegrees())\n", | ||
| " for vertex in vertex_list:\n", | ||
| " ras.append(vertex.getRa().asDegrees())\n", | ||
| " decs.append(vertex.getDec().asDegrees())\n", | ||
| " sp.draw_polygon(ras, decs, edgecolor='darkgrey', alpha=1, linewidth=0.5, facecolor=None)\n", | ||
| " del info, vertex_list, ras, decs\n", | ||
| "for r, name in enumerate(region_names):\n", | ||
|
|
@@ -1015,7 +1016,7 @@ | |
| "source": [ | ||
| "#### 3.1.2. Single-field map of patches\n", | ||
| "\n", | ||
| "Draw one box per patch for the DDF ECDFS field (2 in Figure 6).\n", | ||
| "Draw one box per patch for the DDF ECDFS field (numbered 3 in Figure 6).\n", | ||
| "\n", | ||
| "Recall from Section 1.2. that the third component of `regions[<name>]` is the radius within which the boresight center coordinates for all visits of the field are included.\n", | ||
| "To capture all tracts that contain patches for which these visits might have contributed to a deep coadd image,\n", | ||
|
|
@@ -1034,10 +1035,9 @@ | |
| "name = \"DDF_ECDFS\"\n", | ||
| "ra, dec, rad = regions[name]\n", | ||
| "radius = rad + np.sqrt(2*1.66**2)\n", | ||
| "delta_ra = (ra - patches_table['s_ra'])*(np.cos(np.deg2rad(dec)))\n", | ||
| "delta_dec = dec - patches_table['s_dec']\n", | ||
| "offset = np.sqrt(delta_ra**2 + delta_dec**2)\n", | ||
| "tx = np.where(offset < radius)[0]\n", | ||
| "sc_patches = SkyCoord(ra = patches_table['s_ra'], dec = patches_table['s_dec'], frame='icrs')\n", | ||
| "sc_region = SkyCoord(ra = ra*u.deg, dec = dec*u.deg, frame='icrs')\n", | ||
| "tx = np.where(sc_region.separation(sc_patches).value <= radius)[0]\n", | ||
| "tract_color_dict = {4848: '#1f77b4', 4849: '#ff7f0e', 5063: '#2ca02c'}\n", | ||
| "\n", | ||
| "fig, ax = plt.subplots(1, 2, figsize=(10, 5))\n", | ||
|
|
@@ -1051,23 +1051,24 @@ | |
| " if patches_table['lsst_tract'][x] in tract_color_dict:\n", | ||
| " color = tract_color_dict[patches_table['lsst_tract'][x]]\n", | ||
| " ax[a].plot(ras, decs, color=color, linewidth=0.5, alpha=1)\n", | ||
| " ax[a].set_xlabel(\"Right Ascension\", fontsize=12)\n", | ||
| " ax[a].set_ylabel(\"Declination\", fontsize=12)\n", | ||
| " ax[a].set_xlabel(\"Right Ascension (deg)\", fontsize=12)\n", | ||
| " ax[a].set_ylabel(\"Declination (deg)\", fontsize=12)\n", | ||
| " del s_region, temp, ras, decs\n", | ||
| "ax[1].set_xlim([ra-0.5, ra+0.5])\n", | ||
| "ax[1].set_ylim([dec-0.5, dec+0.5])\n", | ||
| "ax[0].invert_xaxis()\n", | ||
| "ax[1].invert_xaxis()\n", | ||
| "plt.tight_layout()\n", | ||
| "plt.show()\n", | ||
| "del name, ra, dec, rad, radius, tx\n", | ||
| "del delta_ra, delta_dec, offset" | ||
| "del name, ra, dec, rad, radius, tx, sc_patches, sc_region" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "195299b2-42d1-4818-9115-53996e737f86", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "> **Figure 7:** At left, all pre-defined patches for the EDCFS. At right, the zoom-in better shows that both tracts and individual patches within a tract overlap at their edges. The center three tracts are assigned colors just to help with visualizing the overlap." | ||
| "> **Figure 7:** At left, all pre-defined patches for the EDCFS. At right, the zoom-in better shows that both tracts and individual patches within a tract overlap at their edges. The center three tracts are assigned colors to help with visualizing the overlap." | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -1088,11 +1089,12 @@ | |
| "# name = \"DDF_ECDFS\"\n", | ||
| "# ra, dec, rad = regions[name]\n", | ||
| "# radius = rad + np.sqrt(2*1.66**2)\n", | ||
| "# tx = np.where(np.sqrt(((ra - patches_table['s_ra'])*(np.cos(np.deg2rad(dec))))**2 +\n", | ||
| "# (dec - patches_table['s_dec'])**2) < radius)[0]\n", | ||
| "# sc_patches = SkyCoord(ra = patches_table['s_ra'], dec = patches_table['s_dec'], frame='icrs')\n", | ||
| "# sc_region = SkyCoord(ra = ra*u.deg, dec = dec*u.deg, frame='icrs')\n", | ||
| "# tx = np.where(sc_region.separation(sc_patches).value <= rad)[0]\n", | ||
| "# tract_list = np.unique(patches_table['lsst_tract'][tx])\n", | ||
| "# print(name, tract_list)\n", | ||
| "# del name, ra, dec, rad, radius, tx, tract_list" | ||
| "# del name, ra, dec, rad, radius, tx, tract_list, sc_patches, sc_region" | ||
| ] | ||
| }, | ||
| { | ||
|
|
@@ -1244,10 +1246,9 @@ | |
| "name = \"DDF_ECDFS\"\n", | ||
| "coords = regions[name]\n", | ||
| "radius = coords[2] + np.sqrt(2*1.66**2)\n", | ||
| "delta_ra = (coords[0] - patches_table['s_ra'])*(np.cos(np.deg2rad(coords[1])))\n", | ||
| "delta_dec = coords[1] - patches_table['s_dec']\n", | ||
| "offset = np.sqrt(delta_ra**2 + delta_dec**2)\n", | ||
| "tx = np.where(offset < radius)[0]\n", | ||
| "sc_patches = SkyCoord(ra = patches_table['s_ra'], dec = patches_table['s_dec'], frame='icrs')\n", | ||
| "sc_region = SkyCoord(ra = coords[0]*u.deg, dec = coords[1]*u.deg, frame='icrs')\n", | ||
| "tx = np.where(sc_region.separation(sc_patches).value <= radius)[0]\n", | ||
| "pixels = np.unique(np.array(hpg.angle_to_pixel(default_nside_coverage,\n", | ||
| " patches_table['s_ra'][tx],\n", | ||
| " patches_table['s_dec'][tx])))\n", | ||
|
|
@@ -1403,6 +1404,14 @@ | |
| "source": [ | ||
| "# field_coadd_size" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "id": "df9921d9-905e-42d1-ad16-3cd92c34a80d", | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [] | ||
| } | ||
| ], | ||
| "metadata": { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the pipelines version be updated?
Reply via ReviewNB