diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..61fb7a8 --- /dev/null +++ b/404.html @@ -0,0 +1,797 @@ + + + +
+ + + + + + + + + + + + + + + + + + +
eo_tides.model
+
+
+¶Functions:
+Name | +Description | +
---|---|
list_models |
+
+
+
+ List all tide models available for tide modelling. + |
+
model_tides |
+
+
+
+ Model tide heights at multiple coordinates and/or timesteps + |
+
phase_tides |
+
+
+
+ Model tide phases (low-flow, high-flow, high-ebb, low-ebb) + |
+
list_models
+
+
+¶list_models(
+ directory=None,
+ show_available=True,
+ show_supported=True,
+ raise_error=False,
+)
+
List all tide models available for tide modelling.
+This function scans the specified tide model directory
+and returns a list of models that are available in the
+directory as well as the full list of all models supported
+by eo-tides
and pyTMD
.
For instructions on setting up tide models, see: +https://geoscienceaustralia.github.io/eo-tides/setup/
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ str
+ |
+
+
+
+ The directory containing tide model data files. If no path is
+provided, this will default to the environment variable
+ |
+
+ None
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to print a list of locally available models. + |
+
+ True
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to print a list of all supported models, in +addition to models available locally. + |
+
+ True
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ If True, raise an error if no available models are found. +If False, raise a warning. + |
+
+ False
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
available_models |
+ list of str
+ |
+
+
+
+ A list of all tide models available within |
+
supported_models |
+ list of str
+ |
+
+
+
+ A list of all tide models supported by |
+
eo_tides/model.py
72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 |
|
model_tides
+
+
+¶model_tides(
+ x,
+ y,
+ time,
+ model="EOT20",
+ directory=None,
+ crs="EPSG:4326",
+ crop=True,
+ method="spline",
+ extrapolate=True,
+ cutoff=None,
+ mode="one-to-many",
+ parallel=True,
+ parallel_splits=5,
+ output_units="m",
+ output_format="long",
+ ensemble_models=None,
+ **ensemble_kwargs
+)
+
Model tide heights at multiple coordinates and/or timesteps +using using one or more ocean tide models.
+This function is parallelised to improve performance, and
+supports all tidal models supported by pyTMD
, including:
This function requires access to tide model data files.
+These should be placed in a folder with subfolders matching
+the structure required by pyTMD
. For more details:
+https://geoscienceaustralia.github.io/eo-tides/setup/
+https://pytmd.readthedocs.io/en/latest/getting_started/Getting-Started.html#directories
This function is a modification of the pyTMD
package's
+pyTMD.compute.tide_elevations
function. For more info:
+https://pytmd.readthedocs.io/en/latest/api_reference/compute.html#pyTMD.compute.tide_elevations
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ float or list of float
+ |
+
+
+
+ One or more x and y coordinates used to define +the location at which to model tides. By default these +coordinates should be lat/lon; use "crs" if they +are in a custom coordinate reference system. + |
+ + required + | +
+ |
+
+ float or list of float
+ |
+
+
+
+ One or more x and y coordinates used to define +the location at which to model tides. By default these +coordinates should be lat/lon; use "crs" if they +are in a custom coordinate reference system. + |
+ + required + | +
+ |
+
+ Numpy datetime array or pandas.DatetimeIndex
+ |
+
+
+
+ An array containing |
+ + required + | +
+ |
+
+ str or list of str
+ |
+
+
+
+ The tide model (or models) to use to model tides.
+Defaults to "EOT20"; for a full list of available/supported
+models, run |
+
+ 'EOT20'
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The directory containing tide model data files. If no path is
+provided, this will default to the environment variable
+ |
+
+ None
+ |
+
+ |
+
+ str
+ |
+
+
+
+ Input coordinate reference system for x and y coordinates. +Defaults to "EPSG:4326" (WGS84; degrees latitude, longitude). + |
+
+ 'EPSG:4326'
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to crop tide model constituent files on-the-fly to +improve performance. Cropping will be performed based on a +1 degree buffer around all input points. Defaults to True. + |
+
+ True
+ |
+
+ |
+
+ str
+ |
+
+
+
+ Method used to interpolate tidal constituents +from model files. Options include: +
|
+
+ 'spline'
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to extrapolate tides for x and y coordinates outside of +the valid tide modelling domain using nearest-neighbor. + |
+
+ True
+ |
+
+ |
+
+ float
+ |
+
+
+
+ Extrapolation cutoff in kilometers. The default is None, which +will extrapolate for all points regardless of distance from the +valid tide modelling domain. + |
+
+ None
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The analysis mode to use for tide modelling. Supports two options: +
|
+
+ 'one-to-many'
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to parallelise tide modelling using |
+
+ True
+ |
+
+ |
+
+ int
+ |
+
+
+
+ Whether to split the input x and y coordinates into smaller, +evenly-sized chunks that are processed in parallel. This can +provide a large performance boost when processing large numbers +of coordinates. The default is 5 chunks, which will split +coordinates into 5 parallelised chunks. + |
+
+ 5
+ |
+
+ |
+
+ str
+ |
+
+
+
+ Whether to return modelled tides in floating point metre units, +or integer centimetre units (i.e. scaled by 100) or integer +millimetre units (i.e. scaled by 1000. Returning outputs in +integer units can be useful for reducing memory usage. +Defaults to "m" for metres; set to "cm" for centimetres or "mm" +for millimetres. + |
+
+ 'm'
+ |
+
+ |
+
+ str
+ |
+
+
+
+ Whether to return the output dataframe in long format (with +results stacked vertically along "tide_model" and "tide_height" +columns), or wide format (with a column for each tide model). +Defaults to "long". + |
+
+ 'long'
+ |
+
+ |
+
+ list of str
+ |
+
+
+
+ An optional list of models used to generate the ensemble tide +model if "ensemble" tide modelling is requested. Defaults to +["FES2014", "TPXO9-atlas-v5", "EOT20", "HAMTIDE11", "GOT4.10", +"FES2012", "TPXO8-atlas-v1"]. + |
+
+ None
+ |
+
+ |
+ + | +
+
+
+ Keyword arguments used to customise the generation of optional
+ensemble tide models if "ensemble" modelling are requested.
+These are passed to the underlying |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ DataFrame
+ |
+
+
+
+ A dataframe containing modelled tide heights. + |
+
eo_tides/model.py
487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 +804 +805 +806 +807 +808 |
|
phase_tides
+
+
+¶phase_tides(
+ x,
+ y,
+ time,
+ model="EOT20",
+ directory=None,
+ time_offset="15 min",
+ return_tides=False,
+ **model_tides_kwargs
+)
+
Model tide phases (low-flow, high-flow, high-ebb, low-ebb) +at multiple coordinates and/or timesteps using using one +or more ocean tide models.
+Ebb and low phases are calculated by running the
+eo_tides.model.model_tides
function twice, once for
+the requested timesteps, and again after subtracting a
+small time offset (by default, 15 minutes). If tides
+increased over this period, they are assigned as "flow";
+if they decreased, they are assigned as "ebb".
+Tides are considered "high" if equal or greater than 0
+metres tide height, otherwise "low".
This function supports all parameters that are supported
+by model_tides
.
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ float or list of float
+ |
+
+
+
+ One or more x and y coordinates used to define +the location at which to model tide phases. By default +these coordinates should be lat/lon; use "crs" if they +are in a custom coordinate reference system. + |
+ + required + | +
+ |
+
+ float or list of float
+ |
+
+
+
+ One or more x and y coordinates used to define +the location at which to model tide phases. By default +these coordinates should be lat/lon; use "crs" if they +are in a custom coordinate reference system. + |
+ + required + | +
+ |
+
+ Numpy datetime array or pandas.DatetimeIndex
+ |
+
+
+
+ An array containing |
+ + required + | +
+ |
+
+ str or list of str
+ |
+
+
+
+ The tide model (or models) to use to compute tide phases.
+Defaults to "EOT20"; for a full list of available/supported
+models, run |
+
+ 'EOT20'
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The directory containing tide model data files. If no path is
+provided, this will default to the environment variable
+ |
+
+ None
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The time offset/delta used to generate a time series of
+offset tide heights required for phase calculation. Defeaults
+to "15 min"; can be any string passed to |
+
+ '15 min'
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to return intermediate modelled tide heights as a +"tide_height" column in the output dataframe. Defaults to False. + |
+
+ False
+ |
+
+ |
+ + | +
+
+
+ Optional parameters passed to the |
+
+ {}
+ |
+
Returns:
+Type | +Description | +
---|---|
+ DataFrame
+ |
+
+
+
+ A dataframe containing modelled tide phases. + |
+
eo_tides/model.py
811 +812 +813 +814 +815 +816 +817 +818 +819 +820 +821 +822 +823 +824 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +835 +836 +837 +838 +839 +840 +841 +842 +843 +844 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +855 +856 +857 +858 +859 +860 +861 +862 +863 +864 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +875 +876 +877 +878 +879 +880 +881 +882 +883 +884 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +895 +896 +897 +898 +899 +900 +901 +902 +903 +904 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +915 +916 +917 +918 +919 +920 +921 +922 +923 +924 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +935 +936 +937 +938 +939 |
|
eo_tides.eo
+
+
+¶Functions:
+Name | +Description | +
---|---|
pixel_tides |
+
+
+
+ Model tide heights for every pixel in a multi-dimensional + |
+
tag_tides |
+
+
+
+ Model tide heights for every timestep in a multi-dimensional + |
+
pixel_tides
+
+
+¶pixel_tides(
+ data,
+ time=None,
+ model="EOT20",
+ directory=None,
+ resample=True,
+ calculate_quantiles=None,
+ resolution=None,
+ buffer=None,
+ resample_method="bilinear",
+ dask_chunks=None,
+ dask_compute=True,
+ **model_tides_kwargs
+)
+
Model tide heights for every pixel in a multi-dimensional +dataset, using one or more ocean tide models.
+This function models tides into a low-resolution tide +modelling grid covering the spatial extent of the input +data (buffered to reduce potential edge effects). These +modelled tides can then be resampled back into the original +higher resolution dataset's extent and resolution to +produce a modelled tide height for every pixel through time.
+This function uses the parallelised model_tides
function
+under the hood. It supports all tidal models supported by
+pyTMD
, including:
This function requires access to tide model data files.
+These should be placed in a folder with subfolders matching
+the structure required by pyTMD
. For more details:
+https://geoscienceaustralia.github.io/eo-tides/setup/
+https://pytmd.readthedocs.io/en/latest/getting_started/Getting-Started.html#directories
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ Dataset or DataArray or GeoBox
+ |
+
+
+
+ A multi-dimensional dataset or GeoBox pixel grid that will
+be used to define the spatial tide modelling grid. If |
+ + required + | +
+ |
+
+ pd.DatetimeIndex or list of pd.Timestamp
+ |
+
+
+
+ By default, the function will model tides using the times
+contained in the "time" dimension of |
+
+ None
+ |
+
+ |
+
+ str or list of str
+ |
+
+
+
+ The tide model (or models) used to model tides. If a list is
+provided, a new "tide_model" dimension will be added to the
+ |
+
+ 'EOT20'
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The directory containing tide model data files. If no path is
+provided, this will default to the environment variable
+ |
+
+ None
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to resample low resolution tides back into |
+
+ True
+ |
+
+ |
+
+ tuple of float or numpy.ndarray
+ |
+
+
+
+ Rather than returning all individual tides, low-resolution tides
+can be first aggregated using a quantile calculation by passing in
+a tuple or array of quantiles to compute. For example, this could
+be used to calculate the min/max tide across all times:
+ |
+
+ None
+ |
+
+ |
+
+ float
+ |
+
+
+
+ The desired resolution of the low-resolution grid used for tide
+modelling. The default None will create a 5000 m resolution grid
+if |
+
+ None
+ |
+
+ |
+
+ float
+ |
+
+
+
+ The amount by which to buffer the higher resolution grid extent
+when creating the new low resolution grid. This buffering
+ensures that modelled tides are seamless across analysis
+boundaries. This buffer is eventually be clipped away when
+the low-resolution modelled tides are re-projected back to the
+original resolution and extent of |
+
+ None
+ |
+
+ |
+
+ str
+ |
+
+
+
+ If resampling is requested (see |
+
+ 'bilinear'
+ |
+
+ |
+
+ tuple of float
+ |
+
+
+
+ Can be used to configure custom Dask chunking for the final
+resampling step. By default, chunks will be automatically set
+to match y/x chunks from |
+
+ None
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to compute results of the resampling step using Dask.
+If False, |
+
+ True
+ |
+
+ |
+ + | +
+
+
+ Optional parameters passed to the |
+
+ {}
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
tides_da |
+ DataArray
+ |
+
+
+
+ A three-dimensional tide height array.
+If |
+
eo_tides/eo.py
273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 |
|
tag_tides
+
+
+¶tag_tides(
+ data,
+ time=None,
+ model="EOT20",
+ directory=None,
+ tidepost_lat=None,
+ tidepost_lon=None,
+ **model_tides_kwargs
+)
+
Model tide heights for every timestep in a multi-dimensional
+dataset, and return a new tide_height
array that can
+be used to "tag" each observation with tide heights.
The function models tides at the centroid of the dataset
+by default, but a custom tidal modelling location can
+be specified using tidepost_lat
and tidepost_lon
.
This function uses the parallelised model_tides
function
+under the hood. It supports all tidal models supported by
+pyTMD
, including:
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ Dataset or DataArray or GeoBox
+ |
+
+
+
+ A multi-dimensional dataset or GeoBox pixel grid that will
+be used to define the tide modelling location. If |
+ + required + | +
+ |
+
+ pd.DatetimeIndex or list of pd.Timestamp
+ |
+
+
+
+ By default, the function will model tides using the times
+contained in the "time" dimension of |
+
+ None
+ |
+
+ |
+
+ str or list of str
+ |
+
+
+
+ The tide model (or models) used to model tides. If a list is
+provided, a new "tide_model" dimension will be added to the
+ |
+
+ 'EOT20'
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The directory containing tide model data files. If no path is
+provided, this will default to the environment variable
+ |
+
+ None
+ |
+
+ |
+
+ float
+ |
+
+
+
+ Optional coordinates used to model tides. The default is None, +which uses the centroid of the dataset as the tide modelling +location. + |
+
+ None
+ |
+
+ |
+
+ float
+ |
+
+
+
+ Optional coordinates used to model tides. The default is None, +which uses the centroid of the dataset as the tide modelling +location. + |
+
+ None
+ |
+
+ |
+ + | +
+
+
+ Optional parameters passed to the |
+
+ {}
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
tides_da |
+ DataArray
+ |
+
+
+
+ A one-dimensional tide height array. This will contain either
+tide heights for every timestep in |
+
eo_tides/eo.py
157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 |
|
eo_tides.stats
+
+
+¶Functions:
+Name | +Description | +
---|---|
pixel_stats |
+
+
+
+ Takes a multi-dimensional dataset and generate two-dimensional + |
+
tide_stats |
+
+
+
+ Takes a multi-dimensional dataset and generate tide statistics + |
+
pixel_stats
+
+
+¶pixel_stats(
+ data,
+ time=None,
+ model="EOT20",
+ directory=None,
+ resample=False,
+ modelled_freq="3h",
+ min_max_q=(0.0, 1.0),
+ extrapolate=True,
+ cutoff=10,
+ **pixel_tides_kwargs
+)
+
Takes a multi-dimensional dataset and generate two-dimensional +tide statistics and satellite-observed tide bias metrics, +calculated based on every timestep in the satellte data and +modelled into the spatial extent of the imagery.
+By comparing the subset of tides observed by satellites +against the full astronomical tidal range, we can evaluate +whether the tides observed by satellites are biased +(e.g. fail to observe either the highest or lowest tides).
+Compared to tide_stats
, this function models tide metrics
+spatially to produce a two-dimensional output.
For more information about the tidal statistics computed by this +function, refer to Figure 8 in Bishop-Taylor et al. 2018: +https://www.sciencedirect.com/science/article/pii/S0272771418308783#fig8
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ Dataset or DataArray or GeoBox
+ |
+
+
+
+ A multi-dimensional dataset or GeoBox pixel grid that will
+be used to calculate 2D tide statistics. If |
+ + required + | +
+ |
+
+ pd.DatetimeIndex or list of pd.Timestamp
+ |
+
+
+
+ By default, the function will model tides using the times
+contained in the "time" dimension of |
+
+ None
+ |
+
+ |
+
+ str or list of str
+ |
+
+
+
+ The tide model (or models) to use to model tides. If a list is
+provided, a new "tide_model" dimension will be added to |
+
+ 'EOT20'
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The directory containing tide model data files. If no path is
+provided, this will default to the environment variable
+ |
+
+ None
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to resample tide statistics back into |
+
+ False
+ |
+
+ |
+
+ str
+ |
+
+
+
+ An optional string giving the frequency at which to model tides
+when computing the full modelled tidal range. Defaults to '3h',
+which computes a tide height for every three hours across the
+temporal extent of |
+
+ '3h'
+ |
+
+ |
+
+ tuple
+ |
+
+
+
+ Quantiles used to calculate max and min observed and modelled
+astronomical tides. By default |
+
+ (0.0, 1.0)
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to extrapolate tides for x and y coordinates outside of +the valid tide modelling domain using nearest-neighbor. Defaults +to True. + |
+
+ True
+ |
+
+ |
+
+ float
+ |
+
+
+
+ Extrapolation cutoff in kilometers. To avoid producing tide +statistics too far inland, the default is 10 km. + |
+
+ 10
+ |
+
+ |
+ + | +
+
+
+ Optional parameters passed to the |
+
+ {}
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
stats_ds |
+ Dataset
+ |
+
+
+
+ An
|
+
eo_tides/stats.py
408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 |
|
tide_stats
+
+
+¶tide_stats(
+ data,
+ time=None,
+ model="EOT20",
+ directory=None,
+ tidepost_lat=None,
+ tidepost_lon=None,
+ plain_english=True,
+ plot=True,
+ plot_col=None,
+ modelled_freq="3h",
+ linear_reg=False,
+ min_max_q=(0.0, 1.0),
+ round_stats=3,
+ **model_tides_kwargs
+)
+
Takes a multi-dimensional dataset and generate tide statistics +and satellite-observed tide bias metrics, calculated based on +every timestep in the satellte data and the geographic centroid +of the imagery.
+By comparing the subset of tides observed by satellites +against the full astronomical tidal range, we can evaluate +whether the tides observed by satellites are biased +(e.g. fail to observe either the highest or lowest tides).
+For more information about the tidal statistics computed by this +function, refer to Figure 8 in Bishop-Taylor et al. 2018: +https://www.sciencedirect.com/science/article/pii/S0272771418308783#fig8
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ Dataset or DataArray or GeoBox
+ |
+
+
+
+ A multi-dimensional dataset or GeoBox pixel grid that will
+be used to calculate tide statistics. If |
+ + required + | +
+ |
+
+ pd.DatetimeIndex or list of pd.Timestamp
+ |
+
+
+
+ By default, the function will model tides using the times
+contained in the "time" dimension of |
+
+ None
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The tide model to use to model tides. Defaults to "EOT20";
+for a full list of available/supported models, run
+ |
+
+ 'EOT20'
+ |
+
+ |
+
+ str
+ |
+
+
+
+ The directory containing tide model data files. If no path is
+provided, this will default to the environment variable
+ |
+
+ None
+ |
+
+ |
+
+ float or int
+ |
+
+
+
+ Optional coordinates used to model tides. The default is None, +which uses the centroid of the dataset as the tide modelling +location. + |
+
+ None
+ |
+
+ |
+
+ float or int
+ |
+
+
+
+ Optional coordinates used to model tides. The default is None, +which uses the centroid of the dataset as the tide modelling +location. + |
+
+ None
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ An optional boolean indicating whether to print a plain english +version of the tidal statistics to the screen. Defaults to True. + |
+
+ True
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ An optional boolean indicating whether to plot how satellite- +observed tide heights compare against the full tidal range. +Defaults to True. + |
+
+ True
+ |
+
+ |
+
+ str
+ |
+
+
+
+ Optional name of a coordinate, dimension or variable in the array +that will be used to plot observations with unique symbols. +Defaults to None, which will plot all observations as circles. + |
+
+ None
+ |
+
+ |
+
+ str
+ |
+
+
+
+ An optional string giving the frequency at which to model tides
+when computing the full modelled tidal range. Defaults to '3h',
+which computes a tide height for every three hours across the
+temporal extent of |
+
+ '3h'
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to return linear regression statistics that assess +whether satellite-observed tides show any decreasing or +increasing trends over time. This may indicate whether your +satellite data may produce misleading trends based on uneven +sampling of the local tide regime. + |
+
+ False
+ |
+
+ |
+
+ tuple
+ |
+
+
+
+ Quantiles used to calculate max and min observed and modelled
+astronomical tides. By default |
+
+ (0.0, 1.0)
+ |
+
+ |
+
+ int
+ |
+
+
+
+ The number of decimal places used to round the output statistics. +Defaults to 3. + |
+
+ 3
+ |
+
+ |
+ + | +
+
+
+ Optional parameters passed to the |
+
+ {}
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
stats_df |
+ Series
+ |
+
+
+
+ A
If
|
+
eo_tides/stats.py
139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 |
|
eo_tides.validation
+
+
+¶Functions:
+Name | +Description | +
---|---|
eval_metrics |
+
+
+
+ Calculate a set of common statistical metrics + |
+
load_gauge_gesla |
+
+
+
+ Load and process all available Global Extreme Sea Level Analysis + |
+
eval_metrics
+
+
+¶Calculate a set of common statistical metrics +based on two input actual and predicted vectors.
+These include:
+Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ array
+ |
+
+
+
+ An array providing "actual" variable values. + |
+ + required + | +
+ |
+
+ array
+ |
+
+
+
+ An array providing "predicted" variable values. + |
+ + required + | +
+ |
+
+ int
+ |
+
+
+
+ Number of decimal places to round each metric +to. Defaults to 3. + |
+
+ 3
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to return linear regression p-value, +intercept and standard error (in addition to +only regression slope). Defaults to False. + |
+
+ False
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Series
+ |
+
+
+
+ A |
+
eo_tides/validation.py
load_gauge_gesla
+
+
+¶load_gauge_gesla(
+ x=None,
+ y=None,
+ site_code=None,
+ time=("2018", "2020"),
+ max_distance=None,
+ correct_mean=False,
+ filter_use_flag=True,
+ site_metadata=True,
+ data_path="/gdata1/data/sea_level/gesla/",
+ metadata_path="/gdata1/data/sea_level/GESLA3_ALL 2.csv",
+)
+
Load and process all available Global Extreme Sea Level Analysis
+(GESLA) tide gauge data with an x, y, time
spatiotemporal query,
+or from a list of specific tide gauges.
Can optionally filter by gauge quality and append detailed gauge metadata.
+Modified from original code in https://github.com/philiprt/GeslaDataset.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ numeric or list / tuple
+ |
+
+
+
+ Coordinates (in degrees longitude, latitude) used to load GESLA
+tide gauge observations. If provided as singular values
+(e.g. |
+
+ None
+ |
+
+ |
+
+ numeric or list / tuple
+ |
+
+
+
+ Coordinates (in degrees longitude, latitude) used to load GESLA
+tide gauge observations. If provided as singular values
+(e.g. |
+
+ None
+ |
+
+ |
+
+ str or list of str
+ |
+
+
+
+ GESLA site code(s) for which to load data (e.g. |
+
+ None
+ |
+
+ |
+
+ tuple or list of str
+ |
+
+
+
+ Time range to consider, given as a tuple of start and end dates,
+e.g. |
+
+ ('2018', '2020')
+ |
+
+ |
+
+ numeric
+ |
+
+
+
+ Optional max distance within which to return the nearest tide gauge
+when |
+
+ None
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to correct sea level measurements to a standardised mean +sea level by subtracting the mean of all observed sea level +observations. This can be useful when GESLA tide heights come +from different or unknown tide datums. Note: the observed mean +sea level calculated here may differ from true long-term/ +astronomical Mean Sea Level (MSL) datum. + |
+
+ False
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to filter out low quality observations with a "use_flag" +value of 0 (do not use). Defaults to True. + |
+
+ True
+ |
+
+ |
+
+ bool
+ |
+
+
+
+ Whether to add tide gauge station metadata as additional columns +in the output DataFrame. Defaults to True. + |
+
+ True
+ |
+
+ |
+
+ str
+ |
+
+
+
+ Path to the raw GESLA data files. Default is
+ |
+
+ '/gdata1/data/sea_level/gesla/'
+ |
+
+ |
+
+ str
+ |
+
+
+
+ Path to the GESLA station metadata file.
+Default is |
+
+ '/gdata1/data/sea_level/GESLA3_ALL 2.csv'
+ |
+
Returns:
+Type | +Description | +
---|---|
+ DataFrame
+ |
+
+
+
+ Processed GESLA data as a DataFrame with columns including: +
...and additional columns from station metadata. + |
+
eo_tides/validation.py
183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 |
|
eo_tides.utils
+
+
+¶Functions:
+Name | +Description | +
---|---|
idw |
+
+
+
+ Perform Inverse Distance Weighting (IDW) interpolation. + |
+
idw
+
+
+¶idw(
+ input_z,
+ input_x,
+ input_y,
+ output_x,
+ output_y,
+ p=1,
+ k=10,
+ max_dist=None,
+ k_min=1,
+ epsilon=1e-12,
+)
+
Perform Inverse Distance Weighting (IDW) interpolation.
+This function performs fast IDW interpolation by creating a KDTree
+from the input coordinates then uses it to find the k
nearest
+neighbors for each output point. Weights are calculated based on the
+inverse distance to each neighbor, with weights descreasing with
+increasing distance.
Code inspired by: https://github.com/DahnJ/REM-xarray
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
+ |
+
+ array - like
+ |
+
+
+
+ Array of values at the input points. This can be either a +1-dimensional array, or a 2-dimensional array where each column +(axis=1) represents a different set of values to be interpolated. + |
+ + required + | +
+ |
+
+ array - like
+ |
+
+
+
+ Array of x-coordinates of the input points. + |
+ + required + | +
+ |
+
+ array - like
+ |
+
+
+
+ Array of y-coordinates of the input points. + |
+ + required + | +
+ |
+
+ array - like
+ |
+
+
+
+ Array of x-coordinates where the interpolation is to be computed. + |
+ + required + | +
+ |
+
+ array - like
+ |
+
+
+
+ Array of y-coordinates where the interpolation is to be computed. + |
+ + required + | +
+ |
+
+ int or float
+ |
+
+
+
+ Power function parameter defining how rapidly weightings should
+decrease as distance increases. Higher values of |
+
+ 1
+ |
+
+ |
+
+ int
+ |
+
+
+
+ Number of nearest neighbors to use for interpolation. |
+
+ 10
+ |
+
+ |
+
+ int or float
+ |
+
+
+
+ Restrict neighbouring points to less than this distance. +By default, no distance limit is applied. + |
+
+ None
+ |
+
+ |
+
+ int
+ |
+
+
+
+ If |
+
+ 1
+ |
+
+ |
+
+ float
+ |
+
+
+
+ Small value added to distances to prevent division by zero +errors in the case that output coordinates are identical to +input coordinates. Defaults to 1e-12. + |
+
+ 1e-12
+ |
+
Returns:
+Name | Type | +Description | +
---|---|---|
interp_values |
+ ndarray
+ |
+
+
+
+ Interpolated values at the output coordinates. If |
+
Examples:
+>>> input_z = [1, 2, 3, 4, 5]
+>>> input_x = [0, 1, 2, 3, 4]
+>>> input_y = [0, 1, 2, 3, 4]
+>>> output_x = [0.5, 1.5, 2.5]
+>>> output_y = [0.5, 1.5, 2.5]
+>>> idw(input_z, input_x, input_y, output_x, output_y, k=2)
+array([1.5, 2.5, 3.5])
+
eo_tides/utils.py
5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 |
|