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

Commit 7caa1db

Browse files
committed
Merge branch 'tickets/PREOPS-726' of https://github.com/rubin-dp0/tutorial-notebooks into tickets/PREOPS-726
2 parents 98b317e + 6609fc1 commit 7caa1db

3 files changed

Lines changed: 42 additions & 17 deletions

File tree

02_Intermediate_TAP_Query.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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",
@@ -133,9 +136,6 @@
133136
"metadata": {},
134137
"outputs": [],
135138
"source": [
136-
"# Import the Rubin TAP service utilities\n",
137-
"from lsst.rsp import get_tap_service, retrieve_query\n",
138-
"\n",
139139
"# Get an instance of the TAP service\n",
140140
"service = get_tap_service()\n",
141141
"assert service is not None\n",

08a_Interactive_Image_Visualization.ipynb

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@
112112
"source": [
113113
"# Ignore warnings\n",
114114
"import warnings\n",
115-
"warnings.simplefilter(\"ignore\", category='UnitsWarning')"
115+
"warnings.simplefilter(\"ignore\", category='UnitsWarning')\n",
116+
"warnings.simplefilter(\"ignore\", category=UserWarning)"
116117
]
117118
},
118119
{
@@ -163,9 +164,8 @@
163164
"source": [
164165
"# Define a calibrated exposure and retrieve it via the Butler\n",
165166
"calexpId = {'visit': 192350, 'detector': 175, 'band': 'i'}\n",
166-
"calexp = butler.get('calexp', **calexpId)\n",
167+
"calexp = butler.get('calexp', calexpId)\n",
167168
"assert calexp is not None\n",
168-
"# 'physical_filter': 'HSC-R'\n",
169169
"f\"Visit: {calexp.visitInfo.getExposureId()}, Band:{calexp.getFilterLabel().bandLabel}, Detector: {calexp.detector.getId()}\""
170170
]
171171
},
@@ -187,10 +187,30 @@
187187
"source": [
188188
"# Define a deep coadded image and retrieve it via the Butler\n",
189189
"coaddId = {'tract': 4226, 'patch': 17, 'band': 'r'}\n",
190-
"coadd = butler.get('deepCoadd', **coaddId)\n",
190+
"coadd = butler.get('deepCoadd', coaddId)\n",
191191
"assert coadd is not None"
192192
]
193193
},
194+
{
195+
"cell_type": "markdown",
196+
"metadata": {},
197+
"source": [
198+
"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. "
199+
]
200+
},
201+
{
202+
"cell_type": "code",
203+
"execution_count": null,
204+
"metadata": {},
205+
"outputs": [],
206+
"source": [
207+
"coaddInfo = coadd.getInfo()\n",
208+
"\n",
209+
"# Which visits went into constructin this coadd?\n",
210+
"coaddVisits = coaddInfo.getCoaddInputs().visits\n",
211+
"coaddVisits.asAstropy()"
212+
]
213+
},
194214
{
195215
"cell_type": "code",
196216
"execution_count": null,
@@ -352,16 +372,21 @@
352372
"metadata": {},
353373
"outputs": [],
354374
"source": [
355-
"detections = hv.Points(coords).opts(\n",
356-
" fill_color=None, size = 9, color=\"darkorange\")\n",
357-
"\n",
358375
"# Custom hover tool for the source detections\n",
359376
"detHoverTool = HoverTool(\n",
360377
" tooltips=[\n",
361-
" ( 'X', '@x'),\n",
362-
" ( 'Y', '@y'),\n",
363-
" ]\n",
364-
")"
378+
" ( 'X', '@x{0.2f}'),\n",
379+
" ( 'Y', '@y{0.2f}'),\n",
380+
" ],\n",
381+
" formatters={\n",
382+
" 'X' : 'printf',\n",
383+
" 'Y' : 'printf',\n",
384+
" },\n",
385+
" \n",
386+
")\n",
387+
"detections = hv.Points(coords).opts(\n",
388+
" fill_color=None, size = 9, color=\"darkorange\",\n",
389+
" tools=[detHoverTool])"
365390
]
366391
},
367392
{
@@ -377,8 +402,8 @@
377402
"metadata": {},
378403
"outputs": [],
379404
"source": [
380-
"# Reset the tools on the image and add a hover on the detections. \n",
381-
"rasterize(img.opts(tools=[])) * detections.opts(tools=[detHoverTool])"
405+
"# Reset the tools on the image and add a hover on the detections.\n",
406+
"rasterize(img).opts(tools=[]) * detections.opts(tools=[detHoverTool])"
382407
]
383408
},
384409
{

08b_Interactive_Catalog_Visualization.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
"metadata": {},
269269
"outputs": [],
270270
"source": [
271-
"# assert len(data) == 23155236"
271+
"assert len(data) == 23155236"
272272
]
273273
},
274274
{

0 commit comments

Comments
 (0)