Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try intake v2 again #24

Merged
merged 14 commits into from
Apr 11, 2024
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Once you complete this cookbook, you will have the skills to access, resample, r
## Authors

[Demetris Roumis](https://github.com/droumis)
[Andrew Huang](https://github.com/ahuang11)

### Contributors

Expand All @@ -33,10 +34,9 @@ This cookbook is broken up into two main sections - "Foundations" and "Example W

### Foundations
The foundational content includes:
- Start Here - Introduction to Landsat data
- Data Ingestion - Planetary Computer - Demonstrating a method for loading and accessing Landsat data from Microsoft's platform
- Data Ingestion - Intake - Demonstrating approaches for data access using Intake
- Preprocessing - Regrid - Demonstrating common preprocessing approaches such as regridding
- Start Here - Introduction to Landsat data.
- Data Ingestion - Geospatial-Specific Tooling - Demonstrating a method for loading and accessing Landsat data from Microsoft's Planetary Computer platform with tooling from pystac and odc.
- Data Ingestion - General Purpose Tooling - Demonstrating approaches for domain-independent data access using Intake.

### Example Workflows
Example workflows include:
Expand Down
7 changes: 3 additions & 4 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ parts:
- caption: Foundations
chapters:
- file: notebooks/0.0_Intro_Landsat
- file: notebooks/1.0_Data_Ingestion-Planetary_Computer
- file: notebooks/1.1_Data_Ingestion-Intake
- file: notebooks/2.0_Preprocessing
- file: notebooks/1.0_Data_Ingestion-Geospatial
- file: notebooks/1.1_Data_Ingestion-General
- caption: Example Workflows
chapters:
- file: notebooks/3.0_Spectral_Clustering_PC
- file: notebooks/2.0_Spectral_Clustering_PC

22 changes: 15 additions & 7 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,31 @@ dependencies:
- odc-stac
- ipykernel
- hvplot
- panel
- geoviews<1.10
- panel<1.4.0
- geoviews
- datashader
- colorcet
- intake
- intake-xarray<0.7
- xarray=2023.04
- bokeh<3.0
- intake-xarray
- xarray<2023.04
- bokeh<3.4.0
- dask
- dask-ml
- pandas
- numpy
- cartopy
- rioxarray
- rasterio
- s3fs
- jupyter-book
- jupyterlab
- jupyter_server<2
- pyopenssl>22
- sphinx-pythia-theme
- adlfs
- pip
- pip:
- sphinx-pythia-theme
- stac_geoparquet
- dask_geopandas
- jupyter_bokeh
- pygeos
- intake>=2.0.4
20 changes: 6 additions & 14 deletions notebooks/0.0_Intro_Landsat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"cells": [
{
"cell_type": "markdown",
"id": "477b00c6-6565-4a16-b302-46dac2fff9de",
"id": "e9a66402-d146-40a2-a013-ef1078026efa",
"metadata": {},
"source": [
"![Landsat8](./images/nasa_landsat8.jpg \"Landsat8\")"
"# Start Here - Intro to Landsat Data"
]
},
{
"cell_type": "markdown",
"id": "e9a66402-d146-40a2-a013-ef1078026efa",
"id": "477b00c6-6565-4a16-b302-46dac2fff9de",
"metadata": {},
"source": [
"# Start Here - Intro to Landsat Data"
"![Landsat8](./images/nasa_landsat8.jpg \"Landsat8\")"
]
},
{
Expand Down Expand Up @@ -96,18 +96,10 @@
"source": [
"## Resources and references\n",
"- The Landsat timeline image is originally from [USGS](https://www.usgs.gov/landsat-missions/landsat-satellite-missions?qt-science_support_page_related_con=2) but discovered through [earthsciencedata.org](https://www.earthdatascience.org/courses/use-data-open-source-python/multispectral-remote-sensing/landsat-in-Python/)\n",
"- The Landsat 8 banner image is from [NASA](https://landsat.gsfc.nasa.gov/satellites/landsat-8/landsat-8-mission-details/)\n",
"- The Landsat 8 banner image is from NASA\n",
"- The Landsat spectral bands is from [NASA](https://landsat.gsfc.nasa.gov/satellites/landsat-next/)\n",
"- This page was authored by Demetris Roumis circa Jan, 2023"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "74cb54eb-d2e6-402e-bcc0-8b62394af9c5",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -126,7 +118,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.10.13"
},
"vscode": {
"interpreter": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"cells": [
{
"cell_type": "markdown",
"id": "53b39a59-2225-4406-9136-65b0a4956a6c",
"id": "65c844ec-98e2-40e0-9312-9d6bcd30e4a4",
"metadata": {},
"source": [
"![Planetary Computer](images/planetary_computer_header_800w.png \"Planetary Computer\")"
"# Data Ingestion - Geospatial-Specific Tooling"
]
},
{
"cell_type": "markdown",
"id": "65c844ec-98e2-40e0-9312-9d6bcd30e4a4",
"id": "53b39a59-2225-4406-9136-65b0a4956a6c",
"metadata": {},
"source": [
"# Data Ingestion - Microsoft Planetary Computer"
"![PySTAC](images/pystac.png \"PySTACK\")"
]
},
{
Expand Down Expand Up @@ -41,7 +41,7 @@
"\n",
"[Microsoft Plantery Computer](https://planetarycomputer.microsoft.com/docs/overview/about) is one of several providers of [Landsat Data](https://planetarycomputer.microsoft.com/dataset/group/landsat). We are using it together with [pystac-client](https://pystac-client.readthedocs.io/en/stable/index.html) and [odc-stac](https://odc-stac.readthedocs.io/en/latest/index.html) because together they provide a nice Python API for searching and loading with specific criteria such as spatial area, datetime, Landsat mission, and cloud coverage.\n",
"\n",
"Earth science datasets are often stored on remote servers that may be too large to download locally. Therefore, in this cookbook, we will focus primarily on ingestion approaches that load small portions of data from a remote source, as needed. However, the approach for your own work will depend not only on data size and location but also the intended analysis, so in a follow up notebook, you will see alternative approaches to loading data."
"Earth science datasets are often stored on remote servers that may be too large to download locally. Therefore, in this cookbook, we will focus primarily on ingestion approaches that load small portions of data from a remote source, as needed. However, the approach for your own work will depend not only on data size and location but also the intended analysis, so in a follow up notebook, you will see an alternative approache for generalized data access and management."
]
},
{
Expand Down Expand Up @@ -79,7 +79,6 @@
"metadata": {},
"outputs": [],
"source": [
"# Data\n",
"import odc.stac\n",
"import pandas as pd\n",
"import planetary_computer\n",
Expand Down Expand Up @@ -230,7 +229,7 @@
" datetime=datetime,\n",
" query={\"eo:cloud_cover\": {\"lt\": cloudy_less_than}, \"platform\": {\"in\": [platform]}},\n",
")\n",
"items = search.get_all_items()\n",
"items = search.item_collection()\n",
"print(f\"Returned {len(items)} Items:\")\n",
"item_id = {(i, item.id): i for i, item in enumerate(items)}\n",
"item_id"
Expand Down Expand Up @@ -585,7 +584,7 @@
"The data access approach should adapt to features of the data and your intended analysis. As Landsat data is large and multidimensional, a good approach is to use [Microsoft Plantery Computer](https://planetarycomputer.microsoft.com/docs/overview/about), [pystac-client](https://pystac-client.readthedocs.io/en/stable/index.html), and [odc-stac](https://odc-stac.readthedocs.io/en/latest/index.html) together for searching the metadata catalog and lazily loading specific data chunks. Once you have accessed data, visualize it with hvPlot to ensure that it matches your expectations.\n",
"\n",
"### What's next?\n",
"Before we proceed to workflow examples, we can explore alternate ways of accessing data and the processing steps that are often utilized."
"Before we proceed to workflow examples, we can explore an alternate way of accessing data using generalized tooling."
]
},
{
Expand All @@ -596,7 +595,7 @@
"## Resources and References\n",
"- Authored by Demetris Roumis circa Jan, 2023\n",
"- Guidance for parts of this notebook was provided by Microsoft in ['Reading Data from the STAC API'](https://planetarycomputer.microsoft.com/docs/quickstarts/reading-stac/)\n",
"- The image used in the banner is from [Microsoft](https://ai4edatasetspublicassets.blob.core.windows.net/assets/aod_images/planetary_computer_header_800w.png)"
"- The image used in the banner is from an announcement about PySTAC from Azavea"
]
},
{
Expand Down Expand Up @@ -624,7 +623,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.10.13"
},
"vscode": {
"interpreter": {
Expand Down
Loading
Loading