Skip to content

Commit

Permalink
Update AWS notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-braun committed Nov 20, 2023
1 parent 5e79cdd commit a8b7bd4
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 4 deletions.

Large diffs are not rendered by default.

Binary file modified docs/_build/.jupyter_cache/global.db
Binary file not shown.
47 changes: 43 additions & 4 deletions docs/notebooks/aws.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"metadata": {},
"source": [
"# AWS\n",
"Let's read Sentinel-2 data stored on AWS.\n",
"Let's read satellite data stored on AWS.\n",
"\n",
"This tutorial is a bit tricky as EOReader uses `rasterio` and `cloudpathlib` libraries and they are currently handling S3 buckets differently.\n",
"That's why we'll use the helper context manager `temp_s3` from `sertit.s3`, that will do the right connections for us.\n",
"\n",
"<div class=\"alert alert-info\">\n",
" \n",
" <strong>Note:</strong> These products are not stored in the `.SAFE` format.\n",
" <strong>Note:</strong> These Sentinel-2 products are not stored in the `.SAFE` format. Landsat format is howver the same.\n",
" \n",
"</div>\n",
"\n",
Expand All @@ -40,7 +40,7 @@
"\n",
"from sertit import logs, s3\n",
"from eoreader.reader import Reader\n",
"from eoreader.bands import BLUE\n"
"from eoreader.bands import BLUE"
]
},
{
Expand Down Expand Up @@ -98,7 +98,7 @@
{
"cell_type": "markdown",
"source": [
"## Cloudprocessed by Sinergise: Sentinel-2 L1C\n",
"## Cloud data processed by Sinergise: Sentinel-2 L1C\n",
"\n",
"See this [registry](https://registry.opendata.aws/sentinel-2/) (`arn:aws:s3:::sentinel-s2-l1c`).\n",
"This registry needs authentication.\n",
Expand Down Expand Up @@ -136,6 +136,45 @@
"collapsed": false
},
"id": "514d1d1c09b37c14"
},
{
"cell_type": "markdown",
"source": [
"## Cloud data processed by USGS: Landsat-8\n",
"\n",
"See this [registry](https://registry.opendata.aws/usgs-landsat/) (`arn:aws:s3:::usgs-landsat`).\n",
"This registry needs authentication.\n",
"\n",
"<div class=\"alert alert-info\">\n",
" \n",
" <strong>Note:</strong> USGS data are stored as requester pays in AWS. Don't forget to state this when requesting data!\n",
" \n",
"</div>"
],
"metadata": {
"collapsed": false
},
"id": "851f99e953324d01"
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"with tempenv.TemporaryEnvironment({\n",
" \"AWS_S3_ENDPOINT\": \"s3.us-west-2.amazonaws.com\",\n",
" \"AWS_SECRET_ACCESS_KEY\": os.getenv(\"AMAZON_AWS_SECRET_ACCESS_KEY\"),\n",
" \"AWS_ACCESS_KEY_ID\": os.getenv(\"AMAZON_AWS_ACCESS_KEY_ID\"),\n",
"}):\n",
" with s3.temp_s3(requester_pays=True):\n",
" path = r\"s3://usgs-landsat/collection02/level-1/standard/oli-tirs/2021/016/042/LC08_L1TP_016042_20211027_20211104_02_T1\"\n",
" prod = Reader().open(path)\n",
" prod.plot()"
],
"metadata": {
"collapsed": false
},
"id": "cae8102764f52ba7"
}
],
"metadata": {
Expand Down

0 comments on commit a8b7bd4

Please sign in to comment.