dea_tools.coastal

Coastal and intertidal analysis tools.

License: The code in this notebook is licensed under the Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0). Digital Earth Australia data is licensed under the Creative Commons by Attribution 4.0 license (https://creativecommons.org/licenses/by/4.0/).

Contact: If you need assistance, post a question on the Open Data Cube Discord chat (https://discord.com/invite/4hhBQVas5U) or the GIS Stack Exchange (https://gis.stackexchange.com/questions/ask?tags=open-data-cube) using the open-data-cube tag (you can view previously asked questions here: https://gis.stackexchange.com/questions/tagged/open-data-cube).

If you would like to report an issue with this script, you can file one on GitHub (GeoscienceAustralia/dea-notebooks#new).

Last modified: July 2024

Functions

get_coastlines(bbox[, crs, layer, drop_wms])

Load DEA Coastlines annual shorelines or rates of change points data for a provided bounding box using WFS.

glint_angle(solar_azimuth, solar_zenith, ...)

Calculates glint angles for each pixel in a satellite image based on the relationship between the solar and sensor zenith and azimuth viewing angles at the moment the image was acquired.

model_tides(*args, **kwargs)

pixel_tides(*args, **kwargs)

tidal_stats(*args, **kwargs)

tidal_stats_otps(*args, **kwargs)

tidal_tag(*args, **kwargs)

tidal_tag_otps(*args, **kwargs)

transect_distances(transects_gdf, lines_gdf)

Take a set of transects (e.g. shore-normal beach survey lines), and determine the distance along the transect to each object in a set of lines (e.g. shorelines).

dea_tools.coastal.get_coastlines(bbox: tuple, crs='EPSG:4326', layer='shorelines_annual', drop_wms=True) geopandas.GeoDataFrame[source]

Load DEA Coastlines annual shorelines or rates of change points data for a provided bounding box using WFS.

For a full description of the DEA Coastlines dataset, refer to the official Geoscience Australia product description: /data/product/dea-coastlines

Parameters:
  • bbox ((xmin, ymin, xmax, ymax), or geopandas object) – Bounding box expressed as a tutple. Alternatively, a bounding box can be automatically extracted by suppling a geopandas.GeoDataFrame or geopandas.GeoSeries.

  • crs (str, optional) – Optional CRS for the bounding box. This is ignored if bbox is provided as a geopandas object.

  • layer (str, optional) – Which DEA Coastlines layer to load. Options include the annual shoreline vectors (“shorelines_annual”) and the rates of change points (“rates_of_change”). Defaults to “shorelines_annual”.

  • drop_wms (bool, optional) – Whether to drop WMS-specific attribute columns from the data. These columns are used for visualising the dataset on DEA Maps, and are unlikely to be useful for scientific analysis. Defaults to True.

Returns:

A GeoDataFrame containing shoreline or point features and associated metadata.

Return type:

gpd.GeoDataFrame

dea_tools.coastal.glint_angle(solar_azimuth, solar_zenith, view_azimuth, view_zenith)[source]

Calculates glint angles for each pixel in a satellite image based on the relationship between the solar and sensor zenith and azimuth viewing angles at the moment the image was acquired.

Glint angle is considered a predictor of sunglint over water; small glint angles (e.g. < 20 degrees) are associated with a high probability of sunglint due to the viewing angle of the sensor being aligned with specular reflectance of the sun from the water’s surface.

Based on code from https://towardsdatascience.com/how-to-implement- sunglint-detection-for-sentinel-2-images-in-python-using-metadata- info-155e683d50

Parameters:
  • solar_azimuth (array-like) – Array of solar azimuth angles in degrees. In DEA Collection 3, this is contained in the “oa_solar_azimuth” band.

  • solar_zenith (array-like) – Array of solar zenith angles in degrees. In DEA Collection 3, this is contained in the “oa_solar_zenith” band.

  • view_azimuth (array-like) – Array of sensor/viewing azimuth angles in degrees. In DEA Collection 3, this is contained in the “oa_satellite_azimuth” band.

  • view_zenith (array-like) – Array of sensor/viewing zenith angles in degrees. In DEA Collection 3, this is contained in the “oa_satellite_view” band.

Returns:

glint_array – Array of glint angles in degrees. Small values indicate higher probabilities of sunglint.

Return type:

numpy.ndarray

dea_tools.coastal.transect_distances(transects_gdf, lines_gdf, mode='distance')[source]

Take a set of transects (e.g. shore-normal beach survey lines), and determine the distance along the transect to each object in a set of lines (e.g. shorelines). Distances are measured in the CRS of the input datasets.

For coastal applications, transects should be drawn from land to water (with the first point being on land so that it can be used as a consistent location from which to measure distances.

The distance calculation can be performed using two modes:
  • ‘distance’: Distances are measured from the start of the transect to where it intersects with each line. Any transect that intersects a line more than once is ignored. This mode is useful for measuring e.g. the distance to the shoreline over time from a consistent starting location.

  • ‘width’ Distances are measured between the first and last intersection between a transect and each line. Any transect that intersects a line only once is ignored. This is useful for e.g. measuring the width of a narrow area of coastline over time, e.g. the neck of a spit or tombolo.

Parameters:
  • transects_gdf (geopandas.GeoDataFrame) – A GeoDataFrame containing one or multiple vector profile lines. The GeoDataFrame’s index column will be used to name the rows in the output distance table.

  • lines_gdf (geopandas.GeoDataFrame) – A GeoDataFrame containing one or multiple vector line features that intersect the profile lines supplied to transects_gdf. The GeoDataFrame’s index column will be used to name the columns in the output distance table.

  • mode (string, optional) – Whether to use ‘distance’ (for measuring distances from the start of a profile) or ‘width’ mode (for measuring the width between two profile intersections). See docstring above for more info; defaults to ‘distance’.

Returns:

distance_df – A DataFrame containing distance measurements for each profile line (rows) and line feature (columns).

Return type:

pandas.DataFrame