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

Commit f0c0158

Browse files
committed
Remove commented code.
1 parent 016aa11 commit f0c0158

1 file changed

Lines changed: 27 additions & 30 deletions

File tree

06_Comparing_Object_and_Truth_Tables.ipynb

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "dc689fc6",
5+
"id": "c71a56b9",
66
"metadata": {},
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",
@@ -18,7 +18,7 @@
1818
},
1919
{
2020
"cell_type": "markdown",
21-
"id": "1207070b",
21+
"id": "8993ab53",
2222
"metadata": {},
2323
"source": [
2424
"### Learning Objectives\n",
@@ -33,7 +33,7 @@
3333
{
3434
"cell_type": "code",
3535
"execution_count": null,
36-
"id": "da9d7acd",
36+
"id": "52987dfb",
3737
"metadata": {},
3838
"outputs": [],
3939
"source": [
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"cell_type": "markdown",
47-
"id": "35f86ab0",
47+
"id": "e670521d",
4848
"metadata": {},
4949
"source": [
5050
"### 1. Import Common Python Libraries\n",
@@ -55,7 +55,7 @@
5555
{
5656
"cell_type": "code",
5757
"execution_count": null,
58-
"id": "61277fb2",
58+
"id": "806acd1c",
5959
"metadata": {},
6060
"outputs": [],
6161
"source": [
@@ -68,7 +68,7 @@
6868
},
6969
{
7070
"cell_type": "markdown",
71-
"id": "e1878a99",
71+
"id": "792daffb",
7272
"metadata": {},
7373
"source": [
7474
"To access tables, we will use the TAP service in a similar manner to what we showed in the [Intro to DP0 notebook](https://github.com/rubin-dp0/tutorial-notebooks/blob/main/01_Intro_to_DP0_Notebooks.ipynb), and explored further in the [TAP tutorial notebook](https://github.com/rubin-dp0/tutorial-notebooks/blob/main/02_Intermediate_TAP_Query.ipynb). See those notebooks for more details."
@@ -77,7 +77,7 @@
7777
{
7878
"cell_type": "code",
7979
"execution_count": null,
80-
"id": "c378f1a8",
80+
"id": "e16ddac5",
8181
"metadata": {},
8282
"outputs": [],
8383
"source": [
@@ -87,14 +87,12 @@
8787
"# from rubin_jupyter_utils.lab.notebook import get_catalog, retrieve_query\n",
8888
"from rubin_jupyter_utils.lab.notebook import get_tap_service\n",
8989
"\n",
90-
"# Deprecated\n",
91-
"# service = get_catalog()\n",
9290
"service = get_tap_service()"
9391
]
9492
},
9593
{
9694
"cell_type": "markdown",
97-
"id": "1f002e76",
95+
"id": "28405ef9",
9896
"metadata": {},
9997
"source": [
10098
"### 2. Loading tables with TAP\n",
@@ -105,7 +103,7 @@
105103
{
106104
"cell_type": "code",
107105
"execution_count": null,
108-
"id": "a27bdbaf",
106+
"id": "166b0fa2",
109107
"metadata": {},
110108
"outputs": [],
111109
"source": [
@@ -117,7 +115,7 @@
117115
},
118116
{
119117
"cell_type": "markdown",
120-
"id": "9f7b8c23",
118+
"id": "0824f847",
121119
"metadata": {},
122120
"source": [
123121
"For our analysis, let's choose the Object table, `dp01_dc2_catalogs.object`, and then we will compare the measurements from this table to the \"truth\" values from `dp01_dc2_catalogs.truth_match`.\n",
@@ -128,7 +126,7 @@
128126
{
129127
"cell_type": "code",
130128
"execution_count": null,
131-
"id": "d85fda84",
129+
"id": "0601ec4b",
132130
"metadata": {},
133131
"outputs": [],
134132
"source": [
@@ -146,7 +144,7 @@
146144
{
147145
"cell_type": "code",
148146
"execution_count": null,
149-
"id": "bd4fdf31",
147+
"id": "d9fdaa83",
150148
"metadata": {},
151149
"outputs": [],
152150
"source": [
@@ -161,7 +159,7 @@
161159
},
162160
{
163161
"cell_type": "markdown",
164-
"id": "562bd55f",
162+
"id": "b3b53d14",
165163
"metadata": {},
166164
"source": [
167165
"### 3. Extract a table of joined results from two tables, using a single query within ADQL\n",
@@ -176,7 +174,7 @@
176174
{
177175
"cell_type": "code",
178176
"execution_count": null,
179-
"id": "f0925d52",
177+
"id": "fd9a466e",
180178
"metadata": {},
181179
"outputs": [],
182180
"source": [
@@ -202,7 +200,7 @@
202200
{
203201
"cell_type": "code",
204202
"execution_count": null,
205-
"id": "82f8b729",
203+
"id": "7a6f6dc4",
206204
"metadata": {},
207205
"outputs": [],
208206
"source": [
@@ -213,7 +211,7 @@
213211
},
214212
{
215213
"cell_type": "markdown",
216-
"id": "6390f5a2",
214+
"id": "24d3f0a9",
217215
"metadata": {},
218216
"source": [
219217
"Notice the \"%%time\" cell magic we used. This was included to highlight that selecting more than 14000 objects from two tables and joining them takes less than 2 seconds (typically). Doing two separate queries, then joining them using `pandas`, typically takes more than a full minute."
@@ -222,7 +220,7 @@
222220
{
223221
"cell_type": "code",
224222
"execution_count": null,
225-
"id": "d92356f6",
223+
"id": "ae42fe8d",
226224
"metadata": {},
227225
"outputs": [],
228226
"source": [
@@ -233,7 +231,7 @@
233231
},
234232
{
235233
"cell_type": "markdown",
236-
"id": "66a2ba15",
234+
"id": "4956a0b9",
237235
"metadata": {},
238236
"source": [
239237
"### 4. Compare table values by plotting"
@@ -242,7 +240,7 @@
242240
{
243241
"cell_type": "code",
244242
"execution_count": null,
245-
"id": "d6672057",
243+
"id": "0810af58",
246244
"metadata": {},
247245
"outputs": [],
248246
"source": [
@@ -276,7 +274,7 @@
276274
},
277275
{
278276
"cell_type": "markdown",
279-
"id": "b4a7f31d",
277+
"id": "897cd675",
280278
"metadata": {},
281279
"source": [
282280
"#### Compare the measurements from the Object table to the \"true\" values for some objects.\n",
@@ -289,7 +287,7 @@
289287
{
290288
"cell_type": "code",
291289
"execution_count": null,
292-
"id": "e88af181",
290+
"id": "982f0a47",
293291
"metadata": {},
294292
"outputs": [],
295293
"source": [
@@ -299,7 +297,7 @@
299297
},
300298
{
301299
"cell_type": "markdown",
302-
"id": "b56ca5d2",
300+
"id": "171e794b",
303301
"metadata": {},
304302
"source": [
305303
"Just to confirm that things look like we expect, let's plot a color-magnitude (g vs. g-i) and color-color (r-i vs. g-r) diagram."
@@ -308,14 +306,13 @@
308306
{
309307
"cell_type": "code",
310308
"execution_count": null,
311-
"id": "f3ffe9f5",
309+
"id": "992064da",
312310
"metadata": {},
313311
"outputs": [],
314312
"source": [
315313
"fig, ax = plt.subplots(1, 2, figsize=(15, 8))\n",
316314
"\n",
317315
"plt.sca(ax[0]) # set the first axis as current\n",
318-
"# plt.rcParams.update({'figure.figsize' : (9, 11)})\n",
319316
"\n",
320317
"plt.plot(truth_plus_meas['mag_g_cModel'][gx] - truth_plus_meas['mag_i_cModel'][gx],\n",
321318
" truth_plus_meas['mag_g_cModel'][gx], 'k.', alpha=0.2, label='galaxies')\n",
@@ -348,7 +345,7 @@
348345
},
349346
{
350347
"cell_type": "markdown",
351-
"id": "d83d90b0",
348+
"id": "281562f5",
352349
"metadata": {},
353350
"source": [
354351
"Looks pretty normal - the stellar locus in color-color space is right where one expects it to be, and the galaxies dominate at the faint end of the CMD. \n",
@@ -359,7 +356,7 @@
359356
{
360357
"cell_type": "code",
361358
"execution_count": null,
362-
"id": "b0bda66b",
359+
"id": "ee992151",
363360
"metadata": {},
364361
"outputs": [],
365362
"source": [
@@ -382,7 +379,7 @@
382379
},
383380
{
384381
"cell_type": "markdown",
385-
"id": "aa39cc9c",
382+
"id": "d08b6e1f",
386383
"metadata": {},
387384
"source": [
388385
"Well, that looks good -- the ratio of measured to true fluxes is centered on 1.0. It seems like the fluxes are recovered pretty well, on average.\n",
@@ -393,7 +390,7 @@
393390
{
394391
"cell_type": "code",
395392
"execution_count": null,
396-
"id": "5fb08ec4",
393+
"id": "20bf58e3",
397394
"metadata": {},
398395
"outputs": [],
399396
"source": []

0 commit comments

Comments
 (0)