Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit d84cbc1

Browse files
MelissaGrahamkadrlicaLeanne GuyjeffcarlinChristinaAdair
authored
update to w_40 (#55)
* Update notebook 01 to w_2021_40 * Update notebook 02 to w_2021_40 * Update notebook 03 to w_2021_40 * Update to w_2021_40; more specific warning filters * warning filter * update to w_2021_40 and warnings filter * update to w_2021_40 and warnings * update to w_2021_40 and warnings * WIP * Move rubin imports to first cell * Update to w_40 * Updat formatting of hovertool on images * Migrate to w_40 * Update NB09 for w_40. * update to w_2021_40 and change to warnings * UnitsWarning * update to w_2021_40 and change to warnings * Fix spelling mistake * clear execution * Tickets/preops 624 (#52) * Update README.md Add information from notebooks. Formatting is not consistent between notebooks. Need to figure out how to display this information. There is MORE information about what code/skills are included in the notebooks. For this go around, I just copied the major headings. * Update README.md * Update README.md * Update README.md Added information from NB09 * Update README.md * Update README.md Update to include NB03b and Nb08 information in the front table. Sent a SLACK message for updating the SKILSS IN NOTEBOOKS table with a strategy for how to proceed. * Update README.md Fix punctuation * Update README.md Changed the format for the skills table. I might need a little help filling out the content of the table, level and packages specificially. * Update README.md Added NB08a and NB08b, updated the formatting for skills. * update descriptions for 8a and 8b they were too vague and identical - updated * updated levels for all, skills for 1, 2, and 3 * update to 03b * updated to NB04 * Update README.md Update packages and reformat skills for NB5-9 * minor text updates Co-authored-by: Melissa Graham <melissalynngraham@gmail.com> Co-authored-by: Alex Drlica-Wagner <kadrlica@fnal.gov> Co-authored-by: Leanne Guy <leanne.guy@lsst.org> Co-authored-by: Jeff Carlin <jcarlin@lsst.org> Co-authored-by: Christina Adair <79288082+ChristinaAdair@users.noreply.github.com>
1 parent 75d6981 commit d84cbc1

11 files changed

Lines changed: 177 additions & 62 deletions

01_Intro_to_DP0_Notebooks.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n",
99
"<b>Introduction to Jupyter Notebooks for Data Preview 0</b> <br>\n",
10-
"Last verified to run on 2021-08-16 with LSST Science Pipelines release w_2021_33 <br>\n",
10+
"Last verified to run on 2021-10-12 with LSST Science Pipelines release w_2021_40 <br>\n",
1111
"Contact author: Melissa Graham <br>\n",
1212
"Target audience: All DP0 delegates, especially those new to Notebooks. <br>\n",
1313
"Container Size: medium <br>\n",
@@ -163,7 +163,7 @@
163163
"import pandas\n",
164164
"pandas.set_option('display.max_rows', 1000)\n",
165165
"from IPython.display import Markdown as md\n",
166-
"from rubin_jupyter_utils.lab.notebook import get_tap_service, retrieve_query \n",
166+
"from lsst.rsp import get_tap_service, retrieve_query\n",
167167
"\n",
168168
"# Import packages for Section 3.0 Image Access\n",
169169
"import lsst.daf.butler as dafButler\n",

02_Intermediate_TAP_Query.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250, style=\"padding: 10px\"> \n",
88
"<b>Intermediate TAP Queries for DP0 catalogs </b> <br>\n",
9-
"Last verified to run on 2021-08-16 with LSST Science Pipelines release w_2021_33 <br>\n",
9+
"Last verified to run on 2021-10-12 with LSST Science Pipelines release w_2021_40 <br>\n",
1010
"Contact authors: Leanne Guy <br>\n",
1111
"Target audience: All DP0 delegates. <br>\n",
1212
"Container Size: medium <br>\n",
@@ -55,6 +55,9 @@
5555
"import pandas\n",
5656
"from pandas.testing import assert_frame_equal\n",
5757
"\n",
58+
"# Import the Rubin TAP service utilities\n",
59+
"from lsst.rsp import get_tap_service, retrieve_query\n",
60+
"\n",
5861
"# Astropy\n",
5962
"from astropy import units as u\n",
6063
"from astropy.coordinates import SkyCoord\n",
@@ -84,7 +87,8 @@
8487
"source": [
8588
"# Ignore warnings\n",
8689
"import warnings\n",
87-
"warnings.filterwarnings('ignore')"
90+
"from astropy.units import UnitsWarning\n",
91+
"warnings.simplefilter(\"ignore\", category=UnitsWarning)"
8892
]
8993
},
9094
{
@@ -133,9 +137,6 @@
133137
"metadata": {},
134138
"outputs": [],
135139
"source": [
136-
"# Import the Rubin TAP service utilities\n",
137-
"from rubin_jupyter_utils.lab.notebook import get_tap_service, retrieve_query\n",
138-
"\n",
139140
"# Get an instance of the TAP service\n",
140141
"service = get_tap_service()\n",
141142
"assert service is not None\n",

03_Image_Display_and_Manipulation.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"source": [
1111
"<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n",
1212
"<b>Displaying images using the LSST astronomical framework (afw) library</b> <br>\n",
13-
"Last verified to run on 2021-08-16 with LSST Science Pipelines release w_2021_33 <br>\n",
13+
"Last verified to run on 2021-10-12 with LSST Science Pipelines release w_2021_40 <br>\n",
1414
"Contact authors: Alex Drlica-Wagner, Jeff Carlin <br>\n",
1515
"Target audience: All DP0 delegates. <br>\n",
1616
"Container Size: medium <br>\n",
@@ -91,7 +91,6 @@
9191
"source": [
9292
"# prevent some helpful but ancillary warning messages from printing\n",
9393
"# during some LSST DM Release calls\n",
94-
"warnings.simplefilter(\"ignore\", category=FutureWarning)\n",
9594
"warnings.simplefilter(\"ignore\", category=UserWarning)"
9695
]
9796
},

03b_Image_Display_with_Firefly.ipynb

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n",
88
"<br>\n",
99
"<b>Displaying images using Firefly</b> <br>\n",
10-
"Last verified to run on 2021-08-23 with LSST Science Pipelines release w_2021_33 <br>\n",
10+
"Last verified to run on 2021-10-12 with LSST Science Pipelines release w_2021_40 <br>\n",
1111
"Contact authors: Jeff Carlin <br>\n",
1212
"Target audience: All DP0 delegates. <br>\n",
1313
"Container Size: medium <br>\n",
@@ -66,6 +66,25 @@
6666
"from lsst.daf.butler import Butler"
6767
]
6868
},
69+
{
70+
"cell_type": "markdown",
71+
"metadata": {},
72+
"source": [
73+
"And let the kernel know that we're happy not to have some useful warnings printed during this tutorial."
74+
]
75+
},
76+
{
77+
"cell_type": "code",
78+
"execution_count": null,
79+
"metadata": {},
80+
"outputs": [],
81+
"source": [
82+
"# prevent some helpful but ancillary warning messages from printing\n",
83+
"# during some LSST DM Release calls\n",
84+
"import warnings\n",
85+
"warnings.simplefilter(\"ignore\", category=UserWarning)"
86+
]
87+
},
6988
{
7089
"cell_type": "markdown",
7190
"metadata": {},
@@ -448,13 +467,6 @@
448467
"* [afw.display Doxygen website](http://doxygen.lsst.codes/stack/doxygen/x_masterDoxyDoc/namespacelsst_1_1afw_1_1display.html) \n",
449468
"* [afw.display GitHub website](https://github.com/lsst/afw/tree/master/python/lsst/afw/display) \n"
450469
]
451-
},
452-
{
453-
"cell_type": "code",
454-
"execution_count": null,
455-
"metadata": {},
456-
"outputs": [],
457-
"source": []
458470
}
459471
],
460472
"metadata": {

04_Intro_to_Butler.ipynb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n",
88
"<b>Introduction to the LSST data Butler</b> <br>\n",
9-
"Last verified to run on 2021-08-16 with LSST Science Pipelines release w_2021_33 <br>\n",
9+
"Last verified to run on 2021-10-12 with LSST Science Pipelines release w_2021_40 <br>\n",
1010
"Contact authors: Alex Drlica-Wagner, Melissa Graham <br>\n",
1111
"Target audience: All DP0 delegates. <br>\n",
1212
"Container Size: medium <br>\n",
@@ -59,6 +59,7 @@
5959
"outputs": [],
6060
"source": [
6161
"# Generic python packages\n",
62+
"import warnings\n",
6263
"import numpy as np\n",
6364
"import pylab as plt\n",
6465
"\n",
@@ -73,13 +74,25 @@
7374
"afwDisplay.setDefaultBackend('matplotlib')"
7475
]
7576
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": null,
80+
"metadata": {},
81+
"outputs": [],
82+
"source": [
83+
"# prevent some helpful but ancillary warning messages from printing\n",
84+
"# during some LSST DM Release calls\n",
85+
"warnings.simplefilter(\"ignore\", category=UserWarning)"
86+
]
87+
},
7688
{
7789
"cell_type": "code",
7890
"execution_count": null,
7991
"metadata": {},
8092
"outputs": [],
8193
"source": [
8294
"# This should match the verified version listed at the start of the notebook\n",
95+
"! echo $IMAGE_DESCRIPTION\n",
8396
"! eups list -s lsst_distrib"
8497
]
8598
},

05_Intro_to_Source_Detection.ipynb

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n",
88
"<b>Introduction to Source Detection</b> <br>\n",
9-
"Last verified to run on 2021-09-24 with LSST Science Pipelines release w_2021_33 <br>\n",
9+
"Last verified to run on 2021-10-12 with LSST Science Pipelines release w_2021_40 <br>\n",
1010
"Contact author: Alex Drlica-Wagner, Melissa Graham <br>\n",
1111
"Target audience: All DP0 delegates. <br>\n",
1212
"Container Size: medium <br>\n",
@@ -88,6 +88,18 @@
8888
"from lsst.meas.base import SingleFrameMeasurementTask"
8989
]
9090
},
91+
{
92+
"cell_type": "code",
93+
"execution_count": null,
94+
"metadata": {},
95+
"outputs": [],
96+
"source": [
97+
"# prevent some helpful but ancillary warning messages from printing\n",
98+
"# during some LSST DM Release calls\n",
99+
"warnings.simplefilter(\"ignore\", category=UserWarning)\n",
100+
"warnings.simplefilter(\"ignore\", category=FutureWarning)"
101+
]
102+
},
91103
{
92104
"cell_type": "code",
93105
"execution_count": null,
@@ -302,6 +314,7 @@
302314
"x_target, y_target = 1700, 2100\n",
303315
"width, height = 400, 400\n",
304316
"xmin, ymin = x_target-width//2, y_target-height//2\n",
317+
"point = geom.Point2D(x_target,y_target)\n",
305318
"\n",
306319
"# Define a small region for a cutout\n",
307320
"bbox = geom.Box2I()\n",
@@ -493,12 +506,13 @@
493506
"# Image characterization (this cell may take a few seconds)\n",
494507
"result = charImageTask.run(calexp)\n",
495508
"\n",
509+
"# Get the PSF at our point of interest\n",
496510
"psf = calexp.getPsf()\n",
497-
"sigma = psf.computeShape().getDeterminantRadius()\n",
511+
"sigma = psf.computeShape(point).getDeterminantRadius()\n",
498512
"pixelScale = calexp.getWcs().getPixelScale().asArcseconds()\n",
499513
"\n",
500514
"# The factor of 2.355 converts from std to fwhm\n",
501-
"print('psf fwhm = {:.2f} arcsec'.format(sigma*pixelScale*2.355))"
515+
"#print('psf fwhm = {:.2f} arcsec'.format(sigma*pixelScale*2.355))"
502516
]
503517
},
504518
{

06_Comparing_Object_and_Truth_Tables.ipynb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n",
99
"<br>\n",
1010
"<b>Comparing Object and Truth Tables</b> <br>\n",
11-
"Last verified to run on 2021-08-16 with LSST Science Pipelines release w_2021_33 <br>\n",
11+
"Last verified to run on 2021-10-12 with LSST Science Pipelines release w_2021_40 <br>\n",
1212
"Contact author: Jeff Carlin <br>\n",
1313
"Target audience: All DP0 delegates. <br>\n",
1414
"Container Size: medium <br>\n",
@@ -74,6 +74,19 @@
7474
"import matplotlib.pyplot as plt # imports matplotlib.pyplot as plt"
7575
]
7676
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": null,
80+
"id": "762a6ccc-b007-476b-8ac6-f15a8c374693",
81+
"metadata": {},
82+
"outputs": [],
83+
"source": [
84+
"# filter some unit warnings\n",
85+
"import warnings\n",
86+
"from astropy.units import UnitsWarning\n",
87+
"warnings.simplefilter(\"ignore\", category=UnitsWarning)"
88+
]
89+
},
7790
{
7891
"cell_type": "markdown",
7992
"id": "379c34ed",
@@ -92,8 +105,7 @@
92105
"# Set up some options, and import a couple more tools we will need:\n",
93106
"pandas.set_option('display.max_rows', 200)\n",
94107
"\n",
95-
"# from rubin_jupyter_utils.lab.notebook import get_catalog, retrieve_query\n",
96-
"from rubin_jupyter_utils.lab.notebook import get_tap_service\n",
108+
"from lsst.rsp import get_tap_service, retrieve_query\n",
97109
"\n",
98110
"service = get_tap_service()"
99111
]

08a_Interactive_Image_Visualization.ipynb

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"<b><img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250, style=\"padding: 10px\"> \n",
88
"<p><p><p><p><p><p>\n",
99
"<b>Interactive Image Visualization</b> <br>\n",
10-
"Last verified to run on <b>2021-09-17</b> with LSST Science Pipelines release <b>w_2021_33</b> <br>\n",
10+
"Last verified to run on <b>2021-10-14</b> with LSST Science Pipelines release <b>w_2021_40</b> <br>\n",
1111
"Contact authors: Leanne Guy <br>\n",
1212
"Target audience: All DP0 delegates. <br>\n",
13-
"Container Size: medium or large <br>\n",
13+
"Minimum Container Size: medium <br>\n",
1414
"Questions welcome at <a href=\"https://community.lsst.org/c/support/dp0\">community.lsst.org/c/support/dp0</a> <br>\n",
1515
"Find DP0 documentation and resources at <a href=\"https://dp0-1.lsst.io\">dp0-1.lsst.io</a> <br>"
1616
]
@@ -110,9 +110,8 @@
110110
"metadata": {},
111111
"outputs": [],
112112
"source": [
113-
"# Prevent some helpful but ancillary warning messages from printing\n",
114-
"# during some LSST DM Release calls\n",
115-
"warnings.simplefilter(\"ignore\", category=FutureWarning)\n",
113+
"# Ignore warnings\n",
114+
"import warnings\n",
116115
"warnings.simplefilter(\"ignore\", category=UserWarning)"
117116
]
118117
},
@@ -164,9 +163,18 @@
164163
"source": [
165164
"# Define a calibrated exposure and retrieve it via the Butler\n",
166165
"calexpId = {'visit': 192350, 'detector': 175, 'band': 'i'}\n",
167-
"calexp = butler.get('calexp', **calexpId)\n",
166+
"calexp = butler.get('calexp', calexpId)\n",
168167
"assert calexp is not None\n",
169-
"# Source table for this exposure\n",
168+
"f\"Visit: {calexp.visitInfo.getExposureId()}, Band:{calexp.getFilterLabel().bandLabel}, Detector: {calexp.detector.getId()}\""
169+
]
170+
},
171+
{
172+
"cell_type": "code",
173+
"execution_count": null,
174+
"metadata": {},
175+
"outputs": [],
176+
"source": [
177+
"# Source table for this calexp exposure\n",
170178
"calexpSrc = butler.get('src', **calexpId)"
171179
]
172180
},
@@ -178,8 +186,36 @@
178186
"source": [
179187
"# Define a deep coadded image and retrieve it via the Butler\n",
180188
"coaddId = {'tract': 4226, 'patch': 17, 'band': 'r'}\n",
181-
"coadd = butler.get('deepCoadd', **coaddId)\n",
182-
"assert coadd is not None\n",
189+
"coadd = butler.get('deepCoadd', coaddId)\n",
190+
"assert coadd is not None"
191+
]
192+
},
193+
{
194+
"cell_type": "markdown",
195+
"metadata": {},
196+
"source": [
197+
"Let's get some infomation about the coadd, such as which visits went into constructing it. As an exercise, explore the information in the coaddInfo object. "
198+
]
199+
},
200+
{
201+
"cell_type": "code",
202+
"execution_count": null,
203+
"metadata": {},
204+
"outputs": [],
205+
"source": [
206+
"coaddInfo = coadd.getInfo()\n",
207+
"\n",
208+
"# Which visits went into constructing this coadd?\n",
209+
"coaddVisits = coaddInfo.getCoaddInputs().visits\n",
210+
"coaddVisits.asAstropy()"
211+
]
212+
},
213+
{
214+
"cell_type": "code",
215+
"execution_count": null,
216+
"metadata": {},
217+
"outputs": [],
218+
"source": [
183219
"# Source table for this coadd\n",
184220
"coaddSrc = butler.get('deepCoadd_forced_src', coaddId)"
185221
]
@@ -257,7 +293,7 @@
257293
"outputs": [],
258294
"source": [
259295
"# Define some default plot options for the Image\n",
260-
"img_opts = dict(height=400, width=500, \n",
296+
"img_opts = dict(height=600, width=700, \n",
261297
" xaxis=\"bottom\", \n",
262298
" padding = 0.01, fontsize={'title': '8pt'},\n",
263299
" colorbar=True, toolbar='right', show_grid=True,\n",
@@ -335,16 +371,21 @@
335371
"metadata": {},
336372
"outputs": [],
337373
"source": [
338-
"detections = hv.Points(coords).opts(\n",
339-
" fill_color=None, size = 9, color=\"darkorange\")\n",
340-
"\n",
341374
"# Custom hover tool for the source detections\n",
342375
"detHoverTool = HoverTool(\n",
343376
" tooltips=[\n",
344-
" ( 'X', '@x'),\n",
345-
" ( 'Y', '@y'),\n",
346-
" ]\n",
347-
")"
377+
" ( 'X', '@x{0.2f}'),\n",
378+
" ( 'Y', '@y{0.2f}'),\n",
379+
" ],\n",
380+
" formatters={\n",
381+
" 'X' : 'printf',\n",
382+
" 'Y' : 'printf',\n",
383+
" },\n",
384+
" \n",
385+
")\n",
386+
"detections = hv.Points(coords).opts(\n",
387+
" fill_color=None, size = 9, color=\"darkorange\",\n",
388+
" tools=[detHoverTool])"
348389
]
349390
},
350391
{
@@ -360,8 +401,8 @@
360401
"metadata": {},
361402
"outputs": [],
362403
"source": [
363-
"# Reset the tools on the image and add a hover on the detections. \n",
364-
"rasterize(img.opts(tools=[])) * detections.opts(tools=[detHoverTool])"
404+
"# Reset the tools on the image and add a hover on the detections.\n",
405+
"rasterize(img).opts(tools=[]) * detections.opts(tools=[detHoverTool])"
365406
]
366407
},
367408
{

0 commit comments

Comments
 (0)