dea-tools 0.3.5.dev23__tar.gz → 0.3.6.dev25__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.
Files changed (42) hide show
  1. {dea_tools-0.3.5.dev23/dea_tools.egg-info → dea_tools-0.3.6.dev25}/PKG-INFO +14 -3
  2. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/coastal.py +69 -0
  3. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/datahandling.py +29 -11
  4. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25/dea_tools.egg-info}/PKG-INFO +14 -3
  5. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools.egg-info/requires.txt +1 -1
  6. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/setup.py +1 -1
  7. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/.gitignore +0 -0
  8. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/LICENSE +0 -0
  9. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/MANIFEST.in +0 -0
  10. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/README.rst +0 -0
  11. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/__init__.py +0 -0
  12. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/__main__.py +0 -0
  13. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/__init__.py +0 -0
  14. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/animations.py +0 -0
  15. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/changefilmstrips.py +0 -0
  16. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/crophealth.py +0 -0
  17. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/deacoastlines.py +0 -0
  18. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/geomedian.py +0 -0
  19. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/imageexport.py +0 -0
  20. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/miningrehab.py +0 -0
  21. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/app/widgetconstructors.py +0 -0
  22. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/bandindices.py +0 -0
  23. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/bom.py +0 -0
  24. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/classification.py +0 -0
  25. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/climate.py +0 -0
  26. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/dask.py +0 -0
  27. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/landcover.py +0 -0
  28. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/maps.py +0 -0
  29. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/plotting.py +0 -0
  30. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/pyfes_model.py +0 -0
  31. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/spatial.py +0 -0
  32. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/temporal.py +0 -0
  33. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/validation.py +0 -0
  34. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/waterbodies.py +0 -0
  35. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools/wetlands.py +0 -0
  36. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools.egg-info/SOURCES.txt +0 -0
  37. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools.egg-info/dependency_links.txt +0 -0
  38. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/dea_tools.egg-info/top_level.txt +0 -0
  39. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/index.rst +0 -0
  40. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/mock_imports.txt +0 -0
  41. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/pyproject.toml +0 -0
  42. {dea_tools-0.3.5.dev23 → dea_tools-0.3.6.dev25}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: dea-tools
3
- Version: 0.3.5.dev23
3
+ Version: 0.3.6.dev25
4
4
  Summary: Functions and algorithms for analysing Digital Earth Australia data.
5
5
  Home-page: https://github.com/GeoscienceAustralia/dea-notebooks
6
6
  Author: Geoscience Australia
@@ -44,7 +44,7 @@ Requires-Dist: pyproj
44
44
  Requires-Dist: pystac-client
45
45
  Requires-Dist: planetary-computer
46
46
  Requires-Dist: python-dateutil
47
- Requires-Dist: pyTMD<=2.1.6
47
+ Requires-Dist: pyTMD!=2.1.7
48
48
  Requires-Dist: pytz
49
49
  Requires-Dist: rasterio
50
50
  Requires-Dist: rasterstats
@@ -65,6 +65,17 @@ Provides-Extra: dask-gateway
65
65
  Requires-Dist: dask_gateway; extra == "dask-gateway"
66
66
  Provides-Extra: otps
67
67
  Requires-Dist: otps; extra == "otps"
68
+ Dynamic: author
69
+ Dynamic: author-email
70
+ Dynamic: classifier
71
+ Dynamic: description
72
+ Dynamic: description-content-type
73
+ Dynamic: home-page
74
+ Dynamic: license
75
+ Dynamic: provides-extra
76
+ Dynamic: requires-dist
77
+ Dynamic: requires-python
78
+ Dynamic: summary
68
79
 
69
80
 
70
81
  dea-tools package
@@ -738,6 +738,10 @@ def model_tides(
738
738
  **ensemble_kwargs,
739
739
  ):
740
740
  """
741
+ DEPRECATED: This function has been moved to the `eo-tides` Python package,
742
+ and will be retired in a future release. Please migrate your code to use
743
+ `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
744
+
741
745
  Compute tides at multiple points and times using tidal harmonics.
742
746
 
743
747
  This function supports all tidal models supported by `pyTMD`,
@@ -887,6 +891,14 @@ def model_tides(
887
891
  combination of time and point coordinates.
888
892
 
889
893
  """
894
+ warnings.warn(
895
+ "This function has been moved to the `eo-tides` Python package, "
896
+ "and will be retired in a future release. Please migrate your code "
897
+ "to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
898
+ DeprecationWarning,
899
+ stacklevel=2,
900
+ )
901
+
890
902
  # Set tide modelling files directory. If no custom path is provided,
891
903
  # first try global environmental var, then "/var/share/tide_models"
892
904
  if directory is None:
@@ -1169,6 +1181,10 @@ def pixel_tides(
1169
1181
  **model_tides_kwargs,
1170
1182
  ):
1171
1183
  """
1184
+ DEPRECATED: This function has been moved to the `eo-tides` Python package,
1185
+ and will be retired in a future release. Please migrate your code to use
1186
+ `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
1187
+
1172
1188
  Obtain tide heights for each pixel in a dataset by modelling
1173
1189
  tides into a low-resolution grid surrounding the dataset,
1174
1190
  then (optionally) spatially resample this low-res data back
@@ -1271,6 +1287,14 @@ def pixel_tides(
1271
1287
  import odc.geo.xr
1272
1288
  from odc.geo.geobox import GeoBox
1273
1289
 
1290
+ warnings.warn(
1291
+ "This function has been moved to the `eo-tides` Python package, "
1292
+ "and will be retired in a future release. Please migrate your code "
1293
+ "to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
1294
+ DeprecationWarning,
1295
+ stacklevel=2,
1296
+ )
1297
+
1274
1298
  # First test if no time dimension and nothing passed to `times`
1275
1299
  if ("time" not in ds.dims) & (times is None):
1276
1300
  raise ValueError(
@@ -1449,6 +1473,10 @@ def tidal_tag(
1449
1473
  **model_tides_kwargs,
1450
1474
  ):
1451
1475
  """
1476
+ DEPRECATED: This function has been moved to the `eo-tides` Python package,
1477
+ and will be retired in a future release. Please migrate your code to use
1478
+ `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
1479
+
1452
1480
  Takes an xarray.Dataset and returns the same dataset with a new
1453
1481
  `tide_m` variable giving the height of the tide at the exact
1454
1482
  moment of each satellite acquisition.
@@ -1501,6 +1529,14 @@ def tidal_tag(
1501
1529
 
1502
1530
  import odc.geo.xr
1503
1531
 
1532
+ warnings.warn(
1533
+ "This function has been moved to the `eo-tides` Python package, "
1534
+ "and will be retired in a future release. Please migrate your code "
1535
+ "to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
1536
+ DeprecationWarning,
1537
+ stacklevel=2,
1538
+ )
1539
+
1504
1540
  # If custom tide modelling locations are not provided, use the
1505
1541
  # dataset centroid
1506
1542
  if not tidepost_lat or not tidepost_lon:
@@ -1593,6 +1629,10 @@ def tidal_stats(
1593
1629
  **model_tides_kwargs,
1594
1630
  ):
1595
1631
  """
1632
+ DEPRECATED: This function has been moved to the `eo-tides` Python package,
1633
+ and will be retired in a future release. Please migrate your code to use
1634
+ `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
1635
+
1596
1636
  Takes an xarray.Dataset and statistically compares the tides
1597
1637
  modelled for each satellite observation against the full modelled
1598
1638
  tidal range. This comparison can be used to evaluate whether the
@@ -1679,6 +1719,13 @@ def tidal_stats(
1679
1719
  all available tide heights and time
1680
1720
 
1681
1721
  """
1722
+ warnings.warn(
1723
+ "This function has been moved to the `eo-tides` Python package, "
1724
+ "and will be retired in a future release. Please migrate your code "
1725
+ "to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
1726
+ DeprecationWarning,
1727
+ stacklevel=2,
1728
+ )
1682
1729
 
1683
1730
  # Model tides for each observation in the supplied xarray object
1684
1731
  ds_tides, tidepost_lon, tidepost_lat = tidal_tag(
@@ -1861,6 +1908,10 @@ def tidal_tag_otps(
1861
1908
  return_tideposts=False,
1862
1909
  ):
1863
1910
  """
1911
+ DEPRECATED: This function has been moved to the `eo-tides` Python package,
1912
+ and will be retired in a future release. Please migrate your code to use
1913
+ `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
1914
+
1864
1915
  Takes an xarray.Dataset and returns the same dataset with a new
1865
1916
  `tide_m` variable giving the height of the tide at the exact
1866
1917
  moment of each satellite acquisition.
@@ -1904,6 +1955,13 @@ def tidal_tag_otps(
1904
1955
  location used in the analysis).
1905
1956
 
1906
1957
  """
1958
+ warnings.warn(
1959
+ "This function has been moved to the `eo-tides` Python package, "
1960
+ "and will be retired in a future release. Please migrate your code "
1961
+ "to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
1962
+ DeprecationWarning,
1963
+ stacklevel=2,
1964
+ )
1907
1965
 
1908
1966
  # Load tide modelling functions from either OTPS for pyfes
1909
1967
  try:
@@ -2002,6 +2060,10 @@ def tidal_stats_otps(
2002
2060
  round_stats=3,
2003
2061
  ):
2004
2062
  """
2063
+ DEPRECATED: This function has been moved to the `eo-tides` Python package,
2064
+ and will be retired in a future release. Please migrate your code to use
2065
+ `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/
2066
+
2005
2067
  Takes an xarray.Dataset and statistically compares the tides
2006
2068
  modelled for each satellite observation against the full modelled
2007
2069
  tidal range. This comparison can be used to evaluate whether the
@@ -2082,6 +2144,13 @@ def tidal_stats_otps(
2082
2144
  all available tide heights and time
2083
2145
 
2084
2146
  """
2147
+ warnings.warn(
2148
+ "This function has been moved to the `eo-tides` Python package, "
2149
+ "and will be retired in a future release. Please migrate your code "
2150
+ "to use `eo-tides` instead: https://geoscienceaustralia.github.io/eo-tides/migration/",
2151
+ DeprecationWarning,
2152
+ stacklevel=2,
2153
+ )
2085
2154
 
2086
2155
  # Load tide modelling functions from either OTPS for pyfes
2087
2156
  try:
@@ -17,7 +17,7 @@ here: https://gis.stackexchange.com/questions/tagged/open-data-cube).
17
17
  If you would like to report an issue with this script, you can file one
18
18
  on GitHub (https://github.com/GeoscienceAustralia/dea-notebooks/issues/new).
19
19
 
20
- Last modified: Feb 2024
20
+ Last modified: February 2025
21
21
  """
22
22
 
23
23
  import datetime
@@ -112,7 +112,7 @@ def load_ard(
112
112
  ):
113
113
  """
114
114
  Load multiple Geoscience Australia Landsat or Sentinel 2
115
- Collection 3 products (e.g. Landsat 5, 7, 8, 9; Sentinel 2A and 2B),
115
+ Collection 3 Analysis Ready Data products (e.g. Landsat 5, 7, 8, 9; Sentinel 2A, 2B, 2C),
116
116
  optionally apply pixel quality/cloud masking and contiguity masks,
117
117
  and drop time steps that contain greater than a minimum proportion
118
118
  of good quality (e.g. non-cloudy or shadowed) pixels.
@@ -126,13 +126,14 @@ def load_ard(
126
126
  And Sentinel-2 products:
127
127
  * ga_s2am_ard_3
128
128
  * ga_s2bm_ard_3
129
+ * ga_s2cm_ard_3
129
130
 
130
131
  Cloud masking can be performed using the Fmask (Function of Mask)
131
132
  cloud mask for Landsat and Sentinel-2, and the s2cloudless
132
133
  (Sentinel Hub cloud detector for Sentinel-2 imagery) cloud mask for
133
134
  Sentinel-2.
134
135
 
135
- Last modified: June 2023
136
+ Last modified: February 2025
136
137
 
137
138
  Parameters
138
139
  ----------
@@ -142,7 +143,8 @@ def load_ard(
142
143
  products : list
143
144
  A list of product names to load. Valid options are
144
145
  ['ga_ls5t_ard_3', 'ga_ls7e_ard_3', 'ga_ls8c_ard_3', 'ga_ls9c_ard_3']
145
- for Landsat, ['ga_s2am_ard_3', 'ga_s2bm_ard_3'] for Sentinel 2.
146
+ for Landsat, ['ga_s2am_ard_3', 'ga_s2bm_ard_3', 'ga_s2cm_ard_3']
147
+ for Sentinel 2.
146
148
  cloud_mask : string, optional
147
149
  The cloud mask used by the function. This is used for both
148
150
  masking out poor quality pixels (e.g. clouds) if
@@ -256,21 +258,27 @@ def load_ard(
256
258
  # Setup #
257
259
  #########
258
260
 
261
+ # Convert products to a list if it is passed as a string
262
+ products = [products] if isinstance(products, str) else products
263
+
264
+ # Valid Landsat products
265
+ valid_ls = ["ga_ls5t_ard_3", "ga_ls7e_ard_3", "ga_ls8c_ard_3", "ga_ls9c_ard_3"]
266
+ valid_s2 = ["ga_s2am_ard_3", "ga_s2bm_ard_3", "ga_s2cm_ard_3"]
267
+
259
268
  # Verify that products were provided
260
269
  if not products:
261
270
  raise ValueError(
262
- "Please provide a list of product names to load data from. "
263
- "Valid options are: ['ga_ls5t_ard_3', 'ga_ls7e_ard_3', "
264
- "'ga_ls8c_ard_3', 'ga_ls9c_ard_3'] for Landsat, and "
265
- "['ga_s2am_ard_3', 'ga_s2bm_ard_3'] for Sentinel 2."
271
+ f"Please provide a list of Landsat or Sentinel-2 Analysis Ready Data "
272
+ f"product names to load data from. Valid options are: "
273
+ f"{valid_ls + valid_s2}."
266
274
  )
267
275
 
268
276
  # Determine whether products are all Landsat, all S2, or mixed
269
- elif all(["ls" in product for product in products]):
277
+ elif all([product in valid_ls for product in products]):
270
278
  product_type = "ls"
271
- elif all(["s2" in product for product in products]):
279
+ elif all([product in valid_s2 for product in products]):
272
280
  product_type = "s2"
273
- else:
281
+ elif all([product in valid_s2 + valid_ls for product in products]):
274
282
  product_type = "mixed"
275
283
 
276
284
  warnings.warn(
@@ -280,6 +288,16 @@ def load_ard(
280
288
  "(e.g. Landsat and Sentinel-2's 'nbart_swir_2'); use with "
281
289
  "caution."
282
290
  )
291
+ else:
292
+ # If an invalid product is passed, raise error
293
+ invalid_products = [
294
+ product for product in products if product not in valid_s2 + valid_ls
295
+ ]
296
+ raise ValueError(
297
+ f"The `load_ard` function only supports Landsat and "
298
+ f"Sentinel-2 Analysis Ready Data products; {invalid_products} is not supported. "
299
+ f"Valid options are: {valid_ls + valid_s2}."
300
+ )
283
301
 
284
302
  # Set contiguity band depending on `mask_contiguity`;
285
303
  # "oa_nbart_contiguity" if True, False or "nbart",
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: dea-tools
3
- Version: 0.3.5.dev23
3
+ Version: 0.3.6.dev25
4
4
  Summary: Functions and algorithms for analysing Digital Earth Australia data.
5
5
  Home-page: https://github.com/GeoscienceAustralia/dea-notebooks
6
6
  Author: Geoscience Australia
@@ -44,7 +44,7 @@ Requires-Dist: pyproj
44
44
  Requires-Dist: pystac-client
45
45
  Requires-Dist: planetary-computer
46
46
  Requires-Dist: python-dateutil
47
- Requires-Dist: pyTMD<=2.1.6
47
+ Requires-Dist: pyTMD!=2.1.7
48
48
  Requires-Dist: pytz
49
49
  Requires-Dist: rasterio
50
50
  Requires-Dist: rasterstats
@@ -65,6 +65,17 @@ Provides-Extra: dask-gateway
65
65
  Requires-Dist: dask_gateway; extra == "dask-gateway"
66
66
  Provides-Extra: otps
67
67
  Requires-Dist: otps; extra == "otps"
68
+ Dynamic: author
69
+ Dynamic: author-email
70
+ Dynamic: classifier
71
+ Dynamic: description
72
+ Dynamic: description-content-type
73
+ Dynamic: home-page
74
+ Dynamic: license
75
+ Dynamic: provides-extra
76
+ Dynamic: requires-dist
77
+ Dynamic: requires-python
78
+ Dynamic: summary
68
79
 
69
80
 
70
81
  dea-tools package
@@ -26,7 +26,7 @@ pyproj
26
26
  pystac-client
27
27
  planetary-computer
28
28
  python-dateutil
29
- pyTMD<=2.1.6
29
+ pyTMD!=2.1.7
30
30
  pytz
31
31
  rasterio
32
32
  rasterstats
@@ -56,7 +56,7 @@ REQUIRED = [
56
56
  'pystac-client',
57
57
  'planetary-computer',
58
58
  'python-dateutil',
59
- 'pyTMD<=2.1.6',
59
+ 'pyTMD!=2.1.7',
60
60
  'pytz',
61
61
  'rasterio',
62
62
  'rasterstats',
File without changes