|
5 | 5 | "metadata": {}, |
6 | 6 | "source": [ |
7 | 7 | "<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250, style=\"padding: 10px\"> \n", |
8 | | - "<b>Advanced catalog access via TAP </b> <br>\n", |
| 8 | + "<b>Intermediate TAP Queries for DP0 catalogs </b> <br>\n", |
9 | 9 | "Last verified to run on 2021-06-25 with LSST Science Pipelines release w_2021_25 <br>\n", |
10 | 10 | "Contact authors: Leanne Guy <br>\n", |
11 | 11 | "Target audience: All DP0 delegates. <br>\n", |
|
33 | 33 | "1. Explore the DP0.1 schema and catalogs using the Rubin TAP service<br>\n", |
34 | 34 | "2. Query the DP0.1 Object and Truth Match catalogs, and retrieve data for analysis<br>\n", |
35 | 35 | "3. Visualize and interact with the retrieved data set<br>\n", |
36 | | - "4. Working with asynchronous TAP queries" |
| 36 | + "4. Work with asynchronous TAP queries" |
37 | 37 | ] |
38 | 38 | }, |
39 | 39 | { |
|
132 | 132 | "# Query to find out what schemas are in the Rubin TAP_SCHEMA\n", |
133 | 133 | "query = \"SELECT * FROM tap_schema.schemas\"\n", |
134 | 134 | "\n", |
135 | | - "# Execute the query. A TAPResults object is returned\n", |
| 135 | + "# Execute the query. A TAP Results object is returned\n", |
136 | 136 | "results = service.search(query)" |
137 | 137 | ] |
138 | 138 | }, |
|
153 | 153 | "source": [ |
154 | 154 | "#### 1.3 DC2 tables (catalogs) in DP0.1\n", |
155 | 155 | "\n", |
156 | | - "All the DP0 tables (catalogs) are in the \"dp01_dc2_catalogs\" schema (table collection). We can programatically extract the DP0,1 schema_name into a variable." |
| 156 | + "All the DP0 tables (catalogs) are in the \"dp01_dc2_catalogs\" schema (table collection). We can programatically extract the DP0.1 schema_name into a variable." |
157 | 157 | ] |
158 | 158 | }, |
159 | 159 | { |
|
202 | 202 | "\n", |
203 | 203 | "* `schema` - database terminology for the abstract design that represents the storage of data in a database. \n", |
204 | 204 | "* `tap_schema` - the specific schema describing the TAP service. All TAP services must support a set of tables in a schema named TAP_SCHEMA that describe the tables and columns included in the service.\n", |
205 | | - "* `table` - a collection of related data held in a table format in a database, e.g the object(dp01_dc2_catalogs.object) or position (dp01_dc2_catalogs.position) tables \n", |
206 | | - "* `table collection` - a collection of tables. e.g `dp01_dc2_catalogs`\t\n", |
| 205 | + "* `table` - a collection of related data held in a table format in a database, e.g., the object(dp01_dc2_catalogs.object) or position (dp01_dc2_catalogs.position) tables \n", |
| 206 | + "* `table collection` - a collection of tables. e.g., `dp01_dc2_catalogs`\t\n", |
207 | 207 | "* `results` - the query result set. The TAP service returns data from a query as a `TAPResults` object. Find more about `TAPResults` [here](https://pyvo.readthedocs.io/en/latest/api/pyvo.dal.TAPResults.html)." |
208 | 208 | ] |
209 | 209 | }, |
|
223 | 223 | "metadata": {}, |
224 | 224 | "source": [ |
225 | 225 | "#### 2.1 Specifying the maximum number of records to return\n", |
226 | | - "For debugging and testing queries, it is often useful to only return a few records for expediency. This can be done in one of two ways, setting the `TOP` field in a query, or setting the `maxec` parameter in the TAP service query. The two methods are identical. " |
| 226 | + "For debugging and testing queries, it is often useful to only return a few records for expediency. This can be done in one of two ways, setting the `TOP` field in a query, or setting the `maxrec` parameter in the TAP service query. The two methods are identical. " |
227 | 227 | ] |
228 | 228 | }, |
229 | 229 | { |
|
380 | 380 | "source": [ |
381 | 381 | "### 3. Visualize and analyse the results\n", |
382 | 382 | "\n", |
383 | | - "Now we will do some interactive analysis with the data we have above. We will use bokeh and holoviews to create interactive plots so that we can explore the dataset. between two panels showing different repsentations of the same dataset. A selection applied to either panel will highlight the selected points in the other panel." |
| 383 | + "Now we will do some interactive analysis with the data we have above. We will use bokeh and holoviews to create interactive plots so that we can explore the dataset, using two panels showing different repsentations of the same dataset. A selection applied to either panel will highlight the selected points in the other panel.\n", |
| 384 | + "\n", |
| 385 | + "<a href=\"https://bokeh.org/\">Bokeh Documentation</a> <br>\n", |
| 386 | + "<a href=\"https://holoviews.org/\">Holoviews Documentation</a>" |
384 | 387 | ] |
385 | 388 | }, |
386 | 389 | { |
387 | 390 | "cell_type": "markdown", |
388 | 391 | "metadata": {}, |
389 | 392 | "source": [ |
390 | 393 | "#### 3.1 Data preparation\n", |
391 | | - "The basis for any data visualization is the underlying data. We will prepare ColumnDataSource (CDS) from the data returned by the query above that can be passed directly to bokeh. The CDS is the core of bokeh plots. Bokeh automatically creates a CDS from dta passed as python lists ot numpy arrays. CDS are useful as they allow data to be shared between multiple plots and renderers, enabling brushing and linking. A CDS is essentially a collection of sequences of data that have their own unique column name. \n", |
| 394 | + "The basis for any data visualization is the underlying data. We will prepare ColumnDataSource (CDS) from the data returned by the query above that can be passed directly to bokeh. The CDS is the core of bokeh plots. Bokeh automatically creates a CDS from data passed as python lists ot numpy arrays. CDS are useful as they allow data to be shared between multiple plots and renderers, enabling brushing and linking. A CDS is essentially a collection of sequences of data that have their own unique column name. \n", |
392 | 395 | "\n", |
393 | 396 | "Getting the data preparation phase right is key to creating powerful visualizations. " |
394 | 397 | ] |
|
518 | 521 | "metadata": {}, |
519 | 522 | "outputs": [], |
520 | 523 | "source": [ |
521 | | - "# Add in hover!!!!#Define the tools\n", |
| 524 | + "# Add in hover!!!!\n", |
| 525 | + "# Define the tools\n", |
522 | 526 | "TOOLS = \"box_select,lasso_select,help\"\n", |
523 | 527 | "\n", |
524 | 528 | "# Define the tooltips\n", |
|
761 | 765 | "source": [ |
762 | 766 | "job.delete()" |
763 | 767 | ] |
| 768 | + }, |
| 769 | + { |
| 770 | + "cell_type": "code", |
| 771 | + "execution_count": null, |
| 772 | + "metadata": {}, |
| 773 | + "outputs": [], |
| 774 | + "source": [] |
764 | 775 | } |
765 | 776 | ], |
766 | 777 | "metadata": { |
|
0 commit comments