Skip to content

Commit

Permalink
Add new interactive DEA Coastlines app and move all widgets to `dea_t…
Browse files Browse the repository at this point in the history
…ools.app` submodule (#892)

* Update DEA Coastlines notebook to new interactive app, and add app submodule

* Move all apps to new app submodule

* Add relocated files

* added some extra context to two comments

* Address review feedback

Co-authored-by: BexDunn <[email protected]>
  • Loading branch information
robbibt and BexDunn authored Jan 28, 2022
1 parent 5000dba commit 957ed6f
Show file tree
Hide file tree
Showing 13 changed files with 2,968 additions and 2,119 deletions.
1,673 changes: 761 additions & 912 deletions DEA_datasets/DEA_Coastlines.ipynb

Large diffs are not rendered by default.

407 changes: 375 additions & 32 deletions Real_world_examples/Change_filmstrips.ipynb

Large diffs are not rendered by default.

32 changes: 11 additions & 21 deletions Real_world_examples/Crop_health.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,15 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/env/lib/python3.8/site-packages/geopandas/_compat.py:106: UserWarning: The Shapely GEOS version (3.8.0-CAPI-1.13.1 ) is incompatible with the GEOS version PyGEOS was compiled with (3.9.1-CAPI-1.14.2). Conversions between both will be slow.\n",
" warnings.warn(\n"
]
}
],
"outputs": [],
"source": [
"%matplotlib inline\n",
"\n",
"import datacube\n",
"\n",
"import sys\n",
"sys.path.insert(1, \"../Supplementary_data/\")\n",
"from notebookapp_crophealth import load_crophealth_data\n",
"from notebookapp_crophealth import run_crophealth_app"
"sys.path.insert(1, '../Tools/')\n",
"from dea_tools.app import crophealth\n"
]
},
{
Expand Down Expand Up @@ -127,14 +117,14 @@
" s2a_ard_granule\n",
" s2b_ard_granule\n",
"Counting good quality pixels for each time step\n",
"Filtering to 40 out of 68 time steps with at least 50.0% good quality pixels\n",
"Filtering to 38 out of 69 time steps with at least 50.0% good quality pixels\n",
"Applying pixel quality/cloud mask\n",
"Loading 40 time steps\n"
"Loading 38 time steps\n"
]
}
],
"source": [
"dataset_sentinel2 = load_crophealth_data()"
"dataset_sentinel2 = crophealth.load_crophealth_data()"
]
},
{
Expand All @@ -159,7 +149,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ccc74fe788684f709f7907f1578721e7",
"model_id": "e25652d9d7cc473d97c8d57ca2040fab",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -172,7 +162,7 @@
}
],
"source": [
"run_crophealth_app(dataset_sentinel2)"
"crophealth.run_crophealth_app(dataset_sentinel2)"
]
},
{
Expand Down Expand Up @@ -201,7 +191,7 @@
"**Contact:** If you need assistance, please post a question on the [Open Data Cube Slack channel](http://slack.opendatacube.org/) or on the [GIS Stack Exchange](https://gis.stackexchange.com/questions/ask?tags=open-data-cube) using the `open-data-cube` tag (you can view previously asked questions [here](https://gis.stackexchange.com/questions/tagged/open-data-cube)).\n",
"If you would like to report an issue with this notebook, you can file one on [Github](https://github.com/GeoscienceAustralia/dea-notebooks).\n",
"\n",
"**Last modified:** September 2021\n",
"**Last modified:** January 2022\n",
"\n",
"**Compatible datacube version:**"
]
Expand All @@ -215,7 +205,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1.8.5\n"
"1.8.6\n"
]
}
],
Expand Down Expand Up @@ -243,7 +233,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
479 changes: 261 additions & 218 deletions Real_world_examples/Exporting_satellite_images.ipynb

Large diffs are not rendered by default.

836 changes: 513 additions & 323 deletions Real_world_examples/Mining_rehabilitation.ipynb

Large diffs are not rendered by default.

Empty file added Tools/dea_tools/app/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def run_filmstrip_app(output_name,
time_steps = (pd.cut(ds.time.values, bins_dt, labels = labels[:-1])
.add_categories(labels[-1])
.fillna(labels[-1]))
time_steps_var = xr.DataArray(time_steps, [('time', ds.time)],
time_steps_var = xr.DataArray(time_steps, coords=[ds.time],
name='timestep')

# Resample data temporally into time steps, and compute geomedians
Expand Down
File renamed without changes.
Loading

0 comments on commit 957ed6f

Please sign in to comment.