dea-tools 0.2.8.dev108__tar.gz → 0.2.8.dev110__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.2.8.dev108/dea_tools.egg-info → dea-tools-0.2.8.dev110}/PKG-INFO +1 -1
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/bandindices.py +9 -8
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/datahandling.py +1 -8
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/plotting.py +14 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110/dea_tools.egg-info}/PKG-INFO +1 -1
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/.gitignore +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/LICENSE +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/MANIFEST.in +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/README.rst +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/__init__.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/__main__.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/app/__init__.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/app/animations.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/app/changefilmstrips.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/app/crophealth.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/app/deacoastlines.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/app/imageexport.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/app/miningrehab.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/app/widgetconstructors.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/bom.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/classification.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/climate.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/coastal.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/dask.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/landcover.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/pyfes_model.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/spatial.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/temporal.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/validation.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools/waterbodies.py +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools.egg-info/SOURCES.txt +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools.egg-info/dependency_links.txt +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools.egg-info/requires.txt +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/dea_tools.egg-info/top_level.txt +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/index.rst +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/pyproject.toml +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/setup.cfg +0 -0
- {dea-tools-0.2.8.dev108 → dea-tools-0.2.8.dev110}/setup.py +0 -0
|
@@ -15,7 +15,7 @@ here: https://gis.stackexchange.com/questions/tagged/open-data-cube).
|
|
|
15
15
|
If you would like to report an issue with this script, you can file one
|
|
16
16
|
on Github (https://github.com/GeoscienceAustralia/dea-notebooks/issues/new).
|
|
17
17
|
|
|
18
|
-
Last modified:
|
|
18
|
+
Last modified: June 2023
|
|
19
19
|
'''
|
|
20
20
|
|
|
21
21
|
# Import required packages
|
|
@@ -39,7 +39,7 @@ def calculate_indices(ds,
|
|
|
39
39
|
in memory. This can be a memory-expensive operation, so to avoid
|
|
40
40
|
this, set `inplace=True`.
|
|
41
41
|
|
|
42
|
-
Last modified:
|
|
42
|
+
Last modified: June 2023
|
|
43
43
|
|
|
44
44
|
Parameters
|
|
45
45
|
----------
|
|
@@ -76,6 +76,7 @@ def calculate_indices(ds,
|
|
|
76
76
|
* ``'NDSI'`` (Normalised Difference Snow Index, Hall 1995)
|
|
77
77
|
* ``'NDTI'`` (Normalise Difference Tillage Index,
|
|
78
78
|
Van Deventeret et al. 1997)
|
|
79
|
+
* ``'NDTI2'`` (Normalised Difference Turbidity Index, Lacaux et al., 2007)
|
|
79
80
|
* ``'NDVI'`` (Normalised Difference Vegetation Index, Rouse 1973)
|
|
80
81
|
* ``'NDWI'`` (Normalised Difference Water Index, McFeeters 1996)
|
|
81
82
|
* ``'SAVI'`` (Soil Adjusted Vegetation Index, Huete 1988)
|
|
@@ -85,7 +86,6 @@ def calculate_indices(ds,
|
|
|
85
86
|
* ``'TCB_GSO'`` (Tasseled Cap Brightness, Nedkov 2017)
|
|
86
87
|
* ``'TCG_GSO'`` (Tasseled Cap Greeness, Nedkov 2017)
|
|
87
88
|
* ``'TCW_GSO'`` (Tasseled Cap Wetness, Nedkov 2017)
|
|
88
|
-
* ``'TI'`` (Normalised Difference Turbidity Index, Lacaux et al 2007)
|
|
89
89
|
* ``'WI'`` (Water Index, Fisher 2016)
|
|
90
90
|
* ``'kNDVI'`` (Non-linear Normalised Difference Vegation Index,
|
|
91
91
|
Camps-Valls et al. 2021)
|
|
@@ -201,6 +201,11 @@ def calculate_indices(ds,
|
|
|
201
201
|
# Van Deventer et al. 1997
|
|
202
202
|
'NDTI': lambda ds: (ds.swir1 - ds.swir2) /
|
|
203
203
|
(ds.swir1 + ds.swir2),
|
|
204
|
+
|
|
205
|
+
# Normalised Difference Turbidity Index,
|
|
206
|
+
# Lacaux et al., 2007
|
|
207
|
+
'NDTI2': lambda ds: (ds.red - ds.green) /
|
|
208
|
+
(ds.red + ds.green),
|
|
204
209
|
|
|
205
210
|
# Normalised Difference Water Index, McFeeters 1996
|
|
206
211
|
'NDWI': lambda ds: (ds.green - ds.nir) /
|
|
@@ -287,11 +292,7 @@ def calculate_indices(ds,
|
|
|
287
292
|
|
|
288
293
|
# Iron Oxide Ratio, Segal 1982
|
|
289
294
|
'IOR': lambda ds: (ds.red / ds.blue),
|
|
290
|
-
|
|
291
|
-
# Normalised Difference Turbidity Index , Lacaux et al 2007
|
|
292
|
-
#NB. 'NDTI' key already used. 'TI' used in lieu.
|
|
293
|
-
'TI': lambda ds: (ds.red - ds.green) /
|
|
294
|
-
(ds.red + ds.green)
|
|
295
|
+
|
|
295
296
|
}
|
|
296
297
|
|
|
297
298
|
# If index supplied is not a list, convert to list. This allows us to
|
|
@@ -236,7 +236,7 @@ def load_ard(
|
|
|
236
236
|
dictionary (e.g. `**query`). Keywords can include `measurements`,
|
|
237
237
|
`x`, `y`, `time`, `resolution`, `resampling`, `group_by`, `crs`;
|
|
238
238
|
see the `dc.load` documentation for all possible options:
|
|
239
|
-
https://datacube-core.readthedocs.io/en/latest/api/
|
|
239
|
+
https://datacube-core.readthedocs.io/en/latest/dev/api/generate/datacube.Datacube.load.html
|
|
240
240
|
|
|
241
241
|
Returns
|
|
242
242
|
-------
|
|
@@ -244,13 +244,6 @@ def load_ard(
|
|
|
244
244
|
An xarray.Dataset containing only satellite observations with
|
|
245
245
|
a proportion of good quality pixels greater than `min_gooddata`.
|
|
246
246
|
|
|
247
|
-
Notes
|
|
248
|
-
-----
|
|
249
|
-
The `load_ard` function builds on the Open Data Cube's native `dc.load`
|
|
250
|
-
function by adding the ability to load multiple satellite data
|
|
251
|
-
products at once, and automatically apply cloud masking and filtering.
|
|
252
|
-
For loading non-satellite data products (e.g. DEA Water Observations),
|
|
253
|
-
use `dc.load` instead.
|
|
254
247
|
"""
|
|
255
248
|
|
|
256
249
|
#########
|
|
@@ -51,6 +51,7 @@ def rgb(ds,
|
|
|
51
51
|
col_wrap=4,
|
|
52
52
|
size=6,
|
|
53
53
|
aspect=None,
|
|
54
|
+
titles=None,
|
|
54
55
|
savefig_path=None,
|
|
55
56
|
savefig_kwargs={},
|
|
56
57
|
**kwargs):
|
|
@@ -107,6 +108,10 @@ def rgb(ds,
|
|
|
107
108
|
gives width of each facet in inches. Defaults to None, which
|
|
108
109
|
will calculate the aspect based on the x and y dimensions of
|
|
109
110
|
the input data.
|
|
111
|
+
titles : string or list of strings, optional
|
|
112
|
+
Replace the xarray 'time' dimension on plot titles with a string
|
|
113
|
+
or list of string titles, when a list of index values are
|
|
114
|
+
provided, of your choice. Defaults to None.
|
|
110
115
|
savefig_path : string, optional
|
|
111
116
|
Path to export image file for the RGB plot. Defaults to None,
|
|
112
117
|
which does not export an image file.
|
|
@@ -182,6 +187,9 @@ def rgb(ds,
|
|
|
182
187
|
col_wrap=col_wrap,
|
|
183
188
|
**aspect_size_kwarg,
|
|
184
189
|
**kwargs)
|
|
190
|
+
if titles is not None:
|
|
191
|
+
for ax, title in zip(img.axs.flat, titles):
|
|
192
|
+
ax.set_title(title)
|
|
185
193
|
|
|
186
194
|
# If values provided for `index`, extract corresponding observations and
|
|
187
195
|
# plot as either single image or facet plot
|
|
@@ -221,6 +229,9 @@ def rgb(ds,
|
|
|
221
229
|
col_wrap=col_wrap,
|
|
222
230
|
**aspect_size_kwarg,
|
|
223
231
|
**kwargs)
|
|
232
|
+
if titles is not None:
|
|
233
|
+
for ax, title in zip(img.axs.flat, titles):
|
|
234
|
+
ax.set_title(title)
|
|
224
235
|
|
|
225
236
|
# If only one index is supplied, squeeze out index_dim and plot as a
|
|
226
237
|
# single panel
|
|
@@ -229,6 +240,9 @@ def rgb(ds,
|
|
|
229
240
|
img = da.squeeze(dim=index_dim).plot.imshow(robust=robust,
|
|
230
241
|
**aspect_size_kwarg,
|
|
231
242
|
**kwargs)
|
|
243
|
+
if titles is not None:
|
|
244
|
+
for ax, title in zip(img.axs.flat, titles):
|
|
245
|
+
ax.set_title(title)
|
|
232
246
|
|
|
233
247
|
# If an export path is provided, save image to file. Individual and
|
|
234
248
|
# faceted plots have a different API (figure vs fig) so we get around this
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|