|
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 | ] |
|
209 | 209 | "%%time\n", |
210 | 210 | "# Execute the query and convert the results to a pandas dataframe\n", |
211 | 211 | "data = service.search(query).to_table().to_pandas() \n", |
212 | | - "assert len(data) == 14849 " |
| 212 | + "assert len(data) == 14803" |
213 | 213 | ] |
214 | 214 | }, |
215 | 215 | { |
|
238 | 238 | "metadata": {}, |
239 | 239 | "outputs": [], |
240 | 240 | "source": [ |
241 | | - "# assert data[data[\"truth_type\"] == \"star\"].shape[0] == 226 # 2164 \n", |
242 | | - "# assert data[data[\"truth_type\"] == \"galaxy\"].shape[0] == 10058 # 99932\n", |
243 | | - "# 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" |
244 | 244 | ] |
245 | 245 | }, |
246 | 246 | { |
|
493 | 493 | "outputs": [], |
494 | 494 | "source": [ |
495 | 495 | "%%opts Scatter [tools=['hover'], toolbar='above',height=400, width=400](color='grey')\n", |
496 | | - "hv.Scatter(data).opts(alpha=0.2, size=1)" |
| 496 | + "hv.Scatter(data).opts(alpha=0.2, size=2)" |
497 | 497 | ] |
498 | 498 | }, |
499 | 499 | { |
|
0 commit comments