dea-tools 0.3.5.dev21__tar.gz → 0.3.6.dev1__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.dev21/dea_tools.egg-info → dea_tools-0.3.6.dev1}/PKG-INFO +2 -2
  2. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/coastal.py +301 -109
  3. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/datahandling.py +4 -1
  4. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/spatial.py +1 -1
  5. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1/dea_tools.egg-info}/PKG-INFO +2 -2
  6. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools.egg-info/requires.txt +1 -1
  7. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/setup.py +1 -1
  8. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/.gitignore +0 -0
  9. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/LICENSE +0 -0
  10. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/MANIFEST.in +0 -0
  11. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/README.rst +0 -0
  12. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/__init__.py +0 -0
  13. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/__main__.py +0 -0
  14. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/__init__.py +0 -0
  15. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/animations.py +0 -0
  16. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/changefilmstrips.py +0 -0
  17. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/crophealth.py +0 -0
  18. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/deacoastlines.py +0 -0
  19. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/geomedian.py +0 -0
  20. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/imageexport.py +0 -0
  21. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/miningrehab.py +0 -0
  22. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/widgetconstructors.py +0 -0
  23. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/bandindices.py +0 -0
  24. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/bom.py +0 -0
  25. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/classification.py +0 -0
  26. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/climate.py +0 -0
  27. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/dask.py +0 -0
  28. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/landcover.py +0 -0
  29. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/maps.py +0 -0
  30. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/plotting.py +0 -0
  31. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/pyfes_model.py +0 -0
  32. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/temporal.py +0 -0
  33. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/validation.py +0 -0
  34. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/waterbodies.py +0 -0
  35. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/wetlands.py +0 -0
  36. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools.egg-info/SOURCES.txt +0 -0
  37. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools.egg-info/dependency_links.txt +0 -0
  38. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools.egg-info/top_level.txt +0 -0
  39. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/index.rst +0 -0
  40. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/mock_imports.txt +0 -0
  41. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/pyproject.toml +0 -0
  42. {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dea-tools
3
- Version: 0.3.5.dev21
3
+ Version: 0.3.6.dev1
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.5,>=2.0.0
47
+ Requires-Dist: pyTMD<=2.1.6
48
48
  Requires-Dist: pytz
49
49
  Requires-Dist: rasterio
50
50
  Requires-Dist: rasterstats
@@ -288,120 +288,243 @@ def _model_tides(
288
288
  lat.max() + buffer,
289
289
  ]
290
290
 
291
- # Read tidal constants and interpolate to grid points
292
- if pytmd_model.format in ("OTIS", "ATLAS", "TMD3"):
293
- amp, ph, D, c = pyTMD.io.OTIS.extract_constants(
294
- lon,
295
- lat,
296
- pytmd_model.grid_file,
297
- pytmd_model.model_file,
298
- pytmd_model.projection,
299
- type=pytmd_model.type,
300
- crop=crop,
301
- bounds=bounds,
302
- method=method,
303
- extrapolate=extrapolate,
304
- cutoff=cutoff,
305
- grid=pytmd_model.format,
291
+ # TEMPORARY HACK to work on both old and new pyTMD
292
+ try:
293
+
294
+ # Read tidal constants and interpolate to grid points
295
+ if pytmd_model.format in ("OTIS", "ATLAS", "TMD3"):
296
+ amp, ph, D, c = pyTMD.io.OTIS.extract_constants(
297
+ lon,
298
+ lat,
299
+ pytmd_model.grid_file,
300
+ pytmd_model.model_file,
301
+ pytmd_model.projection,
302
+ type=pytmd_model.type,
303
+ crop=crop,
304
+ bounds=bounds,
305
+ method=method,
306
+ extrapolate=extrapolate,
307
+ cutoff=cutoff,
308
+ grid=pytmd_model.format,
309
+ )
310
+
311
+ # Use delta time at 2000.0 to match TMD outputs
312
+ deltat = np.zeros((len(timescale)), dtype=np.float64)
313
+
314
+ elif pytmd_model.format == "netcdf":
315
+ amp, ph, D, c = pyTMD.io.ATLAS.extract_constants(
316
+ lon,
317
+ lat,
318
+ pytmd_model.grid_file,
319
+ pytmd_model.model_file,
320
+ type=pytmd_model.type,
321
+ crop=crop,
322
+ bounds=bounds,
323
+ method=method,
324
+ extrapolate=extrapolate,
325
+ cutoff=cutoff,
326
+ scale=pytmd_model.scale,
327
+ compressed=pytmd_model.compressed,
328
+ )
329
+
330
+ # Use delta time at 2000.0 to match TMD outputs
331
+ deltat = np.zeros((len(timescale)), dtype=np.float64)
332
+
333
+ elif pytmd_model.format == "GOT":
334
+ amp, ph, c = pyTMD.io.GOT.extract_constants(
335
+ lon,
336
+ lat,
337
+ pytmd_model.model_file,
338
+ crop=crop,
339
+ bounds=bounds,
340
+ method=method,
341
+ extrapolate=extrapolate,
342
+ cutoff=cutoff,
343
+ scale=pytmd_model.scale,
344
+ compressed=pytmd_model.compressed,
345
+ )
346
+
347
+ # Delta time (TT - UT1)
348
+ deltat = timescale.tt_ut1
349
+
350
+ elif pytmd_model.format == "FES":
351
+ amp, ph = pyTMD.io.FES.extract_constants(
352
+ lon,
353
+ lat,
354
+ pytmd_model.model_file,
355
+ type=pytmd_model.type,
356
+ version=pytmd_model.version,
357
+ crop=crop,
358
+ bounds=bounds,
359
+ method=method,
360
+ extrapolate=extrapolate,
361
+ cutoff=cutoff,
362
+ scale=pytmd_model.scale,
363
+ compressed=pytmd_model.compressed,
364
+ )
365
+
366
+ # Available model constituents
367
+ c = pytmd_model.constituents
368
+
369
+ # Delta time (TT - UT1)
370
+ deltat = timescale.tt_ut1
371
+
372
+ # Calculate complex phase in radians for Euler's
373
+ cph = -1j * ph * np.pi / 180.0
374
+
375
+ # Calculate constituent oscillation
376
+ hc = amp * np.exp(cph)
377
+
378
+ # Determine the number of points and times to process. If in
379
+ # "one-to-many" mode, these counts are used to repeat our extracted
380
+ # constituents and timesteps so we can extract tides for all
381
+ # combinations of our input times and tide modelling points.
382
+ # If in "one-to-one" mode, we avoid this step by setting counts to 1
383
+ # (e.g. "repeat 1 times")
384
+ points_repeat = len(x) if mode == "one-to-many" else 1
385
+ time_repeat = len(time) if mode == "one-to-many" else 1
386
+
387
+ # If in "one-to-many" mode, repeat constituents to length of time
388
+ # and number of input coords before passing to `predict_tide_drift`
389
+ t, hc, deltat = (
390
+ np.tile(timescale.tide, points_repeat),
391
+ hc.repeat(time_repeat, axis=0),
392
+ np.tile(deltat, points_repeat),
306
393
  )
307
-
308
- # Use delta time at 2000.0 to match TMD outputs
309
- deltat = np.zeros((len(timescale)), dtype=np.float64)
310
-
311
- elif pytmd_model.format == "netcdf":
312
- amp, ph, D, c = pyTMD.io.ATLAS.extract_constants(
313
- lon,
314
- lat,
315
- pytmd_model.grid_file,
316
- pytmd_model.model_file,
317
- type=pytmd_model.type,
318
- crop=crop,
319
- bounds=bounds,
320
- method=method,
321
- extrapolate=extrapolate,
322
- cutoff=cutoff,
323
- scale=pytmd_model.scale,
324
- compressed=pytmd_model.compressed,
394
+
395
+ # Predict tidal elevations at time and infer minor corrections
396
+ npts = len(t)
397
+ tide = np.ma.zeros((npts), fill_value=np.nan)
398
+ tide.mask = np.any(hc.mask, axis=1)
399
+
400
+ # Predict tides
401
+ tide.data[:] = pyTMD.predict.drift(
402
+ t, hc, c, deltat=deltat, corrections=pytmd_model.format
325
403
  )
326
-
327
- # Use delta time at 2000.0 to match TMD outputs
328
- deltat = np.zeros((len(timescale)), dtype=np.float64)
329
-
330
- elif pytmd_model.format == "GOT":
331
- amp, ph, c = pyTMD.io.GOT.extract_constants(
332
- lon,
333
- lat,
334
- pytmd_model.model_file,
335
- crop=crop,
336
- bounds=bounds,
337
- method=method,
338
- extrapolate=extrapolate,
339
- cutoff=cutoff,
340
- scale=pytmd_model.scale,
341
- compressed=pytmd_model.compressed,
404
+ minor = pyTMD.predict.infer_minor(
405
+ t, hc, c, deltat=deltat, corrections=pytmd_model.format
342
406
  )
407
+ tide.data[:] += minor.data[:]
343
408
 
344
- # Delta time (TT - UT1)
345
- deltat = timescale.tt_ut1
346
-
347
- elif pytmd_model.format == "FES":
348
- amp, ph = pyTMD.io.FES.extract_constants(
349
- lon,
350
- lat,
351
- pytmd_model.model_file,
352
- type=pytmd_model.type,
353
- version=pytmd_model.version,
354
- crop=crop,
355
- bounds=bounds,
356
- method=method,
357
- extrapolate=extrapolate,
358
- cutoff=cutoff,
359
- scale=pytmd_model.scale,
360
- compressed=pytmd_model.compressed,
409
+ except:
410
+ # Read tidal constants and interpolate to grid points
411
+ if pytmd_model.format in ("OTIS", "ATLAS-compact", "TMD3"):
412
+ amp, ph, D, c = pyTMD.io.OTIS.extract_constants(
413
+ lon,
414
+ lat,
415
+ pytmd_model.grid_file,
416
+ pytmd_model.model_file,
417
+ pytmd_model.projection,
418
+ type=pytmd_model.type,
419
+ grid=pytmd_model.file_format,
420
+ crop=crop,
421
+ bounds=bounds,
422
+ method=method,
423
+ extrapolate=extrapolate,
424
+ cutoff=cutoff,
425
+ )
426
+
427
+ # Use delta time at 2000.0 to match TMD outputs
428
+ deltat = np.zeros((len(timescale)), dtype=np.float64)
429
+
430
+ elif pytmd_model.format in ("ATLAS-netcdf",):
431
+ amp, ph, D, c = pyTMD.io.ATLAS.extract_constants(
432
+ lon,
433
+ lat,
434
+ pytmd_model.grid_file,
435
+ pytmd_model.model_file,
436
+ type=pytmd_model.type,
437
+ crop=crop,
438
+ bounds=bounds,
439
+ method=method,
440
+ extrapolate=extrapolate,
441
+ cutoff=cutoff,
442
+ scale=pytmd_model.scale,
443
+ compressed=pytmd_model.compressed,
444
+ )
445
+
446
+ # Use delta time at 2000.0 to match TMD outputs
447
+ deltat = np.zeros((len(timescale)), dtype=np.float64)
448
+
449
+ elif pytmd_model.format in ("GOT-ascii", "GOT-netcdf"):
450
+ amp, ph, c = pyTMD.io.GOT.extract_constants(
451
+ lon,
452
+ lat,
453
+ pytmd_model.model_file,
454
+ grid=pytmd_model.type,
455
+ crop=crop,
456
+ bounds=bounds,
457
+ method=method,
458
+ extrapolate=extrapolate,
459
+ cutoff=cutoff,
460
+ scale=pytmd_model.scale,
461
+ compressed=pytmd_model.compressed,
462
+ )
463
+
464
+ # Delta time (TT - UT1)
465
+ deltat = timescale.tt_ut1
466
+
467
+ elif pytmd_model.format in ("FES-ascii", "FES-netcdf"):
468
+ amp, ph = pyTMD.io.FES.extract_constants(
469
+ lon,
470
+ lat,
471
+ pytmd_model.model_file,
472
+ type=pytmd_model.type,
473
+ version=pytmd_model.version,
474
+ crop=crop,
475
+ bounds=bounds,
476
+ method=method,
477
+ extrapolate=extrapolate,
478
+ cutoff=cutoff,
479
+ scale=pytmd_model.scale,
480
+ compressed=pytmd_model.compressed,
481
+ )
482
+
483
+ # Available model constituents
484
+ c = pytmd_model.constituents
485
+
486
+ # Delta time (TT - UT1)
487
+ deltat = timescale.tt_ut1
488
+
489
+ # Calculate complex phase in radians for Euler's
490
+ cph = -1j * ph * np.pi / 180.0
491
+
492
+ # Calculate constituent oscillation
493
+ hc = amp * np.exp(cph)
494
+
495
+ # Determine the number of points and times to process. If in
496
+ # "one-to-many" mode, these counts are used to repeat our extracted
497
+ # constituents and timesteps so we can extract tides for all
498
+ # combinations of our input times and tide modelling points.
499
+ # If in "one-to-one" mode, we avoid this step by setting counts to 1
500
+ # (e.g. "repeat 1 times")
501
+ points_repeat = len(x) if mode == "one-to-many" else 1
502
+ time_repeat = len(time) if mode == "one-to-many" else 1
503
+
504
+ # If in "one-to-many" mode, repeat constituents to length of time
505
+ # and number of input coords before passing to `predict_tide_drift`
506
+ t, hc, deltat = (
507
+ np.tile(timescale.tide, points_repeat),
508
+ hc.repeat(time_repeat, axis=0),
509
+ np.tile(deltat, points_repeat),
361
510
  )
362
-
363
- # Available model constituents
364
- c = pytmd_model.constituents
365
-
366
- # Delta time (TT - UT1)
367
- deltat = timescale.tt_ut1
368
-
369
- # Calculate complex phase in radians for Euler's
370
- cph = -1j * ph * np.pi / 180.0
371
-
372
- # Calculate constituent oscillation
373
- hc = amp * np.exp(cph)
374
-
375
- # Determine the number of points and times to process. If in
376
- # "one-to-many" mode, these counts are used to repeat our extracted
377
- # constituents and timesteps so we can extract tides for all
378
- # combinations of our input times and tide modelling points.
379
- # If in "one-to-one" mode, we avoid this step by setting counts to 1
380
- # (e.g. "repeat 1 times")
381
- points_repeat = len(x) if mode == "one-to-many" else 1
382
- time_repeat = len(time) if mode == "one-to-many" else 1
383
-
384
- # If in "one-to-many" mode, repeat constituents to length of time
385
- # and number of input coords before passing to `predict_tide_drift`
386
- t, hc, deltat = (
387
- np.tile(timescale.tide, points_repeat),
388
- hc.repeat(time_repeat, axis=0),
389
- np.tile(deltat, points_repeat),
390
- )
391
-
392
- # Predict tidal elevations at time and infer minor corrections
393
- npts = len(t)
394
- tide = np.ma.zeros((npts), fill_value=np.nan)
395
- tide.mask = np.any(hc.mask, axis=1)
396
-
397
- # Predict tides
398
- tide.data[:] = pyTMD.predict.drift(
399
- t, hc, c, deltat=deltat, corrections=pytmd_model.format
400
- )
401
- minor = pyTMD.predict.infer_minor(
402
- t, hc, c, deltat=deltat, corrections=pytmd_model.format
403
- )
404
- tide.data[:] += minor.data[:]
511
+
512
+ # Predict tidal elevations at time and infer minor corrections
513
+ npts = len(t)
514
+ tide = np.ma.zeros((npts), fill_value=np.nan)
515
+ tide.mask = np.any(hc.mask, axis=1)
516
+
517
+ # Predict tides
518
+ tide.data[:] = pyTMD.predict.drift(t, hc, c, deltat=deltat, corrections=pytmd_model.corrections)
519
+ minor = pyTMD.predict.infer_minor(
520
+ t,
521
+ hc,
522
+ c,
523
+ deltat=deltat,
524
+ corrections=pytmd_model.corrections,
525
+ minor=pytmd_model.minor,
526
+ )
527
+ tide.data[:] += minor.data[:]
405
528
 
406
529
  # Replace invalid values with fill value
407
530
  tide.data[tide.mask] = tide.fill_value
@@ -615,6 +738,10 @@ def model_tides(
615
738
  **ensemble_kwargs,
616
739
  ):
617
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
+
618
745
  Compute tides at multiple points and times using tidal harmonics.
619
746
 
620
747
  This function supports all tidal models supported by `pyTMD`,
@@ -764,6 +891,14 @@ def model_tides(
764
891
  combination of time and point coordinates.
765
892
 
766
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
+
767
902
  # Set tide modelling files directory. If no custom path is provided,
768
903
  # first try global environmental var, then "/var/share/tide_models"
769
904
  if directory is None:
@@ -1046,6 +1181,10 @@ def pixel_tides(
1046
1181
  **model_tides_kwargs,
1047
1182
  ):
1048
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
+
1049
1188
  Obtain tide heights for each pixel in a dataset by modelling
1050
1189
  tides into a low-resolution grid surrounding the dataset,
1051
1190
  then (optionally) spatially resample this low-res data back
@@ -1148,6 +1287,14 @@ def pixel_tides(
1148
1287
  import odc.geo.xr
1149
1288
  from odc.geo.geobox import GeoBox
1150
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
+
1151
1298
  # First test if no time dimension and nothing passed to `times`
1152
1299
  if ("time" not in ds.dims) & (times is None):
1153
1300
  raise ValueError(
@@ -1326,6 +1473,10 @@ def tidal_tag(
1326
1473
  **model_tides_kwargs,
1327
1474
  ):
1328
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
+
1329
1480
  Takes an xarray.Dataset and returns the same dataset with a new
1330
1481
  `tide_m` variable giving the height of the tide at the exact
1331
1482
  moment of each satellite acquisition.
@@ -1378,6 +1529,14 @@ def tidal_tag(
1378
1529
 
1379
1530
  import odc.geo.xr
1380
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
+
1381
1540
  # If custom tide modelling locations are not provided, use the
1382
1541
  # dataset centroid
1383
1542
  if not tidepost_lat or not tidepost_lon:
@@ -1470,6 +1629,10 @@ def tidal_stats(
1470
1629
  **model_tides_kwargs,
1471
1630
  ):
1472
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
+
1473
1636
  Takes an xarray.Dataset and statistically compares the tides
1474
1637
  modelled for each satellite observation against the full modelled
1475
1638
  tidal range. This comparison can be used to evaluate whether the
@@ -1556,6 +1719,13 @@ def tidal_stats(
1556
1719
  all available tide heights and time
1557
1720
 
1558
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
+ )
1559
1729
 
1560
1730
  # Model tides for each observation in the supplied xarray object
1561
1731
  ds_tides, tidepost_lon, tidepost_lat = tidal_tag(
@@ -1738,6 +1908,10 @@ def tidal_tag_otps(
1738
1908
  return_tideposts=False,
1739
1909
  ):
1740
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
+
1741
1915
  Takes an xarray.Dataset and returns the same dataset with a new
1742
1916
  `tide_m` variable giving the height of the tide at the exact
1743
1917
  moment of each satellite acquisition.
@@ -1781,6 +1955,13 @@ def tidal_tag_otps(
1781
1955
  location used in the analysis).
1782
1956
 
1783
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
+ )
1784
1965
 
1785
1966
  # Load tide modelling functions from either OTPS for pyfes
1786
1967
  try:
@@ -1879,6 +2060,10 @@ def tidal_stats_otps(
1879
2060
  round_stats=3,
1880
2061
  ):
1881
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
+
1882
2067
  Takes an xarray.Dataset and statistically compares the tides
1883
2068
  modelled for each satellite observation against the full modelled
1884
2069
  tidal range. This comparison can be used to evaluate whether the
@@ -1959,6 +2144,13 @@ def tidal_stats_otps(
1959
2144
  all available tide heights and time
1960
2145
 
1961
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
+ )
1962
2154
 
1963
2155
  # Load tide modelling functions from either OTPS for pyfes
1964
2156
  try:
@@ -1090,7 +1090,6 @@ def _esri_pansharpen(ds, pan_band, band_weights=None):
1090
1090
  ds_pansharpened : xarray.Dataset
1091
1091
  Pansharpened dataset with the same dimensions as the input dataset.
1092
1092
  """
1093
-
1094
1093
  # Create new dataarrays with and without pan band
1095
1094
  da_nopan = ds.drop(pan_band).to_array()
1096
1095
  da_pan = ds[pan_band]
@@ -1157,6 +1156,8 @@ def _hsv_timestep_pansharpen(ds_i, pan_band):
1157
1156
  ds_pansharpened : xarray.Dataset
1158
1157
  Pansharpened dataset with the same dimensions as the input dataset.
1159
1158
  """
1159
+ # Squeeze out any single dimensions
1160
+ ds_i = ds_i.squeeze()
1160
1161
 
1161
1162
  # Convert to an xr.DataArray and move "variable" to end
1162
1163
  da_i = ds_i.to_array().transpose(..., "variable")
@@ -1209,6 +1210,8 @@ def _pca_timestep_pansharpen(ds_i, pan_band, pca_rescaling="histogram"):
1209
1210
  ds_pansharpened : xarray.Dataset
1210
1211
  Pansharpened dataset with the same dimensions as the input dataset.
1211
1212
  """
1213
+ # Squeeze out any single dimensions
1214
+ ds_i = ds_i.squeeze()
1212
1215
 
1213
1216
  # Reshape to 2D by stacking x and y dimensions to prepare it
1214
1217
  # as an input to PCA. Drop NA rows as these are not supported
@@ -535,7 +535,7 @@ def subpixel_contours(
535
535
 
536
536
  contour_arrays = {
537
537
  _time_format(i, time_format): _contours_to_multiline(
538
- da_i, z_values[0], min_vertices
538
+ da_i.squeeze(), z_values[0], min_vertices
539
539
  )
540
540
  for i, da_i in da.groupby(dim)
541
541
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dea-tools
3
- Version: 0.3.5.dev21
3
+ Version: 0.3.6.dev1
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.5,>=2.0.0
47
+ Requires-Dist: pyTMD<=2.1.6
48
48
  Requires-Dist: pytz
49
49
  Requires-Dist: rasterio
50
50
  Requires-Dist: rasterstats
@@ -26,7 +26,7 @@ pyproj
26
26
  pystac-client
27
27
  planetary-computer
28
28
  python-dateutil
29
- pyTMD<2.1.5,>=2.0.0
29
+ pyTMD<=2.1.6
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.0.0,<2.1.5',
59
+ 'pyTMD<=2.1.6',
60
60
  'pytz',
61
61
  'rasterio',
62
62
  'rasterstats',
File without changes