Skip to content

Commit

Permalink
Update notebook, add testing notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt committed Oct 9, 2024
1 parent 50ac8f7 commit 7afa8d3
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 278 deletions.
332 changes: 54 additions & 278 deletions docs/notebooks/Satellite_data.ipynb

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions tests/testing.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"vscode": {
"languageId": "plaintext"
}
},
"outputs": [],
"source": [
"GAUGE_X = 122.2183\n",
"GAUGE_Y = -18.0008\n",
"ENSEMBLE_MODELS = [\"EOT20\", \"HAMTIDE11\"] # simplified for tests\n",
"\n",
"def load_satellite_ds():\n",
" \"\"\"\n",
" Load a sample timeseries of Landsat 8 data using odc-stac\n",
" \"\"\"\n",
" # Connect to stac catalogue\n",
" catalog = pystac_client.Client.open(\"https://explorer.dea.ga.gov.au/stac\")\n",
"\n",
" # Set cloud defaults\n",
" odc.stac.configure_rio(\n",
" cloud_defaults=True,\n",
" aws={\"aws_unsigned\": True},\n",
" )\n",
"\n",
" # Build a query with the parameters above\n",
" bbox = [GAUGE_X - 0.08, GAUGE_Y - 0.08, GAUGE_X + 0.08, GAUGE_Y + 0.08]\n",
" query = catalog.search(\n",
" bbox=bbox,\n",
" collections=[\"ga_ls8c_ard_3\"],\n",
" datetime=\"2020-01/2020-02\",\n",
" )\n",
"\n",
" # Search the STAC catalog for all items matching the query\n",
" ds = odc.stac.load(\n",
" list(query.items()),\n",
" bands=[\"nbart_red\"],\n",
" crs=\"epsg:3577\",\n",
" resolution=30,\n",
" groupby=\"solar_day\",\n",
" bbox=bbox,\n",
" fail_on_error=False,\n",
" chunks={},\n",
" )\n",
"\n",
" return ds\n",
"\n",
"satellite_ds = load_satellite_ds()"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 7afa8d3

Please sign in to comment.