From 042cf489dd3eb572eea1c337a56995ad219af183 Mon Sep 17 00:00:00 2001 From: Tasha Snow Date: Fri, 5 Jul 2024 20:35:31 -0600 Subject: [PATCH] Delete book/external/Multi-File_Direct_S3_Access_COG_Example.ipynb --- ...ti-File_Direct_S3_Access_COG_Example.ipynb | 279 ------------------ 1 file changed, 279 deletions(-) delete mode 100644 book/external/Multi-File_Direct_S3_Access_COG_Example.ipynb diff --git a/book/external/Multi-File_Direct_S3_Access_COG_Example.ipynb b/book/external/Multi-File_Direct_S3_Access_COG_Example.ipynb deleted file mode 100644 index 57d008a..0000000 --- a/book/external/Multi-File_Direct_S3_Access_COG_Example.ipynb +++ /dev/null @@ -1,279 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "23083ab7", - "metadata": {}, - "source": [ - "# Multi-COG Direct S3\n", - "\n", - "imported on: **2022-11-28**\n", - "\n", - "

This notebook is from NASA's OpenScapes COG Direct S3 - Multi-file access notebook

\n", - "\n", - "> The original source for this document is [https://github.com/NASA-Openscapes/earthdata-cloud-cookbook](https://github.com/NASA-Openscapes/earthdata-cloud-cookbook)" - ] - }, - { - "cell_type": "raw", - "id": "c08822bc-d191-45b5-ac81-7eea60e0b044", - "metadata": {}, - "source": [ - "---\n", - "title: Accessing Multiple COG Files\n", - "---" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "635c520e-b209-4fe3-9738-ea19d72e2940", - "metadata": {}, - "outputs": [], - "source": [ - "from pystac_client import Client\n", - "import stackstac" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a982edf5-1ba3-47ac-b137-0cf512b8d851", - "metadata": {}, - "outputs": [], - "source": [ - "STAC_URL = 'https://cmr.earthdata.nasa.gov/stac'" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f34f3214-8b20-4e98-b30f-3c5b0139ee7a", - "metadata": {}, - "outputs": [], - "source": [ - "catalog = Client.open(f\"{STAC_URL}/LPCLOUD\")" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "845edc49-65f0-4a3f-9d3b-af8a7c8df484", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5c12b931-e214-42bd-843c-b314cf8a72c3", - "metadata": {}, - "outputs": [], - "source": [ - "search = catalog.search(\n", - " collections = ['HLSL30.v2.0', 'HLSS30.v2.0'],\n", - " intersects = {'type': 'Polygon',\n", - " 'coordinates': [[[-101.67271614074707, 41.04754380304359],\n", - " [-101.65344715118408, 41.04754380304359],\n", - " [-101.65344715118408, 41.06213891056728],\n", - " [-101.67271614074707, 41.06213891056728],\n", - " [-101.67271614074707, 41.04754380304359]]]},\n", - " datetime = '2021-05/2021-08'\n", - ") " - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7171db53-0177-40e2-a71a-3706aaf0d53a", - "metadata": {}, - "outputs": [], - "source": [ - "search.matched()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4bf7f0eb-6cd4-4e9d-98a2-7fceef5bd35d", - "metadata": {}, - "outputs": [], - "source": [ - "ic = search.get_all_items()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "cc3654f4-70d3-4d3c-a6e3-984a49a141f6", - "metadata": {}, - "outputs": [], - "source": [ - "il = list(search.get_items())" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "d96ae100-73ac-40bd-8d86-a403dfdb48a7", - "metadata": {}, - "outputs": [], - "source": [ - "tic = [x for x in ic if 'T13TGF' in x.id]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c9bfb4cf-faf7-4984-aeb6-f1ef98c7e05c", - "metadata": {}, - "outputs": [], - "source": [ - "import pystac" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "91d37578-181d-4e18-a9d6-d49f52e3f9ef", - "metadata": {}, - "outputs": [], - "source": [ - "item_collection = pystac.ItemCollection(items=tic)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "44447284-c22f-418a-9c38-af86caead1ae", - "metadata": {}, - "outputs": [], - "source": [ - "item_collection" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "b790cf29-cd23-4dc6-a98d-3e1a26588235", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "il" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f1957155-722e-4918-b9a1-912d015325b8", - "metadata": {}, - "outputs": [], - "source": [ - "data = stackstac.stack(item_collection, assets=['B04', 'B02'], epsg=32613, resolution=30)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "22d06736-2c41-4a3f-99a4-79e22f551334", - "metadata": {}, - "outputs": [], - "source": [ - "data.sel(band='B04').isel(time=[0])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "769fea1d-c13f-4efd-a487-630aabf44b26", - "metadata": {}, - "outputs": [], - "source": [ - "import stackstac\n", - "import pystac_client\n", - "\n", - "URL = \"https://earth-search.aws.element84.com/v0\"\n", - "catalog = pystac_client.Client.open(URL)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "bde49345-482c-490f-99c2-12e65811afe4", - "metadata": {}, - "outputs": [], - "source": [ - "catalog" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "899059d6-82a6-4e63-8363-b47384f88a46", - "metadata": {}, - "outputs": [], - "source": [ - "stac_items = catalog.search(\n", - " intersects=dict(type=\"Point\", coordinates=[-105.78, 35.79]),\n", - " collections=[\"sentinel-s2-l2a-cogs\"],\n", - " datetime=\"2020-04-01/2020-05-01\"\n", - ").get_all_items()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a93fb575-d5c6-417b-9969-6142b45ebf67", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "stac_items" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "868fc6fd-e206-46a9-b751-9832bec856d1", - "metadata": {}, - "outputs": [], - "source": [ - "stack = stackstac.stack(stac_items)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a4580a4c-51cc-464d-b84d-e06ad12b7f05", - "metadata": {}, - "outputs": [], - "source": [ - "stack" - ] - } - ], - "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.9.13" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}