{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "In this tutorial, we demonstrate how to use `%%eod` cell magic for different viewing options of assets returned by an EarthAI Catalog query.\n", "\n", "We show four different viewing options available, which include:\n", "1. `--extents`, which displays scene footprints on a map;\n", "2. `--heatmap`, which renders a heatmap of scene centroids;\n", "3. `--hist`, which creates a temporal density histogram of results; and\n", "4. `--table`, which shows a table of results with tile samples.\n", "\n", "We also demonstrate the `--side` option, which places map widgets in a sidebar to the right of the notebook rather than in a cell output. To see the full list of parameter options, run `?eod` in a notebook cell.\n", "\n", "We use [Landsat 8](https://landsat.gsfc.nasa.gov/landsat-data-continuity-mission/) imagery covering Charlottesville, Virginia, USA in each query." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# View Scene Footprints\n", "\n", "By adding the `--extents` option, you can view the scene boundaries of the assets returned by the `%%eod` query on an [ipyleaflet](https://ipyleaflet.readthedocs.io/en/latest/) map.\n", "\n", "You can hover the mouse pointer over any one of the map extents to display a thumbnail of the image and view the asset information." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%eod --extents\n", "{\n", " \"collections\": [\n", " \"landsat8_l1tp\"\n", " ],\n", " \"geo\": [\n", " -78.57147216796875,\n", " 37.96152331396614,\n", " -78.40942382812501,\n", " 38.09133660751176\n", " ],\n", " \"max_cloud_cover\": 100\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# View a Heatmap of Scenes\n", "\n", "By adding the `--heatmap` option, you can view a heatmap of scene centroids. Lighter colors (yellow) indicates more scene coverage and darker colors (purple) indicate less scene coverage. Additionally, you can add an integer argument to `--heatmap`, which sets the kernel radius (in pixels) of the heatmap." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%eod --heatmap 100\n", "{\n", " \"collections\": [\n", " \"landsat8_l1tp\"\n", " ],\n", " \"geo\": [\n", " -78.57147216796875,\n", " 37.96152331396614,\n", " -78.40942382812501,\n", " 38.09133660751176\n", " ],\n", " \"max_cloud_cover\": 100\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# View a Temporal Density Histogram\n", "\n", "By adding the `--hist option`, you can display a temporal density histogram of your `%%eod` query results. This will return the number of scenes at each datetime interval that meet your query parameters.\n", "\n", "In the upper right corner of the histogram, there's a button that allows you to save the histogram as a PNG or SVG." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%eod --hist\n", "{\n", " \"collections\": [\n", " \"landsat8_l1tp\"\n", " ],\n", " \"geo\": [\n", " -78.57147216796875,\n", " 37.96152331396614,\n", " -78.40942382812501,\n", " 38.09133660751176\n", " ],\n", " \"max_cloud_cover\": 100\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# View Results in a Table\n", "\n", "By adding the `--table` option, you can view a sample of results returned from the `%%eod` query. Additionally, you can specify the number of rows to display if you pass an integer argument along with the `--table` option as shown below.\n", "\n", "The table will include a natural color preview of each scene as well as a small map of scene boundaries highlighting where the scene is located over a basemap." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%eod --table 2\n", "{\n", " \"collections\": [\n", " \"landsat8_l1tp\"\n", " ],\n", " \"geo\": [\n", " -78.57147216796875,\n", " 37.96152331396614,\n", " -78.40942382812501,\n", " 38.09133660751176\n", " ],\n", " \"max_cloud_cover\": 100\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# View Map Widgets in a Side Panel\n", "\n", "By specifying `--side` as an option in `%%eod` magic, the map widgets will show up in a right sidebar next to the notebook rather than in the cell output. \n", "\n", "As shown below, the extents and heatmap will show up on a single map widget in the sidebar while the histogram and table will show up in the cell output.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%eod --extents --heatmap 100 --hist --table 2 --side\n", "{\n", " \"collections\": [\n", " \"landsat8_l1tp\"\n", " ],\n", " \"geo\": [\n", " -78.57147216796875,\n", " 37.96152331396614,\n", " -78.40942382812501,\n", " 38.09133660751176\n", " ],\n", " \"max_cloud_cover\": 100\n", "}" ] } ], "metadata": { "kernelspec": { "display_name": "EarthAI Environment", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.7" }, "zendesk": { "draft": true, "id": 360050145011, "section_id": 360010176352, "title": "Visualizing Assets with %%eod Cell Magic" } }, "nbformat": 4, "nbformat_minor": 4 }