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

Tidy repo #187

Merged
merged 19 commits into from
Nov 7, 2024
Prev Previous commit
Edit satellite data notebook
nf679 committed Nov 6, 2024

Verified

This commit was signed with the committer’s verified signature.
kidroca Peter Velkov
commit 5b1e6323309b0395ab095790a5c97f9033c5e6f1
30 changes: 30 additions & 0 deletions python-data/exercises/ex09b_satellite_data.ipynb
Original file line number Diff line number Diff line change
@@ -46,6 +46,36 @@
"The [STAC browser](https://radiantearth.github.io/stac-browser/#/) is a good starting point to discover available datasets, as it provides an up-to-date list of existing STAC catalogs. From the list, let's click on the \"Earth Search\" catalog, i.e. the access point to search the archive of Sentinel-2 images hosted on AWS.\n"
]
},
{
"cell_type": "markdown",
"id": "bb95dfdf-8721-4d47-af20-211e2f7bd491",
"metadata": {},
"source": [
"## Install some packages we will need\n",
"\n",
"We need to install some additional python packages which unfortunately aren't (yet) on Jaspy. To do this, we run:\n",
"\n",
"`pip install --user pystac_client rioxarray shapely pyproj`\n",
"\n",
"Which will install these python packages into your local python path, so we can use them with your account alongside all the packages in Jaspy. __NOTE: this command may take some time__ "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4ab589c7-f462-4c6d-aaa6-b1dc630e5cf6",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"# Type the pip command here"
]
},
{
"cell_type": "markdown",
"id": "517be10e-1c03-433c-b6b9-3722cc0d15b9",
85 changes: 84 additions & 1 deletion python-data/solutions/ex09b_satellite_data.ipynb
Original file line number Diff line number Diff line change
@@ -48,8 +48,91 @@
},
{
"cell_type": "markdown",
"id": "517be10e-1c03-433c-b6b9-3722cc0d15b9",
"id": "db452b95-5e0b-47f9-ac30-330b27956c51",
"metadata": {},
"source": [
"## Install some packages we will need\n",
"\n",
"We need to install some additional python packages which unfortunately aren't (yet) on Jaspy. To do this, we run:\n",
"\n",
"`pip install --user pystac_client rioxarray shapely pyproj`\n",
"\n",
"Which will install these python packages into your local python path, so we can use them with your account alongside all the packages in Jaspy. __NOTE: this command may take some time__ "
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "ea2ff2df-b2e5-4804-8e2b-3c05f8d0b8ac",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting pystac_client\n",
" Downloading pystac_client-0.8.5-py3-none-any.whl.metadata (5.1 kB)\n",
"Requirement already satisfied: rioxarray in /opt/jaspy/lib/python3.11/site-packages (0.17.0)\n",
"Requirement already satisfied: shapely in /opt/jaspy/lib/python3.11/site-packages (2.0.4)\n",
"Requirement already satisfied: pyproj in /opt/jaspy/lib/python3.11/site-packages (3.6.1)\n",
"Requirement already satisfied: requests>=2.28.2 in /opt/jaspy/lib/python3.11/site-packages (from pystac_client) (2.32.3)\n",
"Collecting pystac>=1.10.0 (from pystac[validation]>=1.10.0->pystac_client)\n",
" Downloading pystac-1.11.0-py3-none-any.whl.metadata (4.5 kB)\n",
"Requirement already satisfied: python-dateutil>=2.8.2 in /opt/jaspy/lib/python3.11/site-packages (from pystac_client) (2.9.0)\n",
"Requirement already satisfied: packaging in /opt/jaspy/lib/python3.11/site-packages (from rioxarray) (24.1)\n",
"Requirement already satisfied: rasterio>=1.3 in /opt/jaspy/lib/python3.11/site-packages (from rioxarray) (1.3.9)\n",
"Requirement already satisfied: xarray>=2022.3.0 in /opt/jaspy/lib/python3.11/site-packages (from rioxarray) (2024.7.0)\n",
"Requirement already satisfied: numpy>=1.23 in /opt/jaspy/lib/python3.11/site-packages (from rioxarray) (1.26.4)\n",
"Requirement already satisfied: certifi in /opt/jaspy/lib/python3.11/site-packages (from pyproj) (2024.7.4)\n",
"Requirement already satisfied: jsonschema~=4.18 in /opt/jaspy/lib/python3.11/site-packages (from pystac[validation]>=1.10.0->pystac_client) (4.23.0)\n",
"Requirement already satisfied: six>=1.5 in /opt/jaspy/lib/python3.11/site-packages (from python-dateutil>=2.8.2->pystac_client) (1.16.0)\n",
"Requirement already satisfied: affine in /opt/jaspy/lib/python3.11/site-packages (from rasterio>=1.3->rioxarray) (2.4.0)\n",
"Requirement already satisfied: attrs in /opt/jaspy/lib/python3.11/site-packages (from rasterio>=1.3->rioxarray) (24.2.0)\n",
"Requirement already satisfied: click>=4.0 in /opt/jaspy/lib/python3.11/site-packages (from rasterio>=1.3->rioxarray) (8.1.7)\n",
"Requirement already satisfied: cligj>=0.5 in /opt/jaspy/lib/python3.11/site-packages (from rasterio>=1.3->rioxarray) (0.7.2)\n",
"Requirement already satisfied: snuggs>=1.4.1 in /opt/jaspy/lib/python3.11/site-packages (from rasterio>=1.3->rioxarray) (1.4.7)\n",
"Requirement already satisfied: click-plugins in /opt/jaspy/lib/python3.11/site-packages (from rasterio>=1.3->rioxarray) (1.1.1)\n",
"Requirement already satisfied: setuptools in /opt/jaspy/lib/python3.11/site-packages (from rasterio>=1.3->rioxarray) (72.1.0)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /opt/jaspy/lib/python3.11/site-packages (from requests>=2.28.2->pystac_client) (3.3.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /opt/jaspy/lib/python3.11/site-packages (from requests>=2.28.2->pystac_client) (3.7)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/jaspy/lib/python3.11/site-packages (from requests>=2.28.2->pystac_client) (2.2.2)\n",
"Requirement already satisfied: pandas>=2.0 in /opt/jaspy/lib/python3.11/site-packages (from xarray>=2022.3.0->rioxarray) (2.2.2)\n",
"Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /opt/jaspy/lib/python3.11/site-packages (from jsonschema~=4.18->pystac[validation]>=1.10.0->pystac_client) (2023.12.1)\n",
"Requirement already satisfied: referencing>=0.28.4 in /opt/jaspy/lib/python3.11/site-packages (from jsonschema~=4.18->pystac[validation]>=1.10.0->pystac_client) (0.35.1)\n",
"Requirement already satisfied: rpds-py>=0.7.1 in /opt/jaspy/lib/python3.11/site-packages (from jsonschema~=4.18->pystac[validation]>=1.10.0->pystac_client) (0.20.0)\n",
"Requirement already satisfied: pytz>=2020.1 in /opt/jaspy/lib/python3.11/site-packages (from pandas>=2.0->xarray>=2022.3.0->rioxarray) (2024.1)\n",
"Requirement already satisfied: tzdata>=2022.7 in /opt/jaspy/lib/python3.11/site-packages (from pandas>=2.0->xarray>=2022.3.0->rioxarray) (2024.1)\n",
"Requirement already satisfied: pyparsing>=2.1.6 in /opt/jaspy/lib/python3.11/site-packages (from snuggs>=1.4.1->rasterio>=1.3->rioxarray) (3.1.2)\n",
"Downloading pystac_client-0.8.5-py3-none-any.whl (41 kB)\n",
"Downloading pystac-1.11.0-py3-none-any.whl (183 kB)\n",
"Installing collected packages: pystac, pystac_client\n",
"\u001b[33m WARNING: The script stac-client is installed in '/home/users/nfarmer/.local/bin' which is not on PATH.\n",
" Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.\u001b[0m\u001b[33m\n",
"\u001b[0mSuccessfully installed pystac-1.11.0 pystac_client-0.8.5\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"pip install --user pystac_client rioxarray shapely pyproj"
]
},
{
"cell_type": "markdown",
"id": "517be10e-1c03-433c-b6b9-3722cc0d15b9",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"## **Exercise:** Discover a STAC catalog\n",
"Let's take a moment to explore the Earth Search STAC catalog, which is the catalog indexing the Sentinel-2 collection\n",