{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Quickstart\n",
    "\n",
    "This notebook is a quick introduction to using PySTAC for reading an existing STAC catalog. For more in-depth examples check out the other tutorials.\n",
    "\n",
    "## Dependencies\n",
    "\n",
    "- PySTAC"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reading a Catalog\n",
    "\n",
    "[A STAC Catalog](https://github.com/radiantearth/stac-spec/tree/master/catalog-spec) is used to group other STAC objects like Items, Collections, or even other Catalogs.\n",
    "\n",
    "We will be using a small example catalog adapted from the [example Landsat Collection](https://github.com/geotrellis/geotrellis-server/tree/977bad7a64c409341479c281c8c72222008861fd/stac-example/catalog/landsat-stac-collection) in the [GeoTrellis](https://geotrellis.io) repository. All STAC Items and Collections can be found in the [docs/example-catalog](https://github.com/stac-utils/pystac/tree/main/docs/example-catalog) directory of this repo; all Assets are hosted in the Landsat S3 bucket.\n",
    "\n",
    "First, we import the PySTAC classes we will be working with."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:53.360681Z",
     "iopub.status.busy": "2025-09-11T16:53:53.360397Z",
     "iopub.status.idle": "2025-09-11T16:53:54.333411Z",
     "shell.execute_reply": "2025-09-11T16:53:54.332865Z",
     "shell.execute_reply.started": "2025-09-11T16:53:53.360653Z"
    }
   },
   "outputs": [],
   "source": [
    "import shutil\n",
    "import tempfile\n",
    "from pathlib import Path\n",
    "\n",
    "from pystac import Catalog, get_stac_version"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next, we read the example catalog and print some basic metadata."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:54.334813Z",
     "iopub.status.busy": "2025-09-11T16:53:54.334715Z",
     "iopub.status.idle": "2025-09-11T16:53:54.337619Z",
     "shell.execute_reply": "2025-09-11T16:53:54.337301Z",
     "shell.execute_reply.started": "2025-09-11T16:53:54.334802Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ID: landsat-stac-collection-catalog\n",
      "Title: STAC for Landsat data\n",
      "Description: STAC for Landsat data\n"
     ]
    }
   ],
   "source": [
    "root_catalog = Catalog.from_file(\"./example-catalog/catalog.json\")\n",
    "print(f\"ID: {root_catalog.id}\")\n",
    "print(f\"Title: {root_catalog.title or 'N/A'}\")\n",
    "print(f\"Description: {root_catalog.description or 'N/A'}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "*Note that we do not print the \"stac_version\" here. PySTAC automatically updates any Catalogs to the most recent supported STAC version and will automatically write this to the JSON object during serialization.*\n",
    "\n",
    "Let's confirm the latest STAC Spec version supported by PySTAC."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:54.338227Z",
     "iopub.status.busy": "2025-09-11T16:53:54.338113Z",
     "iopub.status.idle": "2025-09-11T16:53:54.355305Z",
     "shell.execute_reply": "2025-09-11T16:53:54.354458Z",
     "shell.execute_reply.started": "2025-09-11T16:53:54.338215Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.1.0\n"
     ]
    }
   ],
   "source": [
    "print(get_stac_version())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Crawling Child Catalogs/Collections\n",
    "\n",
    "[STAC Collections](https://github.com/radiantearth/stac-spec/tree/master/collection-spec) are used to group related Items and provide aggregate or summary metadata for those Items.\n",
    "\n",
    "STAC Catalogs may have many nested layers of Catalogs or Collections within the top-level collection. Our example catalog has one Collection within the main Catalog at [landsat-8-l1/collection.json](./example-catalog/landsat-8-l1/collection.json). We can list the Collections in a given Catalog using the [Catalog.get_collections](https://pystac.readthedocs.io/en/latest/api.html#pystac.Catalog.get_collections) method. This method returns an iterable of PySTAC [Collection](https://pystac.readthedocs.io/en/latest/api.html#collection) instances, which we will turn into a `list`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:54.355878Z",
     "iopub.status.busy": "2025-09-11T16:53:54.355747Z",
     "iopub.status.idle": "2025-09-11T16:53:54.359285Z",
     "shell.execute_reply": "2025-09-11T16:53:54.358889Z",
     "shell.execute_reply.started": "2025-09-11T16:53:54.355865Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of collections: 1\n",
      "Collections IDs:\n",
      "- landsat-8-l1\n"
     ]
    }
   ],
   "source": [
    "collections = list(root_catalog.get_collections())\n",
    "\n",
    "print(f\"Number of collections: {len(collections)}\")\n",
    "print(\"Collections IDs:\")\n",
    "for collection in collections:\n",
    "    print(f\"- {collection.id}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's grab that Collection as a PySTAC [Collection](https://pystac.readthedocs.io/en/latest/api.html#collection) instance using the [Catalog.get_child method](https://pystac.readthedocs.io/en/latest/api.html#pystac.Catalog.get_child) so we can look at it in more detail. This method gets a child Catalog or Collection by ID, so we'll use the Collection ID that we printed above. Since this method returns `None` if no child exists with the given ID, we'll check to make sure we actually got the `Collection`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:54.885476Z",
     "iopub.status.busy": "2025-09-11T16:53:54.885235Z",
     "iopub.status.idle": "2025-09-11T16:53:54.888030Z",
     "shell.execute_reply": "2025-09-11T16:53:54.887496Z",
     "shell.execute_reply.started": "2025-09-11T16:53:54.885463Z"
    }
   },
   "outputs": [],
   "source": [
    "collection = root_catalog.get_child(\"landsat-8-l1\")\n",
    "assert collection is not None"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Crawling Items\n",
    "\n",
    "[STAC Items](https://github.com/radiantearth/stac-spec/tree/master/item-spec) are the fundamental building blocks of a STAC Catalog. Each Item represents a single spatiotemporal resource (e.g. a satellite scene).\n",
    "\n",
    "Both Catalogs and Collections may have Items associated with them. Let's crawl our catalog, starting at the root, to see what Items we have. The [Catalog.get_items method](https://pystac.readthedocs.io/en/latest/api.html#pystac.Catalog.get_items) provides a convenient way of recursively listing all Items associated with a Catalog and all of its sub-Catalogs by including the `recursive=True` option."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:55.501459Z",
     "iopub.status.busy": "2025-09-11T16:53:55.500987Z",
     "iopub.status.idle": "2025-09-11T16:53:55.512529Z",
     "shell.execute_reply": "2025-09-11T16:53:55.511976Z",
     "shell.execute_reply.started": "2025-09-11T16:53:55.501423Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of items: 4\n",
      "- LC80140332018166LGN00\n",
      "- LC80150322018141LGN00\n",
      "- LC80150332018189LGN00\n",
      "- LC80300332018166LGN00\n"
     ]
    }
   ],
   "source": [
    "items = list(root_catalog.get_items(recursive=True))\n",
    "\n",
    "print(f\"Number of items: {len(items)}\")\n",
    "for item in items:\n",
    "    print(f\"- {item.id}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These IDs are not very descriptive; in the next section, we will take a look at how we can access the rich metadata associated with each Item."
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Item Metadata\n",
    "\n",
    "Items can have *a lot* of metadata. This can be a bit overwhelming at first, but break the metadata fields down into a few categories:\n",
    "\n",
    "- Core Item Metadata\n",
    "- Common Metadata\n",
    "- STAC Extensions\n",
    "\n",
    "We will walk through each of these metadata categories in the following sections. \n",
    "\n",
    "First, let's grab one of the Items using the [Catalog.get_items method](https://pystac.readthedocs.io/en/latest/api.html#pystac.Catalog.get_items). We will use `recursive=True` to recursively crawl all child Catalogs and/or Collections to find the Item."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:56.581966Z",
     "iopub.status.busy": "2025-09-11T16:53:56.581591Z",
     "iopub.status.idle": "2025-09-11T16:53:56.586208Z",
     "shell.execute_reply": "2025-09-11T16:53:56.585346Z",
     "shell.execute_reply.started": "2025-09-11T16:53:56.581933Z"
    }
   },
   "outputs": [],
   "source": [
    "item = next(root_catalog.get_items(\"LC80140332018166LGN00\", recursive=True))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Core Item Metadata\n",
    "\n",
    "The core Item metadata fields include spatiotemporal information and the ID of the collection to which the Item belongs. These fields are all at the top level of the Item JSON and we can access them through attributes on the [PySTAC Item](https://pystac.readthedocs.io/en/latest/api.html#item) instance."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:57.893519Z",
     "iopub.status.busy": "2025-09-11T16:53:57.893024Z",
     "iopub.status.idle": "2025-09-11T16:53:57.902625Z",
     "shell.execute_reply": "2025-09-11T16:53:57.901939Z",
     "shell.execute_reply.started": "2025-09-11T16:53:57.893480Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'type': 'Polygon',\n",
       " 'coordinates': [[[-76.12180471942207, 39.95810181489563],\n",
       "   [-73.94910518227414, 39.55117185146004],\n",
       "   [-74.49564725552679, 37.826064511480496],\n",
       "   [-76.66550404911956, 38.240699151776084],\n",
       "   [-76.12180471942207, 39.95810181489563]]]}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.geometry"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:58.207488Z",
     "iopub.status.busy": "2025-09-11T16:53:58.207041Z",
     "iopub.status.idle": "2025-09-11T16:53:58.213346Z",
     "shell.execute_reply": "2025-09-11T16:53:58.212399Z",
     "shell.execute_reply.started": "2025-09-11T16:53:58.207451Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[-76.66703, 37.82561, -73.94861, 39.95958]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.bbox"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:58.485290Z",
     "iopub.status.busy": "2025-09-11T16:53:58.484894Z",
     "iopub.status.idle": "2025-09-11T16:53:58.489053Z",
     "shell.execute_reply": "2025-09-11T16:53:58.488573Z",
     "shell.execute_reply.started": "2025-09-11T16:53:58.485269Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2018, 6, 15, 15, 39, 9, tzinfo=tzutc())"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:58.703103Z",
     "iopub.status.busy": "2025-09-11T16:53:58.702620Z",
     "iopub.status.idle": "2025-09-11T16:53:58.709779Z",
     "shell.execute_reply": "2025-09-11T16:53:58.708528Z",
     "shell.execute_reply.started": "2025-09-11T16:53:58.703063Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'landsat-8-l1'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.collection_id"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "If we want the actual `Collection` instance instead of just the ID, we can use the [Item.get_collection](https://pystac.readthedocs.io/en/latest/api.html#pystac.Item.get_collection) method."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:53:59.325563Z",
     "iopub.status.busy": "2025-09-11T16:53:59.325121Z",
     "iopub.status.idle": "2025-09-11T16:53:59.354690Z",
     "shell.execute_reply": "2025-09-11T16:53:59.354062Z",
     "shell.execute_reply.started": "2025-09-11T16:53:59.325525Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "<style>\n",
       ".pystac-summary {\n",
       "    cursor: pointer;\n",
       "    display: list-item;\n",
       "    list-style: revert;\n",
       "    margin-bottom: 0 !important;\n",
       "\n",
       "    .pystac-l {\n",
       "        padding-left: 0.5em;\n",
       "        color: rgb(64, 128, 128);\n",
       "        font-style: italic;\n",
       "    }\n",
       "}\n",
       ".pystac-row {\n",
       "    overflow-wrap: break-word;\n",
       "    padding-left: .825em;\n",
       "\n",
       "    .pystac-k {\n",
       "        display: inline-block;\n",
       "        margin: 0px 0.5em 0px 0px;\n",
       "    }\n",
       "    .pystac-v {\n",
       "        color: rgb(186, 33, 33);\n",
       "    }\n",
       "}\n",
       ".pystac-k {\n",
       "    color: rgb(0, 128, 0);\n",
       "    font-weight: 700;\n",
       "}\n",
       ".pystac-wrap {\n",
       "  display: block !important;\n",
       "}\n",
       ".pystac-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "</style>\n",
       "<div>\n",
       "<div class=\"pystac-text-repr-fallback\">\n",
       "    &lt;Collection id=landsat-8-l1&gt;\n",
       "</div>\n",
       "<div class=\"jp-RenderedJSON jp-mod-trusted jp-OutputArea-output pystac-wrap\" style='display:none'>\n",
       "    <div class=\"container\" style=\"line-height: normal;\">\n",
       "        <ul style=\"padding: 0px; margin: 0px; list-style: none; display: block;\">\n",
       "            \n",
       "                \n",
       "                    \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">type</span>\n",
       "            <span class=\"pystac-v\">\"Collection\"</span>\n",
       "        </li>\n",
       "    \n",
       "                \n",
       "            \n",
       "                \n",
       "                    \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">id</span>\n",
       "            <span class=\"pystac-v\">\"landsat-8-l1\"</span>\n",
       "        </li>\n",
       "    \n",
       "                \n",
       "            \n",
       "                \n",
       "                    \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">stac_version</span>\n",
       "            <span class=\"pystac-v\">\"1.1.0\"</span>\n",
       "        </li>\n",
       "    \n",
       "                \n",
       "            \n",
       "                \n",
       "                    \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">description</span>\n",
       "            <span class=\"pystac-v\">\"Landsat 8 imagery radiometrically calibrated and orthorectified using ground points and Digital Elevation Model (DEM) data to correct relief displacement.\"</span>\n",
       "        </li>\n",
       "    \n",
       "                \n",
       "            \n",
       "                \n",
       "                    <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">links</span><span class=\"pystac-l\">[] 7 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">0</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">rel</span>\n",
       "            <span class=\"pystac-v\">\"root\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">href</span>\n",
       "            <span class=\"pystac-v\">\"/home/jsignell/pystac/docs/example-catalog/catalog.json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">type</span>\n",
       "            <span class=\"pystac-v\">\"application/json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">title</span>\n",
       "            <span class=\"pystac-v\">\"STAC for Landsat data\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">1</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">rel</span>\n",
       "            <span class=\"pystac-v\">\"item\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">href</span>\n",
       "            <span class=\"pystac-v\">\"/home/jsignell/pystac/docs/example-catalog/landsat-8-l1/2018-06/LC80140332018166LGN00.json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">2</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">rel</span>\n",
       "            <span class=\"pystac-v\">\"item\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">href</span>\n",
       "            <span class=\"pystac-v\">\"/home/jsignell/pystac/docs/example-catalog/landsat-8-l1/2018-05/LC80150322018141LGN00.json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">3</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">rel</span>\n",
       "            <span class=\"pystac-v\">\"item\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">href</span>\n",
       "            <span class=\"pystac-v\">\"/home/jsignell/pystac/docs/example-catalog/landsat-8-l1/2018-07/LC80150332018189LGN00.json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">4</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">rel</span>\n",
       "            <span class=\"pystac-v\">\"item\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">href</span>\n",
       "            <span class=\"pystac-v\">\"/home/jsignell/pystac/docs/example-catalog/landsat-8-l1/2018-06/LC80300332018166LGN00.json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">5</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">rel</span>\n",
       "            <span class=\"pystac-v\">\"self\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">href</span>\n",
       "            <span class=\"pystac-v\">\"/home/jsignell/pystac/docs/example-catalog/landsat-8-l1/collection.json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">type</span>\n",
       "            <span class=\"pystac-v\">\"application/json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">6</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">rel</span>\n",
       "            <span class=\"pystac-v\">\"parent\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">href</span>\n",
       "            <span class=\"pystac-v\">\"/home/jsignell/pystac/docs/example-catalog/catalog.json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">type</span>\n",
       "            <span class=\"pystac-v\">\"application/json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">title</span>\n",
       "            <span class=\"pystac-v\">\"STAC for Landsat data\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "                \n",
       "            \n",
       "                \n",
       "                    <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">stac_extensions</span><span class=\"pystac-l\">[] 1 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">0</span>\n",
       "            <span class=\"pystac-v\">\"https://example.com/stac/landsat-extension/1.0/schema.json\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "                \n",
       "            \n",
       "                \n",
       "                    \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">properties</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">collection</span>\n",
       "            <span class=\"pystac-v\">\"landsat-8-l1\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">instruments</span><span class=\"pystac-l\">[] 1 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">0</span>\n",
       "            <span class=\"pystac-v\">\"OLI_TIRS\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">view:sun_azimuth</span>\n",
       "            <span class=\"pystac-v\">149.01607154</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">eo:bands</span><span class=\"pystac-l\">[] 11 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">0</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B1\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.02</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">0.44</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"coastal\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">1</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B2\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.06</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">0.48</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"blue\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">2</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B3\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.06</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">0.56</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"green\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">3</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B4\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.04</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">0.65</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"red\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">4</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B5\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.03</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">0.86</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"nir\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">5</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B6\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.08</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">1.6</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"swir16\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">6</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B7\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.22</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">2.2</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"swir22\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">7</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B8\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.18</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">0.59</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"pan\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">8</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B9\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.02</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">1.37</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"cirrus\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">9</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B10\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">0.8</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">10.9</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"lwir11\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">10</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"B11\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">full_width_half_max</span>\n",
       "            <span class=\"pystac-v\">1</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">center_wavelength</span>\n",
       "            <span class=\"pystac-v\">12</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">common_name</span>\n",
       "            <span class=\"pystac-v\">\"lwir2\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">view:off_nadir</span>\n",
       "            <span class=\"pystac-v\">0</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">view:azimuth</span>\n",
       "            <span class=\"pystac-v\">0</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">platform</span>\n",
       "            <span class=\"pystac-v\">\"landsat-8\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">gsd</span>\n",
       "            <span class=\"pystac-v\">15</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">view:sun_elevation</span>\n",
       "            <span class=\"pystac-v\">59.214247</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "                \n",
       "            \n",
       "                \n",
       "                    \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">title</span>\n",
       "            <span class=\"pystac-v\">\"Landsat 8 L1\"</span>\n",
       "        </li>\n",
       "    \n",
       "                \n",
       "            \n",
       "                \n",
       "                    \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">extent</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">spatial</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">bbox</span><span class=\"pystac-l\">[] 1 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">0</span><span class=\"pystac-l\">[] 4 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">0</span>\n",
       "            <span class=\"pystac-v\">-180.0</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">1</span>\n",
       "            <span class=\"pystac-v\">-90.0</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">2</span>\n",
       "            <span class=\"pystac-v\">180.0</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">3</span>\n",
       "            <span class=\"pystac-v\">90.0</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">temporal</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">interval</span><span class=\"pystac-l\">[] 1 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">0</span><span class=\"pystac-l\">[] 2 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">0</span>\n",
       "            <span class=\"pystac-v\">\"2018-05-21T15:44:59Z\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">1</span>\n",
       "            <span class=\"pystac-v\">\"2018-07-08T15:45:34Z\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "                \n",
       "            \n",
       "                \n",
       "                    \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">license</span>\n",
       "            <span class=\"pystac-v\">\"other\"</span>\n",
       "        </li>\n",
       "    \n",
       "                \n",
       "            \n",
       "                \n",
       "                    <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">keywords</span><span class=\"pystac-l\">[] 3 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">0</span>\n",
       "            <span class=\"pystac-v\">\"landsat\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">1</span>\n",
       "            <span class=\"pystac-v\">\"earth observation\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">2</span>\n",
       "            <span class=\"pystac-v\">\"usgs\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "                \n",
       "            \n",
       "                \n",
       "                    <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">providers</span><span class=\"pystac-l\">[] 1 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li><details>\n",
       "            <summary class=\"pystac-summary\"><span class=\"pystac-k\">0</span></summary>\n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">name</span>\n",
       "            <span class=\"pystac-v\">\"Development Seed\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "            \n",
       "                <li><details>\n",
       "        <summary class=\"pystac-summary\"><span class=\"pystac-k\">roles</span><span class=\"pystac-l\">[] 1 items</span></summary>\n",
       "        \n",
       "            <ul style=\"margin: 0px; padding: 0px 0px 0px 1.75em; list-style: none; display: block;\">\n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">0</span>\n",
       "            <span class=\"pystac-v\">\"processor\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "            \n",
       "        \n",
       "            \n",
       "                \n",
       "        <li class=\"pystac-row\">\n",
       "            <span class=\"pystac-k\">url</span>\n",
       "            <span class=\"pystac-v\">\"https://github.com/sat-utils/sat-api\"</span>\n",
       "        </li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        </details></li>\n",
       "    \n",
       "            \n",
       "        \n",
       "    </ul>\n",
       "        \n",
       "    </details></li>\n",
       "                \n",
       "            \n",
       "        </ul>\n",
       "    </div>\n",
       "</div>\n",
       "</div>"
      ],
      "text/plain": [
       "<Collection id=landsat-8-l1>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.get_collection()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Common Metadata\n",
    "\n",
    "Certain fields that are commonly used in Items, but may also be found in other objects (e.g. Assets) are defined in the [Common Metadata](https://github.com/radiantearth/stac-spec/blob/master/item-spec/common-metadata.md) section of the spec. These include licensing and instrument information, descriptions of datetime ranges, and some other common fields. These properties can be found as attributes of the `Item.common_metadata` property, which is an instance of the [CommonMetadata class](https://pystac.readthedocs.io/en/latest/api.html#pystac.CommonMetadata)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:12.242671Z",
     "iopub.status.busy": "2025-09-11T16:54:12.241943Z",
     "iopub.status.idle": "2025-09-11T16:54:12.249301Z",
     "shell.execute_reply": "2025-09-11T16:54:12.248687Z",
     "shell.execute_reply.started": "2025-09-11T16:54:12.242599Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['OLI_TIRS']"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.common_metadata.instruments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:12.740988Z",
     "iopub.status.busy": "2025-09-11T16:54:12.740804Z",
     "iopub.status.idle": "2025-09-11T16:54:12.744503Z",
     "shell.execute_reply": "2025-09-11T16:54:12.744071Z",
     "shell.execute_reply.started": "2025-09-11T16:54:12.740974Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'landsat-8'"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.common_metadata.platform"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:13.012531Z",
     "iopub.status.busy": "2025-09-11T16:54:13.012152Z",
     "iopub.status.idle": "2025-09-11T16:54:13.018730Z",
     "shell.execute_reply": "2025-09-11T16:54:13.017766Z",
     "shell.execute_reply.started": "2025-09-11T16:54:13.012500Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.common_metadata.gsd"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### STAC Extensions\n",
    "\n",
    "[STAC Extensions](https://stac-extensions.github.io/) are a mechanism for providing additional metadata not covered by the core STAC Spec. We can see which STAC Extensions are implemented by this particular Item by examining the list of extension URIs in the `stac_extensions` field."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:13.867162Z",
     "iopub.status.busy": "2025-09-11T16:54:13.866693Z",
     "iopub.status.idle": "2025-09-11T16:54:13.874348Z",
     "shell.execute_reply": "2025-09-11T16:54:13.872895Z",
     "shell.execute_reply.started": "2025-09-11T16:54:13.867127Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['https://stac-extensions.github.io/eo/v1.1.0/schema.json',\n",
       " 'https://stac-extensions.github.io/view/v1.0.0/schema.json',\n",
       " 'https://stac-extensions.github.io/projection/v2.0.0/schema.json']"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.stac_extensions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This Item implements the [Electro-Optical](https://github.com/stac-extensions/eo), [View Geometry](https://github.com/stac-extensions/view), and [Projection](https://github.com/stac-extensions/projection) Extensions. \n",
    "\n",
    "We can also check if a specific extension is implemented using [ext.has](https://pystac.readthedocs.io/en/latest/api.html#pystac.item.ext.has) with the name of that extension."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:14.391585Z",
     "iopub.status.busy": "2025-09-11T16:54:14.391134Z",
     "iopub.status.idle": "2025-09-11T16:54:14.404483Z",
     "shell.execute_reply": "2025-09-11T16:54:14.403721Z",
     "shell.execute_reply.started": "2025-09-11T16:54:14.391548Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.ext.has(\"eo\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:14.648775Z",
     "iopub.status.busy": "2025-09-11T16:54:14.648176Z",
     "iopub.status.idle": "2025-09-11T16:54:14.656069Z",
     "shell.execute_reply": "2025-09-11T16:54:14.654806Z",
     "shell.execute_reply.started": "2025-09-11T16:54:14.648726Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.ext.has(\"raster\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can access fields associated with the extension as attributes on the extension instance. For instance, the [\"eo:cloud_cover\" field](https://github.com/stac-extensions/eo#item-properties-or-asset-fields) defined in the Electro-Optical Extension can be accessed using the [item.ext.eo.cloud_cover](https://pystac.readthedocs.io/en/latest/api.html#pystac.extensions.eo.EOExtension.cloud_cover) attribute."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:15.194408Z",
     "iopub.status.busy": "2025-09-11T16:54:15.193992Z",
     "iopub.status.idle": "2025-09-11T16:54:15.198657Z",
     "shell.execute_reply": "2025-09-11T16:54:15.198163Z",
     "shell.execute_reply.started": "2025-09-11T16:54:15.194374Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "22"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.ext.eo.cloud_cover"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also access the cloud cover field directly in the Item properties."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:15.791443Z",
     "iopub.status.busy": "2025-09-11T16:54:15.791262Z",
     "iopub.status.idle": "2025-09-11T16:54:15.795077Z",
     "shell.execute_reply": "2025-09-11T16:54:15.794406Z",
     "shell.execute_reply.started": "2025-09-11T16:54:15.791428Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "22"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "item.properties[\"eo:cloud_cover\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can access the Item's assets through the `assets` attribute, which is a dictionary:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:16.454670Z",
     "iopub.status.busy": "2025-09-11T16:54:16.454490Z",
     "iopub.status.idle": "2025-09-11T16:54:16.458930Z",
     "shell.execute_reply": "2025-09-11T16:54:16.457847Z",
     "shell.execute_reply.started": "2025-09-11T16:54:16.454656Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "index: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/index.html (text/html)\n",
      "thumbnail: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_thumb_large.jpg (image/jpeg)\n",
      "B1: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B1.TIF (image/tiff)\n",
      "B2: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B2.TIF (image/tiff)\n",
      "B3: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B3.TIF (image/tiff)\n",
      "B4: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B4.TIF (image/tiff)\n",
      "B5: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B5.TIF (image/tiff)\n",
      "B6: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B6.TIF (image/tiff)\n",
      "B7: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B7.TIF (image/tiff)\n",
      "B8: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B8.TIF (image/tiff)\n",
      "B9: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B9.TIF (image/tiff)\n",
      "B10: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B10.TIF (image/tiff)\n",
      "B11: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B11.TIF (image/tiff)\n",
      "ANG: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_ANG.txt (text/plain)\n",
      "MTL: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_MTL.txt (text/plain)\n",
      "BQA: https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_BQA.TIF (image/tiff)\n"
     ]
    }
   ],
   "source": [
    "for asset_key in item.assets:\n",
    "    asset = item.assets[asset_key]\n",
    "    print(\"{}: {} ({})\".format(asset_key, asset.href, asset.media_type))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use the `to_dict()` method to convert an Asset, or any PySTAC object, into a dictionary:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:17.378612Z",
     "iopub.status.busy": "2025-09-11T16:54:17.378438Z",
     "iopub.status.idle": "2025-09-11T16:54:17.382463Z",
     "shell.execute_reply": "2025-09-11T16:54:17.382127Z",
     "shell.execute_reply.started": "2025-09-11T16:54:17.378598Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'href': 'https://s3-us-west-2.amazonaws.com/landsat-pds/c1/L8/014/033/LC08_L1TP_014033_20180615_20180703_01_T1/LC08_L1TP_014033_20180615_20180703_01_T1_B3.TIF',\n",
       " 'type': 'image/tiff',\n",
       " 'title': 'Band 3 (green)',\n",
       " 'eo:bands': [{'name': 'B3',\n",
       "   'full_width_half_max': 0.06,\n",
       "   'center_wavelength': 0.56,\n",
       "   'common_name': 'green'}],\n",
       " 'roles': []}"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "asset = item.assets[\"B3\"]\n",
    "asset.to_dict()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we use the eo extension to get the band information for the asset:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:17.948428Z",
     "iopub.status.busy": "2025-09-11T16:54:17.948185Z",
     "iopub.status.idle": "2025-09-11T16:54:17.951893Z",
     "shell.execute_reply": "2025-09-11T16:54:17.951535Z",
     "shell.execute_reply.started": "2025-09-11T16:54:17.948409Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<Band name=B3>]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bands = asset.ext.eo.bands\n",
    "bands"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:18.228225Z",
     "iopub.status.busy": "2025-09-11T16:54:18.227811Z",
     "iopub.status.idle": "2025-09-11T16:54:18.234103Z",
     "shell.execute_reply": "2025-09-11T16:54:18.233361Z",
     "shell.execute_reply.started": "2025-09-11T16:54:18.228191Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name': 'B3',\n",
       " 'full_width_half_max': 0.06,\n",
       " 'center_wavelength': 0.56,\n",
       " 'common_name': 'green'}"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bands[0].to_dict()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Writing STAC Objects\n",
    "\n",
    "We can also use PySTAC to create and/or update STAC objects and write them to disk. This Quickstart Tutorial will introduce you to some very basic concepts in writing STAC objects; for a more thorough tutorial, please see the [\"How to create STAC Catalogs\"](./tutorials/how-to-create-stac-catalogs.ipynb) tutorial.\n",
    "\n",
    "Suppose there was a mistake in the cloud cover value that we looked at earlier and that we would like to add a value for the `instrument` field, which is currently null. We can update these values using the same attributes and properties as before, then save the entire catalog to our local drive."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:18.881422Z",
     "iopub.status.busy": "2025-09-11T16:54:18.880964Z",
     "iopub.status.idle": "2025-09-11T16:54:18.885045Z",
     "shell.execute_reply": "2025-09-11T16:54:18.884240Z",
     "shell.execute_reply.started": "2025-09-11T16:54:18.881397Z"
    }
   },
   "outputs": [],
   "source": [
    "new_catalog = root_catalog.clone()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:19.363337Z",
     "iopub.status.busy": "2025-09-11T16:54:19.362517Z",
     "iopub.status.idle": "2025-09-11T16:54:19.370157Z",
     "shell.execute_reply": "2025-09-11T16:54:19.368415Z",
     "shell.execute_reply.started": "2025-09-11T16:54:19.363224Z"
    }
   },
   "outputs": [],
   "source": [
    "item_to_update = next(root_catalog.get_items(\"LC80140332018166LGN00\", recursive=True))\n",
    "\n",
    "# Update the cloud cover\n",
    "item_to_update.ext.eo.cloud_cover = 30\n",
    "\n",
    "# Add the instrument field\n",
    "item_to_update.common_metadata.instruments = [\"LANDSAT\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can examine the Item properties directly to verify that the changes have taken effect."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:20.012978Z",
     "iopub.status.busy": "2025-09-11T16:54:20.012710Z",
     "iopub.status.idle": "2025-09-11T16:54:20.016632Z",
     "shell.execute_reply": "2025-09-11T16:54:20.015924Z",
     "shell.execute_reply.started": "2025-09-11T16:54:20.012957Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "New Cloud Cover: 30\n",
      "New Instruments: ['LANDSAT']\n"
     ]
    }
   ],
   "source": [
    "print(f\"New Cloud Cover: {item_to_update.properties['eo:cloud_cover']}\")\n",
    "print(f\"New Instruments: {item_to_update.properties['instruments']}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We will write this updated catalog to a temporary directory in our local drive using the [Catalog.normalize_and_save](https://pystac.readthedocs.io/en/latest/api.html#pystac.Catalog.normalize_and_save) method."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:20.831120Z",
     "iopub.status.busy": "2025-09-11T16:54:20.830559Z",
     "iopub.status.idle": "2025-09-11T16:54:20.837226Z",
     "shell.execute_reply": "2025-09-11T16:54:20.835531Z",
     "shell.execute_reply.started": "2025-09-11T16:54:20.831076Z"
    }
   },
   "outputs": [],
   "source": [
    "# Create a temporary directory\n",
    "tmp_dir = tempfile.mkdtemp()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:21.086173Z",
     "iopub.status.busy": "2025-09-11T16:54:21.085645Z",
     "iopub.status.idle": "2025-09-11T16:54:21.095138Z",
     "shell.execute_reply": "2025-09-11T16:54:21.094659Z",
     "shell.execute_reply.started": "2025-09-11T16:54:21.086132Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Catalog saved to: /tmp/tmpmj8y75bk/catalog.json\n"
     ]
    }
   ],
   "source": [
    "# Save the catalog and normalize all paths\n",
    "new_catalog.normalize_and_save(tmp_dir)\n",
    "print(f\"Catalog saved to: {new_catalog.get_self_href()}\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can open up Item that we just updated to verify that the new values were written to disk."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:22.007363Z",
     "iopub.status.busy": "2025-09-11T16:54:22.006940Z",
     "iopub.status.idle": "2025-09-11T16:54:22.009943Z",
     "shell.execute_reply": "2025-09-11T16:54:22.009436Z",
     "shell.execute_reply.started": "2025-09-11T16:54:22.007328Z"
    }
   },
   "outputs": [],
   "source": [
    "item_path = Path(tmp_dir) / \"landsat-8-l1\" / \"LC80140332018166LGN00\" / \"\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Finally, we clean up the temporary directory."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-09-11T16:54:25.139751Z",
     "iopub.status.busy": "2025-09-11T16:54:25.139555Z",
     "iopub.status.idle": "2025-09-11T16:54:25.143090Z",
     "shell.execute_reply": "2025-09-11T16:54:25.141941Z",
     "shell.execute_reply.started": "2025-09-11T16:54:25.139737Z"
    }
   },
   "outputs": [],
   "source": [
    "shutil.rmtree(tmp_dir, ignore_errors=True)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.10.12"
  },
  "vscode": {
   "interpreter": {
    "hash": "28618a729221ed2dc6301bcedf20e90b9d193b9b884dd15c675da71a09b73fa8"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
