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.
- {dea_tools-0.3.5.dev21/dea_tools.egg-info → dea_tools-0.3.6.dev1}/PKG-INFO +2 -2
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/coastal.py +301 -109
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/datahandling.py +4 -1
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/spatial.py +1 -1
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1/dea_tools.egg-info}/PKG-INFO +2 -2
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools.egg-info/requires.txt +1 -1
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/setup.py +1 -1
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/.gitignore +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/LICENSE +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/MANIFEST.in +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/README.rst +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/__init__.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/__main__.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/__init__.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/animations.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/changefilmstrips.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/crophealth.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/deacoastlines.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/geomedian.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/imageexport.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/miningrehab.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/app/widgetconstructors.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/bandindices.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/bom.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/classification.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/climate.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/dask.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/landcover.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/maps.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/plotting.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/pyfes_model.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/temporal.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/validation.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/waterbodies.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools/wetlands.py +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools.egg-info/SOURCES.txt +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools.egg-info/dependency_links.txt +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/dea_tools.egg-info/top_level.txt +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/index.rst +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/mock_imports.txt +0 -0
- {dea_tools-0.3.5.dev21 → dea_tools-0.3.6.dev1}/pyproject.toml +0 -0
- {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.
|
|
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
|
|
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
|
-
#
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
#
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
pytmd_model.
|
|
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
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
-
#
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dea-tools
|
|
3
|
-
Version: 0.3.
|
|
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
|
|
47
|
+
Requires-Dist: pyTMD<=2.1.6
|
|
48
48
|
Requires-Dist: pytz
|
|
49
49
|
Requires-Dist: rasterio
|
|
50
50
|
Requires-Dist: rasterstats
|
|
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
|
|
File without changes
|
|
File without changes
|