dea-tools 0.3.7.dev10__tar.gz → 0.3.7.dev13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dea_tools-0.3.7.dev13/.gitignore +11 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/LICENSE +1 -1
- dea_tools-0.3.7.dev13/PKG-INFO +199 -0
- dea_tools-0.3.7.dev13/README_tools.md +102 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/animations.py +27 -18
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/changefilmstrips.py +3 -4
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/crophealth.py +3 -4
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/deacoastlines.py +19 -10
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/imageexport.py +25 -16
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/miningrehab.py +2 -3
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/wetlandsinsighttool.py +24 -17
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/classification.py +3 -3
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/coastal.py +3 -3
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/dask.py +60 -49
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/datahandling.py +9 -1
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/maps.py +36 -6
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/plotting.py +1 -1
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/spatial.py +12 -5
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/temporal.py +16 -7
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/wit_app.py +17 -10
- dea_tools-0.3.7.dev13/pyproject.toml +236 -0
- dea_tools-0.3.7.dev10/.gitignore +0 -7
- dea_tools-0.3.7.dev10/MANIFEST.in +0 -1
- dea_tools-0.3.7.dev10/PKG-INFO +0 -190
- dea_tools-0.3.7.dev10/README.rst +0 -109
- dea_tools-0.3.7.dev10/dea_tools.egg-info/PKG-INFO +0 -190
- dea_tools-0.3.7.dev10/dea_tools.egg-info/SOURCES.txt +0 -41
- dea_tools-0.3.7.dev10/dea_tools.egg-info/dependency_links.txt +0 -1
- dea_tools-0.3.7.dev10/dea_tools.egg-info/requires.txt +0 -52
- dea_tools-0.3.7.dev10/dea_tools.egg-info/top_level.txt +0 -1
- dea_tools-0.3.7.dev10/index.rst +0 -69
- dea_tools-0.3.7.dev10/mock_imports.txt +0 -60
- dea_tools-0.3.7.dev10/pyproject.toml +0 -4
- dea_tools-0.3.7.dev10/setup.cfg +0 -4
- dea_tools-0.3.7.dev10/setup.py +0 -172
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/__init__.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/__main__.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/__init__.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/geomedian.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/app/widgetconstructors.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/bandindices.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/bom.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/landcover.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/pyfes_model.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/validation.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/waterbodies.py +0 -0
- {dea_tools-0.3.7.dev10 → dea_tools-0.3.7.dev13}/dea_tools/wetlands.py +0 -0
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dea-tools
|
|
3
|
+
Version: 0.3.7.dev13
|
|
4
|
+
Summary: Functions and algorithms for analysing Digital Earth Australia data.
|
|
5
|
+
Project-URL: Homepage, https://github.com/GeoscienceAustralia/dea-notebooks
|
|
6
|
+
Project-URL: Repository, https://github.com/GeoscienceAustralia/dea-notebooks
|
|
7
|
+
Author-email: Geoscience Australia <earth.observation@ga.gov.au>
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: datacube,digital earth australia,earth observation,geospatial analysis,remote sensing,satellite data
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
21
|
+
Requires-Python: <4.0,>=3.10
|
|
22
|
+
Requires-Dist: aiohttp>=3.5.0
|
|
23
|
+
Requires-Dist: dask-ml>=2023.3.24
|
|
24
|
+
Requires-Dist: dask>=2023.1.0
|
|
25
|
+
Requires-Dist: fiona>=1.10.0
|
|
26
|
+
Requires-Dist: folium>=0.16.0
|
|
27
|
+
Requires-Dist: geopandas>=0.10.0
|
|
28
|
+
Requires-Dist: geopy>=2.0.0
|
|
29
|
+
Requires-Dist: imageio>=2.20.0
|
|
30
|
+
Requires-Dist: joblib>=1.0.0
|
|
31
|
+
Requires-Dist: lxml>=5.0.0
|
|
32
|
+
Requires-Dist: matplotlib>=3.8.0
|
|
33
|
+
Requires-Dist: numba>=0.57.0
|
|
34
|
+
Requires-Dist: numpy>=1.26.0
|
|
35
|
+
Requires-Dist: odc-algo>=1.0.0
|
|
36
|
+
Requires-Dist: odc-geo[tiff]>=0.4.7
|
|
37
|
+
Requires-Dist: owslib>=0.26.0
|
|
38
|
+
Requires-Dist: packaging>=22.0
|
|
39
|
+
Requires-Dist: pandas>=2.2.0
|
|
40
|
+
Requires-Dist: pyproj>=3.7.0
|
|
41
|
+
Requires-Dist: pytmd==2.1.6
|
|
42
|
+
Requires-Dist: pytz>=2022.1
|
|
43
|
+
Requires-Dist: rasterio>=1.3.11
|
|
44
|
+
Requires-Dist: rasterstats>=0.16.0
|
|
45
|
+
Requires-Dist: requests>=2.25.0
|
|
46
|
+
Requires-Dist: rioxarray>=0.10.0
|
|
47
|
+
Requires-Dist: scikit-image>=0.22.0
|
|
48
|
+
Requires-Dist: scikit-learn>=1.4.0
|
|
49
|
+
Requires-Dist: scipy>=1.14.1
|
|
50
|
+
Requires-Dist: seaborn>=0.10.0
|
|
51
|
+
Requires-Dist: shapely>=2.0.5
|
|
52
|
+
Requires-Dist: tqdm>=4.55.0
|
|
53
|
+
Requires-Dist: traitlets>=5.0.0
|
|
54
|
+
Requires-Dist: xarray>=2022.3.0
|
|
55
|
+
Provides-Extra: all
|
|
56
|
+
Requires-Dist: affine>=2.3.1; extra == 'all'
|
|
57
|
+
Requires-Dist: bs4>=0.0.1; extra == 'all'
|
|
58
|
+
Requires-Dist: cmocean>=3.0.0; extra == 'all'
|
|
59
|
+
Requires-Dist: contextily>=1.3.0; extra == 'all'
|
|
60
|
+
Requires-Dist: dask-gateway>=2023.1.0; extra == 'all'
|
|
61
|
+
Requires-Dist: datacube>=1.8.5; extra == 'all'
|
|
62
|
+
Requires-Dist: gcsfs>=2022.1.0; extra == 'all'
|
|
63
|
+
Requires-Dist: hdstats>=0.1.8.post1; extra == 'all'
|
|
64
|
+
Requires-Dist: ipyleaflet>=0.17.0; extra == 'all'
|
|
65
|
+
Requires-Dist: jupyter>=1.0.0; extra == 'all'
|
|
66
|
+
Requires-Dist: odc-stac[botocore]>=0.3.0; extra == 'all'
|
|
67
|
+
Requires-Dist: odc-ui>=0.2.1; extra == 'all'
|
|
68
|
+
Requires-Dist: opencv-python>=4.6.0.66; extra == 'all'
|
|
69
|
+
Requires-Dist: planetary-computer>=1.0.0; extra == 'all'
|
|
70
|
+
Requires-Dist: pydotplus>=2.0.0; extra == 'all'
|
|
71
|
+
Requires-Dist: pystac-client>=0.8.3; extra == 'all'
|
|
72
|
+
Requires-Dist: statsmodels>=0.14.0; extra == 'all'
|
|
73
|
+
Provides-Extra: dask-gateway
|
|
74
|
+
Requires-Dist: dask-gateway>=2023.1.0; extra == 'dask-gateway'
|
|
75
|
+
Provides-Extra: datacube
|
|
76
|
+
Requires-Dist: datacube>=1.8.5; extra == 'datacube'
|
|
77
|
+
Requires-Dist: odc-ui>=0.2.1; extra == 'datacube'
|
|
78
|
+
Provides-Extra: hdstats
|
|
79
|
+
Requires-Dist: hdstats>=0.1.8.post1; extra == 'hdstats'
|
|
80
|
+
Provides-Extra: jupyter
|
|
81
|
+
Requires-Dist: ipyleaflet>=0.17.0; extra == 'jupyter'
|
|
82
|
+
Requires-Dist: jupyter>=1.0.0; extra == 'jupyter'
|
|
83
|
+
Provides-Extra: notebooks
|
|
84
|
+
Requires-Dist: affine>=2.3.1; extra == 'notebooks'
|
|
85
|
+
Requires-Dist: bs4>=0.0.1; extra == 'notebooks'
|
|
86
|
+
Requires-Dist: cmocean>=3.0.0; extra == 'notebooks'
|
|
87
|
+
Requires-Dist: contextily>=1.3.0; extra == 'notebooks'
|
|
88
|
+
Requires-Dist: gcsfs>=2022.1.0; extra == 'notebooks'
|
|
89
|
+
Requires-Dist: opencv-python>=4.6.0.66; extra == 'notebooks'
|
|
90
|
+
Requires-Dist: pydotplus>=2.0.0; extra == 'notebooks'
|
|
91
|
+
Requires-Dist: statsmodels>=0.14.0; extra == 'notebooks'
|
|
92
|
+
Provides-Extra: stac
|
|
93
|
+
Requires-Dist: odc-stac[botocore]>=0.3.0; extra == 'stac'
|
|
94
|
+
Requires-Dist: planetary-computer>=1.0.0; extra == 'stac'
|
|
95
|
+
Requires-Dist: pystac-client>=0.8.3; extra == 'stac'
|
|
96
|
+
Description-Content-Type: text/markdown
|
|
97
|
+
|
|
98
|
+
# dea-tools Python package
|
|
99
|
+
|
|
100
|
+
The `dea-tools` Python package provides a collection of functions and algorithms for geospatial analysis using Open Data Cube, Xarray, and Digital Earth Australia.
|
|
101
|
+
It includes utilities for loading data, plotting, spatial and temporal analysis, and applying machine learning to satellite data.
|
|
102
|
+
|
|
103
|
+
The package is organised into the following modules:
|
|
104
|
+
|
|
105
|
+
* `dea_tools.datahandling`: Tools for loading and managing DEA data (e.g. combining products, handling CRSs, pansharpening)
|
|
106
|
+
* `dea_tools.plotting`: Plotting tools for DEA data (e.g. RGB composites, animations, interactive maps)
|
|
107
|
+
* `dea_tools.bandindices`: Functions to calculate remote sensing indices (e.g. NDVI, NDWI)
|
|
108
|
+
* `dea_tools.spatial`: Spatial analysis utilities (e.g. rasterisation, vectorisation, contours, image processing)
|
|
109
|
+
* `dea_tools.temporal`: Tools for temporal analysis (e.g. phenology, time-series statistics, multi-dimensional regression)
|
|
110
|
+
* `dea_tools.classification`: Machine learning utilities (e.g. training and applying models on satellite data)
|
|
111
|
+
* `dea_tools.dask`: Utilities for parallel processing with Dask (e.g. creating scalable Dask clusters)
|
|
112
|
+
* `dea_tools.landcover`: Tools for accessing and visualising DEA Land Cover data
|
|
113
|
+
* `dea_tools.coastal`: Coastal and intertidal analysis tools (e.g. tidal tagging, coastal change time series)
|
|
114
|
+
* `dea_tools.bom`: Accessing Bureau of Meteorology water data (e.g. gauge and discharge data)
|
|
115
|
+
* `dea_tools.waterbodies`: Accessing and analysing DEA Waterbodies data (e.g. loading waterbody time series)
|
|
116
|
+
* `dea_tools.maps`: Tools for interactive mapping (e.g. folium and ipyleaflet maps)
|
|
117
|
+
* `dea_tools.validation`: Tools for generating validation statistics (e.g. RMSE, R2, correlations)
|
|
118
|
+
|
|
119
|
+
## API documentation
|
|
120
|
+
|
|
121
|
+
A rendered version of the `dea-tools` API is available on the DEA Knowledge Hub (https://knowledge.dea.ga.gov.au/notebooks/Tools/).
|
|
122
|
+
|
|
123
|
+
## Installation
|
|
124
|
+
|
|
125
|
+
You can install `dea-tools` from PyPI with `pip` (https://pypi.org/project/dea-tools/).
|
|
126
|
+
By default `dea-tools` will be installed with [minimal dependencies](https://github.com/GeoscienceAustralia/dea-notebooks/blob/develop/pyproject.toml), which excludes `datacube` and other difficult to install packages.
|
|
127
|
+
|
|
128
|
+
```console
|
|
129
|
+
pip install dea-tools
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
To install with `datacube` dependencies:
|
|
133
|
+
```console
|
|
134
|
+
pip install dea-tools[datacube]
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
To install with additonal STAC-loading dependencies:
|
|
138
|
+
```console
|
|
139
|
+
pip install dea-tools[stac]
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
To install with additonal Jupyter-related dependencies:
|
|
143
|
+
```console
|
|
144
|
+
pip install dea-tools[jupyter]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
To install with other packages used in DEA Notebooks examples:
|
|
148
|
+
```console
|
|
149
|
+
pip install dea-tools[jupyter,dask_gateway,hdstats,notebooks]
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
You can also install `dea-tools` with *all* optional dependencies. **Note:** some of these dependencies are difficult to install. If you encounter issues, you may need to try the [Conda](#with-conda) instructions below.
|
|
153
|
+
```console
|
|
154
|
+
pip install dea-tools[all]
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### With conda
|
|
158
|
+
|
|
159
|
+
If you encounter issues with the installation, try installing the package in a `conda` Python environment where [GDAL](https://pypi.org/project/GDAL/) and [pyproj](https://pypi.org/project/pyproj/) are already installed:
|
|
160
|
+
|
|
161
|
+
```console
|
|
162
|
+
wget -O conda-environment.yml https://raw.githubusercontent.com/opendatacube/datacube-core/develop/conda-environment.yml
|
|
163
|
+
|
|
164
|
+
mamba env create -f conda-environment.yml
|
|
165
|
+
conda activate cubeenv
|
|
166
|
+
|
|
167
|
+
pip install dea-tools
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Working on DEA Sandbox or NCI
|
|
171
|
+
|
|
172
|
+
To work with this module on the DEA Sandbox or National Computational Infrastructure environments without installing it, you can add the `Tools` directory to the system path from within your `dea-notebooks` directory:
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
import sys
|
|
176
|
+
sys.path.insert(1, "../Tools/")
|
|
177
|
+
import dea_tools.datahandling # or some other submodule
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Alternatively, you can also do a local installation of `dea-tools`. To do this on the DEA Sandbox, run `pip` from the terminal from within your `dea-notebooks` directory:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pip install -e .
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Importing functions in Python
|
|
187
|
+
|
|
188
|
+
One `dea-tools` is installed, you can import functions using:
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
from dea_tools.datahandling import load_ard
|
|
192
|
+
from dea_tools.plotting import rgb
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Citing DEA Tools
|
|
196
|
+
|
|
197
|
+
If you use any of the notebooks, code or tools in this repository in your work, please reference them using the following citation:
|
|
198
|
+
|
|
199
|
+
> Krause, C., Dunn, B., Bishop-Taylor, R., Adams, C., Burton, C., Alger, M., Chua, S., Phillips, C., Newey, V., Kouzoubov, K., Leith, A., Ayers, D., Hicks, A., DEA Notebooks contributors 2021. Digital Earth Australia notebooks and tools repository. Geoscience Australia, Canberra. https://doi.org/10.26186/145234
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# dea-tools Python package
|
|
2
|
+
|
|
3
|
+
The `dea-tools` Python package provides a collection of functions and algorithms for geospatial analysis using Open Data Cube, Xarray, and Digital Earth Australia.
|
|
4
|
+
It includes utilities for loading data, plotting, spatial and temporal analysis, and applying machine learning to satellite data.
|
|
5
|
+
|
|
6
|
+
The package is organised into the following modules:
|
|
7
|
+
|
|
8
|
+
* `dea_tools.datahandling`: Tools for loading and managing DEA data (e.g. combining products, handling CRSs, pansharpening)
|
|
9
|
+
* `dea_tools.plotting`: Plotting tools for DEA data (e.g. RGB composites, animations, interactive maps)
|
|
10
|
+
* `dea_tools.bandindices`: Functions to calculate remote sensing indices (e.g. NDVI, NDWI)
|
|
11
|
+
* `dea_tools.spatial`: Spatial analysis utilities (e.g. rasterisation, vectorisation, contours, image processing)
|
|
12
|
+
* `dea_tools.temporal`: Tools for temporal analysis (e.g. phenology, time-series statistics, multi-dimensional regression)
|
|
13
|
+
* `dea_tools.classification`: Machine learning utilities (e.g. training and applying models on satellite data)
|
|
14
|
+
* `dea_tools.dask`: Utilities for parallel processing with Dask (e.g. creating scalable Dask clusters)
|
|
15
|
+
* `dea_tools.landcover`: Tools for accessing and visualising DEA Land Cover data
|
|
16
|
+
* `dea_tools.coastal`: Coastal and intertidal analysis tools (e.g. tidal tagging, coastal change time series)
|
|
17
|
+
* `dea_tools.bom`: Accessing Bureau of Meteorology water data (e.g. gauge and discharge data)
|
|
18
|
+
* `dea_tools.waterbodies`: Accessing and analysing DEA Waterbodies data (e.g. loading waterbody time series)
|
|
19
|
+
* `dea_tools.maps`: Tools for interactive mapping (e.g. folium and ipyleaflet maps)
|
|
20
|
+
* `dea_tools.validation`: Tools for generating validation statistics (e.g. RMSE, R2, correlations)
|
|
21
|
+
|
|
22
|
+
## API documentation
|
|
23
|
+
|
|
24
|
+
A rendered version of the `dea-tools` API is available on the DEA Knowledge Hub (https://knowledge.dea.ga.gov.au/notebooks/Tools/).
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
You can install `dea-tools` from PyPI with `pip` (https://pypi.org/project/dea-tools/).
|
|
29
|
+
By default `dea-tools` will be installed with [minimal dependencies](https://github.com/GeoscienceAustralia/dea-notebooks/blob/develop/pyproject.toml), which excludes `datacube` and other difficult to install packages.
|
|
30
|
+
|
|
31
|
+
```console
|
|
32
|
+
pip install dea-tools
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To install with `datacube` dependencies:
|
|
36
|
+
```console
|
|
37
|
+
pip install dea-tools[datacube]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
To install with additonal STAC-loading dependencies:
|
|
41
|
+
```console
|
|
42
|
+
pip install dea-tools[stac]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
To install with additonal Jupyter-related dependencies:
|
|
46
|
+
```console
|
|
47
|
+
pip install dea-tools[jupyter]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To install with other packages used in DEA Notebooks examples:
|
|
51
|
+
```console
|
|
52
|
+
pip install dea-tools[jupyter,dask_gateway,hdstats,notebooks]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
You can also install `dea-tools` with *all* optional dependencies. **Note:** some of these dependencies are difficult to install. If you encounter issues, you may need to try the [Conda](#with-conda) instructions below.
|
|
56
|
+
```console
|
|
57
|
+
pip install dea-tools[all]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### With conda
|
|
61
|
+
|
|
62
|
+
If you encounter issues with the installation, try installing the package in a `conda` Python environment where [GDAL](https://pypi.org/project/GDAL/) and [pyproj](https://pypi.org/project/pyproj/) are already installed:
|
|
63
|
+
|
|
64
|
+
```console
|
|
65
|
+
wget -O conda-environment.yml https://raw.githubusercontent.com/opendatacube/datacube-core/develop/conda-environment.yml
|
|
66
|
+
|
|
67
|
+
mamba env create -f conda-environment.yml
|
|
68
|
+
conda activate cubeenv
|
|
69
|
+
|
|
70
|
+
pip install dea-tools
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Working on DEA Sandbox or NCI
|
|
74
|
+
|
|
75
|
+
To work with this module on the DEA Sandbox or National Computational Infrastructure environments without installing it, you can add the `Tools` directory to the system path from within your `dea-notebooks` directory:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import sys
|
|
79
|
+
sys.path.insert(1, "../Tools/")
|
|
80
|
+
import dea_tools.datahandling # or some other submodule
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Alternatively, you can also do a local installation of `dea-tools`. To do this on the DEA Sandbox, run `pip` from the terminal from within your `dea-notebooks` directory:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install -e .
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Importing functions in Python
|
|
90
|
+
|
|
91
|
+
One `dea-tools` is installed, you can import functions using:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from dea_tools.datahandling import load_ard
|
|
95
|
+
from dea_tools.plotting import rgb
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Citing DEA Tools
|
|
99
|
+
|
|
100
|
+
If you use any of the notebooks, code or tools in this repository in your work, please reference them using the following citation:
|
|
101
|
+
|
|
102
|
+
> Krause, C., Dunn, B., Bishop-Taylor, R., Adams, C., Burton, C., Alger, M., Chua, S., Phillips, C., Newey, V., Kouzoubov, K., Leith, A., Ayers, D., Hicks, A., DEA Notebooks contributors 2021. Digital Earth Australia notebooks and tools repository. Geoscience Australia, Canberra. https://doi.org/10.26186/145234
|
|
@@ -47,9 +47,18 @@ from skimage.filters import unsharp_mask
|
|
|
47
47
|
from datacube.utils import masking
|
|
48
48
|
from datacube.utils.geometry import Geometry
|
|
49
49
|
from datacube.utils.masking import mask_invalid_data
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
from .widgetconstructors import (
|
|
51
|
+
create_html,
|
|
52
|
+
create_drawcontrol,
|
|
53
|
+
create_map,
|
|
54
|
+
create_datepicker,
|
|
55
|
+
create_inputtext,
|
|
56
|
+
create_checkbox,
|
|
57
|
+
create_dropdown,
|
|
58
|
+
create_dea_wms_layer,
|
|
59
|
+
)
|
|
60
|
+
from ..dask import create_local_dask_cluster
|
|
61
|
+
from ..spatial import reverse_geocode
|
|
53
62
|
|
|
54
63
|
import warnings
|
|
55
64
|
warnings.filterwarnings("ignore")
|
|
@@ -404,7 +413,7 @@ class animation_app(HBox):
|
|
|
404
413
|
"select an area export as a satellite imagery time-series "
|
|
405
414
|
"animation.</p>"
|
|
406
415
|
)
|
|
407
|
-
self.header =
|
|
416
|
+
self.header = create_html(f"{header_title_text}{instruction_text}")
|
|
408
417
|
self.header.layout = make_box_layout()
|
|
409
418
|
|
|
410
419
|
#####################################
|
|
@@ -488,14 +497,14 @@ class animation_app(HBox):
|
|
|
488
497
|
|
|
489
498
|
# Create drawing tools
|
|
490
499
|
desired_drawtools = ["rectangle"]
|
|
491
|
-
draw_control =
|
|
500
|
+
draw_control = create_drawcontrol(desired_drawtools)
|
|
492
501
|
|
|
493
502
|
# Begin by displaying an empty layer group, and update the group with desired WMS on interaction.
|
|
494
503
|
self.map_layers = LayerGroup(layers=())
|
|
495
504
|
self.map_layers.name = "Map Overlays"
|
|
496
505
|
|
|
497
506
|
# Create map widget
|
|
498
|
-
self.m =
|
|
507
|
+
self.m = create_map(map_center=(-33.96, 151.20), zoom_level=13)
|
|
499
508
|
self.m.layout = make_box_layout()
|
|
500
509
|
|
|
501
510
|
# Add tools to map widget
|
|
@@ -516,22 +525,22 @@ class animation_app(HBox):
|
|
|
516
525
|
############################
|
|
517
526
|
|
|
518
527
|
# Create parameter widgets
|
|
519
|
-
dropdown_basemap =
|
|
528
|
+
dropdown_basemap = create_dropdown(
|
|
520
529
|
self.basemap_list, self.basemap_list[0][1]
|
|
521
530
|
)
|
|
522
|
-
dropdown_dealayer =
|
|
531
|
+
dropdown_dealayer = create_dropdown(
|
|
523
532
|
self.dealayer_list, self.dealayer_list[0][1]
|
|
524
533
|
)
|
|
525
|
-
dropdown_output =
|
|
534
|
+
dropdown_output = create_dropdown(
|
|
526
535
|
self.output_list, self.output_list[0][1]
|
|
527
536
|
)
|
|
528
|
-
date_picker_start =
|
|
537
|
+
date_picker_start = create_datepicker(
|
|
529
538
|
value=start_date,
|
|
530
539
|
)
|
|
531
|
-
date_picker_end =
|
|
540
|
+
date_picker_end = create_datepicker(
|
|
532
541
|
value=end_date,
|
|
533
542
|
)
|
|
534
|
-
dropdown_styles =
|
|
543
|
+
dropdown_styles = create_dropdown(
|
|
535
544
|
self.styles_list, self.styles_list[0]
|
|
536
545
|
)
|
|
537
546
|
slider_percentile = widgets.FloatRangeSlider(
|
|
@@ -553,7 +562,7 @@ class animation_app(HBox):
|
|
|
553
562
|
layout={"width": "85%"},
|
|
554
563
|
)
|
|
555
564
|
|
|
556
|
-
checkbox_rolling_median =
|
|
565
|
+
checkbox_rolling_median = create_checkbox(
|
|
557
566
|
self.rolling_median,
|
|
558
567
|
"Apply rolling median to produce smooth, cloud-free animations",
|
|
559
568
|
layout={"width": "85%"},
|
|
@@ -582,13 +591,13 @@ class animation_app(HBox):
|
|
|
582
591
|
text_width = widgets.IntText(
|
|
583
592
|
value=900, description="", step=50, layout={"width": "95%"}
|
|
584
593
|
)
|
|
585
|
-
dropdown_resampling =
|
|
594
|
+
dropdown_resampling = create_dropdown(
|
|
586
595
|
self.resample_list,
|
|
587
596
|
self.resample_freq,
|
|
588
597
|
description="",
|
|
589
598
|
layout={"width": "95%"},
|
|
590
599
|
)
|
|
591
|
-
checkbox_cloud_mask =
|
|
600
|
+
checkbox_cloud_mask = create_checkbox(
|
|
592
601
|
self.cloud_mask, "Mask out cloudy pixels", layout={"width": "95%"}
|
|
593
602
|
)
|
|
594
603
|
slider_power = widgets.FloatSlider(
|
|
@@ -599,7 +608,7 @@ class animation_app(HBox):
|
|
|
599
608
|
description="",
|
|
600
609
|
layout={"width": "95%"},
|
|
601
610
|
)
|
|
602
|
-
checkbox_unsharp_mask =
|
|
611
|
+
checkbox_unsharp_mask = create_checkbox(
|
|
603
612
|
self.unsharp_mask, "Enable", layout={"width": "95%"}
|
|
604
613
|
)
|
|
605
614
|
text_unsharp_mask_radius = widgets.FloatText(
|
|
@@ -624,10 +633,10 @@ class animation_app(HBox):
|
|
|
624
633
|
"display": "none",
|
|
625
634
|
},
|
|
626
635
|
)
|
|
627
|
-
checkbox_deacoastlines =
|
|
636
|
+
checkbox_deacoastlines = create_checkbox(
|
|
628
637
|
self.deacoastlines, "Add DEA Coastlines overlay", layout={"width": "95%"}
|
|
629
638
|
)
|
|
630
|
-
checkbox_max_size =
|
|
639
|
+
checkbox_max_size = create_checkbox(
|
|
631
640
|
self.max_size, "Enable", layout={"width": "95%"}
|
|
632
641
|
)
|
|
633
642
|
expand_box = widgets.VBox(
|
|
@@ -27,10 +27,9 @@ from ipyleaflet import basemaps, basemap_to_tiles
|
|
|
27
27
|
|
|
28
28
|
# Load utility functions
|
|
29
29
|
import sys
|
|
30
|
-
|
|
31
|
-
from
|
|
32
|
-
from
|
|
33
|
-
from dea_tools.dask import create_local_dask_cluster
|
|
30
|
+
from ..datahandling import load_ard, mostcommon_crs
|
|
31
|
+
from ..coastal import tidal_tag
|
|
32
|
+
from ..dask import create_local_dask_cluster
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
def run_filmstrip_app(output_name,
|
|
@@ -31,10 +31,9 @@ import geopandas as gpd
|
|
|
31
31
|
|
|
32
32
|
# Load utility functions
|
|
33
33
|
import sys
|
|
34
|
-
|
|
35
|
-
from
|
|
36
|
-
from
|
|
37
|
-
from dea_tools.bandindices import calculate_indices
|
|
34
|
+
from ..datahandling import load_ard
|
|
35
|
+
from ..spatial import transform_geojson_wgs_to_epsg
|
|
36
|
+
from ..bandindices import calculate_indices
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
def load_crophealth_data():
|
|
@@ -37,8 +37,17 @@ import geopandas as gpd
|
|
|
37
37
|
from io import BytesIO
|
|
38
38
|
import ipywidgets as widgets
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
from .widgetconstructors import (
|
|
41
|
+
create_html,
|
|
42
|
+
create_drawcontrol,
|
|
43
|
+
create_map,
|
|
44
|
+
create_datepicker,
|
|
45
|
+
create_inputtext,
|
|
46
|
+
create_checkbox,
|
|
47
|
+
create_dropdown,
|
|
48
|
+
create_dea_wms_layer,
|
|
49
|
+
)
|
|
50
|
+
from ..coastal import get_coastlines, transect_distances
|
|
42
51
|
|
|
43
52
|
|
|
44
53
|
WMS_ADDRESS = "https://geoserver.dea.ga.gov.au/geoserver/wms"
|
|
@@ -93,7 +102,7 @@ class transect_app(HBox):
|
|
|
93
102
|
# Create the Header widget
|
|
94
103
|
header_title_text = "<h3>Digital Earth Australia Coastlines shoreline transect extraction</h3>"
|
|
95
104
|
instruction_text = "Select parameters and draw a transect on the map to extract shoreline data. <b>In distance mode</b>, draw a transect line starting from land that crosses multiple shorelines. <br><b>In width mode</b>, draw a transect line that intersects shorelines at least twice. Alternatively, <b>upload an vector file</b> to extract shoreline data for multiple existing transects."
|
|
96
|
-
self.header =
|
|
105
|
+
self.header = create_html(
|
|
97
106
|
f"{header_title_text}<p>{instruction_text}</p>")
|
|
98
107
|
self.header.layout = make_box_layout()
|
|
99
108
|
|
|
@@ -149,7 +158,7 @@ class transect_app(HBox):
|
|
|
149
158
|
|
|
150
159
|
# Create drawing tools
|
|
151
160
|
desired_drawtools = ['polyline']
|
|
152
|
-
draw_control =
|
|
161
|
+
draw_control = create_drawcontrol(desired_drawtools)
|
|
153
162
|
|
|
154
163
|
# Load DEACoastLines WMS
|
|
155
164
|
deacl_url = WMS_ADDRESS
|
|
@@ -166,7 +175,7 @@ class transect_app(HBox):
|
|
|
166
175
|
self.map_layers.name = 'Map Overlays'
|
|
167
176
|
|
|
168
177
|
# Create map widget
|
|
169
|
-
self.m =
|
|
178
|
+
self.m = create_map(map_center=(-28, 135),
|
|
170
179
|
zoom_level=4,
|
|
171
180
|
basemap=basemaps.Esri.WorldImagery)
|
|
172
181
|
self.m.layout = make_box_layout()
|
|
@@ -183,15 +192,15 @@ class transect_app(HBox):
|
|
|
183
192
|
############################
|
|
184
193
|
|
|
185
194
|
# Create parameter widgets
|
|
186
|
-
text_output_name =
|
|
195
|
+
text_output_name = create_inputtext(self.output_name,
|
|
187
196
|
self.output_name)
|
|
188
|
-
checkbox_csv =
|
|
197
|
+
checkbox_csv = create_checkbox(self.export_csv,
|
|
189
198
|
'Distance table (.csv)')
|
|
190
|
-
checkbox_plot =
|
|
199
|
+
checkbox_plot = create_checkbox(self.export_plot,
|
|
191
200
|
'Figure (.png)')
|
|
192
|
-
deaoverlay_dropdown =
|
|
201
|
+
deaoverlay_dropdown = create_dropdown(
|
|
193
202
|
self.product_list, self.product_list[0][1])
|
|
194
|
-
mode_dropdown =
|
|
203
|
+
mode_dropdown = create_dropdown(self.mode_list,
|
|
195
204
|
self.mode_list[0][1])
|
|
196
205
|
run_button = create_expanded_button("Extract shoreline data", "info")
|
|
197
206
|
fileupload_transects = widgets.FileUpload(accept='', multiple=True)
|
|
@@ -46,10 +46,19 @@ from skimage.filters import unsharp_mask
|
|
|
46
46
|
|
|
47
47
|
from datacube.utils import masking
|
|
48
48
|
from datacube.utils.geometry import Geometry
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
from .widgetconstructors import (
|
|
50
|
+
create_html,
|
|
51
|
+
create_drawcontrol,
|
|
52
|
+
create_map,
|
|
53
|
+
create_datepicker,
|
|
54
|
+
create_inputtext,
|
|
55
|
+
create_checkbox,
|
|
56
|
+
create_dropdown,
|
|
57
|
+
create_dea_wms_layer,
|
|
58
|
+
)
|
|
59
|
+
from ..dask import create_local_dask_cluster
|
|
60
|
+
from ..spatial import reverse_geocode
|
|
61
|
+
from ..datahandling import xr_pansharpen
|
|
53
62
|
|
|
54
63
|
|
|
55
64
|
# WMS params and satellite style bands
|
|
@@ -121,7 +130,7 @@ def update_map_layers(self):
|
|
|
121
130
|
style = sat_params[self.dealayer]["styles"][self.style][0]
|
|
122
131
|
|
|
123
132
|
# Add DEA layers over the top of the basemap
|
|
124
|
-
dea_layer =
|
|
133
|
+
dea_layer = create_dea_wms_layer(self.dealayer, self.date, styles=style)
|
|
125
134
|
self.map_layers.add_layer(dea_layer)
|
|
126
135
|
|
|
127
136
|
|
|
@@ -389,7 +398,7 @@ class imageexport_app(HBox):
|
|
|
389
398
|
"rectangle to select an area of imagery to "
|
|
390
399
|
"export as a high-resolution image file.</p>"
|
|
391
400
|
)
|
|
392
|
-
self.header =
|
|
401
|
+
self.header = create_html(f"{header_title_text}{instruction_text}")
|
|
393
402
|
self.header.layout = make_box_layout()
|
|
394
403
|
|
|
395
404
|
#####################################
|
|
@@ -474,14 +483,14 @@ class imageexport_app(HBox):
|
|
|
474
483
|
|
|
475
484
|
# Create drawing tools
|
|
476
485
|
desired_drawtools = ["rectangle"]
|
|
477
|
-
draw_control =
|
|
486
|
+
draw_control = create_drawcontrol(desired_drawtools)
|
|
478
487
|
|
|
479
488
|
# Begin by displaying an empty layer group, and update the group with desired WMS on interaction.
|
|
480
489
|
self.map_layers = LayerGroup(layers=())
|
|
481
490
|
self.map_layers.name = "Map Overlays"
|
|
482
491
|
|
|
483
492
|
# Create map widget
|
|
484
|
-
self.m =
|
|
493
|
+
self.m = create_map(map_center=(-28, 135), zoom_level=4)
|
|
485
494
|
self.m.layout = make_box_layout()
|
|
486
495
|
|
|
487
496
|
# Add tools to map widget
|
|
@@ -502,17 +511,17 @@ class imageexport_app(HBox):
|
|
|
502
511
|
############################
|
|
503
512
|
|
|
504
513
|
# Create parameter widgets
|
|
505
|
-
dropdown_basemap =
|
|
514
|
+
dropdown_basemap = create_dropdown(
|
|
506
515
|
self.basemap_list, self.basemap_list[0][1]
|
|
507
516
|
)
|
|
508
|
-
dropdown_dealayer =
|
|
517
|
+
dropdown_dealayer = create_dropdown(
|
|
509
518
|
self.dealayer_list, self.dealayer_list[0][1]
|
|
510
519
|
)
|
|
511
|
-
dropdown_output =
|
|
520
|
+
dropdown_output = create_dropdown(
|
|
512
521
|
self.output_list, self.output_list[0][1]
|
|
513
522
|
)
|
|
514
|
-
date_picker =
|
|
515
|
-
dropdown_styles =
|
|
523
|
+
date_picker = create_datepicker(value=date)
|
|
524
|
+
dropdown_styles = create_dropdown(
|
|
516
525
|
self.styles_list, self.styles_list[0]
|
|
517
526
|
)
|
|
518
527
|
slider_abs = widgets.IntRangeSlider(
|
|
@@ -531,7 +540,7 @@ class imageexport_app(HBox):
|
|
|
531
540
|
description="",
|
|
532
541
|
layout={"width": "100%", "margin": "0px", "padding": "0px"},
|
|
533
542
|
)
|
|
534
|
-
checkbox_pansharpen =
|
|
543
|
+
checkbox_pansharpen = create_checkbox(
|
|
535
544
|
self.pansharpen, "Pansharpen Landsat"
|
|
536
545
|
)
|
|
537
546
|
slider_power = widgets.FloatSlider(
|
|
@@ -542,7 +551,7 @@ class imageexport_app(HBox):
|
|
|
542
551
|
description="",
|
|
543
552
|
layout={"width": "85%"},
|
|
544
553
|
)
|
|
545
|
-
checkbox_unsharp_mask =
|
|
554
|
+
checkbox_unsharp_mask = create_checkbox(
|
|
546
555
|
self.unsharp_mask, "Enable", layout={"width": "100%"}
|
|
547
556
|
)
|
|
548
557
|
text_unsharp_mask_radius = widgets.FloatText(
|
|
@@ -567,7 +576,7 @@ class imageexport_app(HBox):
|
|
|
567
576
|
"display": "none",
|
|
568
577
|
},
|
|
569
578
|
)
|
|
570
|
-
checkbox_max_size =
|
|
579
|
+
checkbox_max_size = create_checkbox(self.max_size, "Enable")
|
|
571
580
|
text_dpi = widgets.IntText(
|
|
572
581
|
value=0, description="", step=50, layout={"width": "85%"}
|
|
573
582
|
)
|
|
@@ -27,9 +27,8 @@ from datacube.utils import masking
|
|
|
27
27
|
|
|
28
28
|
# Load utility functions
|
|
29
29
|
import sys
|
|
30
|
-
|
|
31
|
-
from
|
|
32
|
-
from dea_tools.spatial import transform_geojson_wgs_to_epsg
|
|
30
|
+
from ..datahandling import wofs_fuser
|
|
31
|
+
from ..spatial import transform_geojson_wgs_to_epsg
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
def load_miningrehab_data():
|