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

Commit cfcee56

Browse files
committed
Merge branch 'tickets/PREOPS-723' of github.com:rubin-dp0/tutorial-notebooks into tickets/PREOPS-723
2 parents 22b2b87 + d5468bb commit cfcee56

3 files changed

Lines changed: 67 additions & 78 deletions

File tree

08b_Interactive_Catalog_Visualization.ipynb

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@
7070
"from astropy.coordinates import SkyCoord\n",
7171
"\n",
7272
"# LSST imports\n",
73-
"from lsst.daf.butler import Butler\n",
74-
"from rubin_jupyter_utils.lab.notebook import get_tap_service, retrieve_query\n",
73+
"from rubin_jupyter_utils.lab.notebook import get_tap_service\n",
7574
"\n",
7675
"# Bokeh and Holoviews for visualization\n",
7776
"import bokeh\n",
7877
"from bokeh.io import output_notebook, show\n",
7978
"from bokeh.models import ColumnDataSource, Range1d, HoverTool\n",
80-
"from bokeh.models import Selection, CDSView, GroupFilter\n",
79+
"from bokeh.models import CDSView, GroupFilter\n",
8180
"from bokeh.plotting import figure, gridplot\n",
8281
"from bokeh.transform import factor_cmap\n",
8382
"\n",
@@ -175,8 +174,8 @@
175174
"outputs": [],
176175
"source": [
177176
"# Define a reference position on the sky and a radius in arcseconds for a cone search\n",
178-
"c1 = SkyCoord(ra=59.7955707*u.degree, dec=-29.91176471*u.degree, frame='icrs')\n",
179-
"#radius = 15.882353 * u.arcmin\n",
177+
"c1 = SkyCoord(ra=59.79*u.degree, dec=-29.91*u.degree, frame='icrs')\n",
178+
"# c1 = SkyCoord(ra=50.65*u.degree, dec=-40.*u.degree, frame='icrs')\n",
180179
"radius = 0.1 * u.deg"
181180
]
182181
},
@@ -195,22 +194,12 @@
195194
" \"WHERE CONTAINS(POINT('ICRS', obj.ra, obj.dec),\"\\\n",
196195
" \"CIRCLE('ICRS', \" + str(c1.ra.value) + \", \" + str(c1.dec.value) + \", \" \\\n",
197196
" + str(radius.to(u.deg).value) + \" )) = 1 \" \\\n",
198-
" \"AND truth.match_objectid >= 0 \"\\\n",
197+
" \"AND obj.good = 1\" \\\n",
198+
" \"AND truth.match_objectid >= 0 \" \\\n",
199199
" \"AND truth.is_good_match = 1\"\n",
200200
"# print(query)"
201201
]
202202
},
203-
{
204-
"cell_type": "code",
205-
"execution_count": null,
206-
"metadata": {},
207-
"outputs": [],
208-
"source": [
209-
" # \"obj.psFlux_g, obj.psFlux_r, obj.psFlux_i, obj.cModelFlux_g, \" \\\n",
210-
" # \"truth.flux_g, truth.flux_r, truth.flux_i, truth.truth_type, \" \\\n",
211-
" # \"obj.mag_g, obj.mag_r, obj.mag_i, obj.mag_g_cModel, obj.mag_r_cModel, obj.mag_i_cModel,\" \\"
212-
]
213-
},
214203
{
215204
"cell_type": "code",
216205
"execution_count": null,
@@ -220,7 +209,7 @@
220209
"%%time\n",
221210
"# Execute the query and convert the results to a pandas dataframe\n",
222211
"data = service.search(query).to_table().to_pandas() \n",
223-
"assert len(data) == 14849 "
212+
"assert len(data) == 14803"
224213
]
225214
},
226215
{
@@ -249,9 +238,9 @@
249238
"metadata": {},
250239
"outputs": [],
251240
"source": [
252-
"# assert data[data[\"truth_type\"] == \"star\"].shape[0] == 226 # 2164 \n",
253-
"# assert data[data[\"truth_type\"] == \"galaxy\"].shape[0] == 10058 # 99932\n",
254-
"# assert data[data[\"truth_type\"] == \"SNe\"].shape[0] == 0"
241+
"assert data[data[\"truth_type\"] == \"star\"].shape[0] == 331\n",
242+
"assert data[data[\"truth_type\"] == \"galaxy\"].shape[0] == 14472\n",
243+
"assert data[data[\"truth_type\"] == \"SNe\"].shape[0] == 0"
255244
]
256245
},
257246
{
@@ -504,7 +493,7 @@
504493
"outputs": [],
505494
"source": [
506495
"%%opts Scatter [tools=['hover'], toolbar='above',height=400, width=400](color='grey')\n",
507-
"hv.Scatter(data).opts(alpha=0.2, size=1)"
496+
"hv.Scatter(data).opts(alpha=0.2, size=2)"
508497
]
509498
},
510499
{

0 commit comments

Comments
 (0)