|
30 | 30 | "\n", |
31 | 31 | "This tutorial introduces three open-source Python libraries that enable powerful interactive visualization of images and catalogs. \n", |
32 | 32 | " 1. [**HoloViews**](http://holoviews.org): Produce high-quality interactive visualizations easily by annotating datasets rather than using direct calls to a plotting library\n", |
33 | | - " 2. [**Bokeh**](https://bokeh.org): A powerful data visualization library that provides interactive including brushing and linking between multiple plots. `Holoviews` + `Bokeh`\n", |
| 33 | + " 2. [**Bokeh**](https://bokeh.org): A powerful data visualization library that provides interactive tools including brushing and linking between multiple plots. `Holoviews` + `Bokeh`\n", |
34 | 34 | " 3. [**Datashader**](https://datashader.org): Accurately render very large datasets quickly and flexibly.\n", |
35 | 35 | " \n", |
36 | 36 | "These packages are part of the [PyViz](http://pyviz.org/) ecosystem of tools intended for visualization in a web browser and can be used to create quite sophisticated dashboard-like interactive displays and widgets. The goal of this tutorial is to provide an introduction and starting point from which to create more advanced, custom interactive visualizations. " |
|
62 | 62 | "import pandas as pd\n", |
63 | 63 | "import warnings\n", |
64 | 64 | "\n", |
65 | | - "# Updadte this option setting as you prefer\n", |
| 65 | + "# Update this option setting as you prefer\n", |
66 | 66 | "pd.set_option('display.max_rows', 5)\n", |
67 | 67 | "\n", |
68 | 68 | "# Astropy\n", |
|
96 | 96 | "output_notebook()" |
97 | 97 | ] |
98 | 98 | }, |
| 99 | + { |
| 100 | + "cell_type": "markdown", |
| 101 | + "metadata": {}, |
| 102 | + "source": [ |
| 103 | + "If a message about \\\"Patching auth into notebook.base.handlers ...\\\" appeared above, it is ok to ignore, as are messages about the number of threads." |
| 104 | + ] |
| 105 | + }, |
99 | 106 | { |
100 | 107 | "cell_type": "code", |
101 | 108 | "execution_count": null, |
|
147 | 154 | "metadata": {}, |
148 | 155 | "source": [ |
149 | 156 | "#### 1.1 DP0.1 tabular dataset\n", |
150 | | - "We will execute a cone search about a defined coordinate with a specified radius using the Rubin TAP service. For more details about using the TAP service and ADQL queries, please refer to tutorial 02_Intermediate_TAP_Query." |
| 157 | + "We will execute a cone search about a defined coordinate with a specified radius using the Rubin TAP service. For more details about using the TAP service and ADQL queries, please refer to tutorial `02_Intermediate_TAP_Query`." |
151 | 158 | ] |
152 | 159 | }, |
153 | 160 | { |
|
209 | 216 | "assert len(data) == 102096" |
210 | 217 | ] |
211 | 218 | }, |
| 219 | + { |
| 220 | + "cell_type": "markdown", |
| 221 | + "metadata": {}, |
| 222 | + "source": [ |
| 223 | + "Warnings about units that might appear above are ok to ignore." |
| 224 | + ] |
| 225 | + }, |
212 | 226 | { |
213 | 227 | "cell_type": "code", |
214 | 228 | "execution_count": null, |
215 | 229 | "metadata": {}, |
216 | 230 | "outputs": [], |
217 | 231 | "source": [ |
218 | 232 | "# Map the truth type to a descriptive string\n", |
| 233 | + "# Catalog schema for the truth table can be found at:\n", |
| 234 | + "# https://dp0-1.lsst.io/data-products-dp0-1/index.html#catalogs\n", |
219 | 235 | "data['truth_type'] = data['truth_type'].map(\n", |
220 | 236 | " {1: 'galaxy', 2: 'star', 3: 'SNe'})" |
221 | 237 | ] |
|
365 | 381 | "cell_type": "markdown", |
366 | 382 | "metadata": {}, |
367 | 383 | "source": [ |
368 | | - "Next, let's create a layout of several plots. A `Layout` is a type of `Container` that can contain any HoloViews object. Other types of Containers that exist include Overlay, Gridspace, Dymamicmap, etc. See the Holoviews [Reference Gallery](http://holoviews.org/reference/index.html) for the full list of `Layouts` that can be created with Holoviews. See [Building Composite Objects](http://holoviews.org/user_guide/Building_Composite_Objects.html) for the full details about the ways Containers can be composed.\n", |
| 384 | + "Next, let's create a layout of several plots. A `Layout` is a type of `Container` that can contain any HoloViews object. Other types of Containers that exist include Overlay, Gridspace, Dynamicmap, etc. See the Holoviews [Reference Gallery](http://holoviews.org/reference/index.html) for the full list of `Layouts` that can be created with Holoviews. See [Building Composite Objects](http://holoviews.org/user_guide/Building_Composite_Objects.html) for the full details about the ways Containers can be composed.\n", |
369 | 385 | "\n", |
370 | 386 | "The `+` operator is used to create a Layout. " |
371 | 387 | ] |
|
513 | 529 | "cell_type": "markdown", |
514 | 530 | "metadata": {}, |
515 | 531 | "source": [ |
516 | | - "The techniques to apply customizations in the cells above use standard python syntax and are the recommended way to customize your visualizations in HoloViews. Holoviews also supports IPython magics. Magics is a much older approach that is not standard python and is specific to notebooks. [Holoviews notebook magic](https://holoviews.org/user_guide/Notebook_Magics.html) supports both line and cell magics. Here is an example of using magics to plot the same spatial distribution of `Objects` as above." |
| 532 | + "The techniques to apply customizations in the cells above use standard python syntax and are the recommended way to customize your visualizations in HoloViews. Holoviews also supports IPython magic commands. Magics are a much older approach that is not standard python and is specific to notebooks. [Holoviews notebook magic](https://holoviews.org/user_guide/Notebook_Magics.html) supports both line and cell magics. Here is an example of using magics to plot the same spatial distribution of `Objects` as above." |
517 | 533 | ] |
518 | 534 | }, |
519 | 535 | { |
|
530 | 546 | "cell_type": "markdown", |
531 | 547 | "metadata": {}, |
532 | 548 | "source": [ |
533 | | - "Our result set above contained a lot of columns. Often want to be selective about which information we show in the hover tool and customize the names. We do this by creating a custom hover tool. " |
| 549 | + "Our result set above contained a lot of columns. Often we want to be selective about which information we show in the hover tool and customize the names. We do this by creating a custom hover tool. " |
534 | 550 | ] |
535 | 551 | }, |
536 | 552 | { |
|
563 | 579 | "hv.Scatter(data).opts(tools=[raDecHover], **plot_style_bkh)" |
564 | 580 | ] |
565 | 581 | }, |
| 582 | + { |
| 583 | + "cell_type": "markdown", |
| 584 | + "metadata": {}, |
| 585 | + "source": [ |
| 586 | + "It might be necessary to zoom in until points are distinguishable in order to notice how the hover tool box contents list only three properties per point." |
| 587 | + ] |
| 588 | + }, |
566 | 589 | { |
567 | 590 | "cell_type": "markdown", |
568 | 591 | "metadata": {}, |
569 | 592 | "source": [ |
570 | 593 | "#### 2.2. Visualizing exposure images with Holoviews\n", |
571 | 594 | "\n", |
572 | | - "In the tutorial 03_Image_Display_and_Manipulation we saw how to use the `lsst.afw.display` library to visualize exposure images and in tutorial 03b_Image_Display_with_Firefly we saw how to do the same using Firefly. In this example we demonstrate image visualization at the pixel level with Holoviews.\n", |
| 595 | + "In the tutorial `03_Image_Display_and_Manipulation` we saw how to use the `lsst.afw.display` library to visualize exposure images and in tutorial `03b_Image_Display_with_Firefly` we saw how to do the same using Firefly. In this example we demonstrate image visualization at the pixel level with Holoviews.\n", |
573 | 596 | "\n", |
574 | 597 | "We will use the holoviews Image Element to visualise a calexp. We will then overlay a Holoviews DynamicMap on the image to compute and display elements dynamically, allowing exploration of large datasets. DynamicMaps generate elements on the fly allowing exploration of parameters with arbitrary resolution. DynamicMaps are lazy in the sense they only compute as much data as the user wishes to explore. An Overlay is a collection of HoloViews objects that are displayed simultanously, e.g a Curve superimposed on a Scatter plot of data. You can build a Overlay between any two HoloViews objects, which can have different types using the * operator. " |
575 | 598 | ] |
|
578 | 601 | "cell_type": "markdown", |
579 | 602 | "metadata": {}, |
580 | 603 | "source": [ |
581 | | - "First, we will apply the same asinh stretch and zscale interval as was applied in `04_Intro_to_Butler` directly to the calexp object." |
| 604 | + "First, we will use the `astropy.visualization` library to define an asinh stretch and zscale interval and apply them to the calexp object. These are the same transformation that were applied in `03_Image_Display_and_Manipulation` notebook." |
582 | 605 | ] |
583 | 606 | }, |
584 | 607 | { |
|
619 | 642 | "cell_type": "markdown", |
620 | 643 | "metadata": {}, |
621 | 644 | "source": [ |
622 | | - "To will use the matplotlib convention of placing the origin of an plot in the top left, we need to flip the data." |
| 645 | + "We will use the matplotlib convention of placing the origin of an plot in the top left, we need to flip the data." |
623 | 646 | ] |
624 | 647 | }, |
625 | 648 | { |
|
716 | 739 | "cell_type": "markdown", |
717 | 740 | "metadata": {}, |
718 | 741 | "source": [ |
719 | | - "You can view an HTML rendering of the `src` table by getting an `astropy.table.Table` version of it The coord columns are `coord_ra` and `coord_dec`" |
| 742 | + "You can view an HTML rendering of the `src` table by getting an `astropy.table.Table` version of it. The coord columns are `coord_ra` and `coord_dec`" |
720 | 743 | ] |
721 | 744 | }, |
722 | 745 | { |
|
1051 | 1074 | "source": [ |
1052 | 1075 | "#### 6.1 Color-color plot \n", |
1053 | 1076 | "\n", |
1054 | | - "Here we plot a color-colour diagram of the cModel magnitudes obtained fron the query in 1. Data Preparation" |
| 1077 | + "Here we plot a color-colour diagram of the cModel magnitudes obtained from the query in 1. Data Preparation" |
1055 | 1078 | ] |
1056 | 1079 | }, |
1057 | 1080 | { |
|
0 commit comments