|
70 | 70 | "from astropy.coordinates import SkyCoord\n", |
71 | 71 | "\n", |
72 | 72 | "# 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", |
75 | 74 | "\n", |
76 | 75 | "# Bokeh and Holoviews for visualization\n", |
77 | 76 | "import bokeh\n", |
78 | 77 | "from bokeh.io import output_notebook, show\n", |
79 | 78 | "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", |
81 | 80 | "from bokeh.plotting import figure, gridplot\n", |
82 | 81 | "from bokeh.transform import factor_cmap\n", |
83 | 82 | "\n", |
|
175 | 174 | "outputs": [], |
176 | 175 | "source": [ |
177 | 176 | "# 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", |
180 | 179 | "radius = 0.1 * u.deg" |
181 | 180 | ] |
182 | 181 | }, |
|
195 | 194 | " \"WHERE CONTAINS(POINT('ICRS', obj.ra, obj.dec),\"\\\n", |
196 | 195 | " \"CIRCLE('ICRS', \" + str(c1.ra.value) + \", \" + str(c1.dec.value) + \", \" \\\n", |
197 | 196 | " + 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", |
199 | 199 | " \"AND truth.is_good_match = 1\"\n", |
200 | 200 | "# print(query)" |
201 | 201 | ] |
202 | 202 | }, |
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 | | - }, |
214 | 203 | { |
215 | 204 | "cell_type": "code", |
216 | 205 | "execution_count": null, |
|
220 | 209 | "%%time\n", |
221 | 210 | "# Execute the query and convert the results to a pandas dataframe\n", |
222 | 211 | "data = service.search(query).to_table().to_pandas() \n", |
223 | | - "assert len(data) == 14849 " |
| 212 | + "assert len(data) == 14803" |
224 | 213 | ] |
225 | 214 | }, |
226 | 215 | { |
|
249 | 238 | "metadata": {}, |
250 | 239 | "outputs": [], |
251 | 240 | "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" |
255 | 244 | ] |
256 | 245 | }, |
257 | 246 | { |
|
504 | 493 | "outputs": [], |
505 | 494 | "source": [ |
506 | 495 | "%%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)" |
508 | 497 | ] |
509 | 498 | }, |
510 | 499 | { |
|
0 commit comments