Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prod OWS DEA Intertidal layer #1253

Merged
merged 4 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 114 additions & 109 deletions dev/terria/terria-cube-v8.json

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion prod/services/wms/inventory.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"total_layers_count": 64,
"total_layers_count": 65,
"layers": [
{
"layer": "s2_ls_combined",
Expand Down Expand Up @@ -579,6 +579,18 @@
"annual_wofs_clear_3"
]
},
{
"layer": "ga_s2ls_intertidal_cyear_3",
"product": [
"ga_s2ls_intertidal_cyear_3"
],
"styles_count": 3,
"styles_list": [
"intertidal_elevation_adaptive",
"intertidal_elevation_uncertainty_adaptive",
"intertidal_exposure"
]
},
{
"layer": "ITEM_V2.0.0",
"product": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
from ows_refactored.ows_reslim_cfg import reslim_standard
from ows_refactored.sea_ocean_coast.intertidal_c3.style_intertidal_cfg import \
styles_intertidal_list

bands_intertidal = {
"elevation": [],
"elevation_uncertainty": [],
"exposure": [],
"ta_hat": [],
"ta_hot": [],
"ta_lat": [],
"ta_lot": [],
"ta_offset_high": [],
"ta_offset_low": [],
"ta_spread": [],
"qa_ndwi_corr": [],
"qa_ndwi_freq": [],
}

abstract_intertidal = """Geoscience Australia Sentinel-2 Landsat Intertidal Calendar Year Collection 3

The DEA Intertidal product suite maps the changing extent, elevation and topography of Australia's exposed intertidal zone, the complex zone that defines the interface between land and sea.

Incorporating both Sentinel-2 and Landsat data, the product suite provides an annual 10 m resolution elevation product for the intertidal zone, enabling users to better monitor and understand some of the most dynamic regions of Australia’s coastlines. Utilising an improved tidal modelling capability, the product suite includes a continental scale mapping of intertidal exposure over time, enabling scientists and managers to integrate the data into ecological and migratory species applications and modelling.

https://knowledge.dea.ga.gov.au/data/product/dea-intertidal/

For service status information, see https://status.dea.ga.gov.au"""

dea_intertidal_layer = {
"title": "DEA Intertidal (Sentinel-2, Landsat)",
"name": "ga_s2ls_intertidal_cyear_3",
"abstract": abstract_intertidal,
"product_name": "ga_s2ls_intertidal_cyear_3",
"bands": bands_intertidal,
"time_resolution": "summary",
"resource_limits": reslim_standard,
"native_crs": "EPSG:3577",
"native_resolution": [10, -10],
"image_processing": {
"extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
"always_fetch_bands": [],
"manual_merge": False,
},
"styling": {
"default_style": "intertidal_elevation_adaptive",
"styles": styles_intertidal_list,
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
legend_intertidal_percentage_by_20 = {
"begin": "0.0",
"end": "100",
"decimal_places": 1,
"ticks_every": "20",
"units": "%",
"tick_labels": {
"0": {"label": "0"},
"20": {"label": "20"},
"40": {"label": "40"},
"60": {"label": "60"},
"80": {"label": "80"},
"100": {"label": "100"},
},
}

style_intertidal_elevation_meso = {
"name": "intertidal_elevation_meso",
"title": "Elevation (mesotidal)",
"abstract": "Intertidal elevation in metres above Mean Sea Level",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
"mapped_bands": True,
"kwargs": {
"band": "elevation",
},
},
"include_in_feature_info": False,
"needed_bands": ["elevation"],
"mpl_ramp": "viridis",
"range": [-2.0, 1.0],
"legend": {
"begin": "-2.0",
"end": "1.0",
"ticks": ["-2.0", "-1.0", "0.0", "1.0"],
"units": "metres above Mean Sea Level",
"tick_labels": {
"1.0": {"prefix": ">"},
"-2.0": {"prefix": "<"},
},
},
}

style_intertidal_elevation_micro = {
"name": "intertidal_elevation_micro",
"title": "Elevation (microtidal)",
"abstract": "Intertidal elevation in metres above Mean Sea Level",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
"mapped_bands": True,
"kwargs": {
"band": "elevation",
},
},
"include_in_feature_info": False,
"needed_bands": ["elevation"],
"mpl_ramp": "viridis",
"range": [-1.0, 0.5],
"legend": {
"begin": "-1.0",
"end": "0.5",
"ticks": ["-1.0", "-0.5", "0.0", "0.5"],
"units": "metres above Mean Sea Level",
"tick_labels": {
"0.5": {"prefix": ">"},
"-1.0": {"prefix": "<"},
},
},
}

style_intertidal_elevation_macro = {
"name": "intertidal_elevation_macro",
"title": "Elevation (macrotidal)",
"abstract": "Intertidal elevation in metres above Mean Sea Level",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
"mapped_bands": True,
"kwargs": {
"band": "elevation",
},
},
"include_in_feature_info": False,
"needed_bands": ["elevation"],
"mpl_ramp": "viridis",
"range": [-4.0, 2.0],
"legend": {
"begin": "-4.0",
"end": "2.0",
"ticks": ["-4.0", "-2.0", "0.0", "2.0"],
"units": "metres above Mean Sea Level",
"tick_labels": {
"2.0": {"prefix": ">"},
"-4.0": {"prefix": "<"},
},
},
}

style_intertidal_elevation_uncertainty = {
"name": "intertidal_elevation_uncertainty",
"title": "Elevation uncertainty",
"abstract": "Intertidal elevation uncertainty in metres",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
"mapped_bands": True,
"kwargs": {
"band": "elevation_uncertainty",
},
},
"include_in_feature_info": False,
"needed_bands": ["elevation_uncertainty"],
"mpl_ramp": "inferno",
"range": [0.0, 1.0],
"legend": {
"begin": "0.0",
"end": "1.0",
"ticks": ["0.0", "0.5", "1.0"],
"units": "metres",
"tick_labels": {
"1.0": {"prefix": ">"},
},
},
}

style_intertidal_exposure = {
"name": "intertidal_exposure",
"title": "Exposure",
"abstract": "Intertidal exposure in percent of time exposed to air",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
"mapped_bands": True,
"kwargs": {
"band": "exposure",
},
},
"include_in_feature_info": False,
"needed_bands": ["exposure"],
"color_ramp": [
{"value": 0, "color": '#2f0f3d'},
{'value': 10, 'color': '#4f1552'},
{'value': 20, 'color': '#72195f'},
{'value': 30, 'color': '#931f63'},
{'value': 40, 'color': '#b32e5e'},
{'value': 50, 'color': '#ce4356'},
{'value': 60, 'color': '#e26152'},
{'value': 70, 'color': '#ee845d'},
{'value': 80, 'color': '#f5a672'},
{'value': 90, 'color': '#faca8f'},
{'value': 100, 'color': '#fdedb0'}
],
"legend": legend_intertidal_percentage_by_20,
}

style_intertidal_elevation_adaptive = {
"name": "intertidal_elevation_adaptive",
"title": "Elevation",
"abstract": "Intertidal elevation in metres above Mean Sea Level",
"index_function": {
"function": "ows_refactored.sea_ocean_coast.intertidal_c3.utils_intertidal.elevation_adaptive",
"mapped_bands": True,
"kwargs": {
"band": "elevation",
"lot": "ta_lot",
"hot": "ta_hot",
},
},
"include_in_feature_info": False,
"needed_bands": ["elevation", "ta_lot", "ta_hot"],
"mpl_ramp": "viridis",
"range": [0.1, 0.7],
"legend": {
"begin": "0.1",
"end": "0.7",
"ticks": ["0.1", "0.7"],
"units": "",
"tick_labels": {
"0.1": {"label": "Low"},
"0.7": {"label": "High"},
},
},
}

style_intertidal_elevation_uncertainty_adaptive = {
"name": "intertidal_elevation_uncertainty_adaptive",
"title": "Elevation uncertainty",
"abstract": "Intertidal elevation uncertainty",
"index_function": {
"function": "ows_refactored.sea_ocean_coast.intertidal_c3.utils_intertidal.uncertainty_adaptive",
"mapped_bands": True,
"kwargs": {
"band": "elevation_uncertainty",
"lot": "ta_lot",
"hot": "ta_hot",
},
},
"include_in_feature_info": False,
"needed_bands": ["elevation_uncertainty", "ta_lot", "ta_hot"],
"mpl_ramp": "inferno",
"range": [0.0, 0.3],
"legend": {
"begin": "0.0",
"end": "0.3",
"ticks": ["0.0", "0.3"],
"units": "",
"tick_labels": {
"0.0": {"label": "Low"},
"0.3": {"label": "High"},
},
},
}

style_intertidal_corr = {
"name": "intertidal_corr",
"title": "NDWI tide correlation",
"abstract": "Correlation between NDWI and tide height",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
"mapped_bands": True,
"kwargs": {
"band": "qa_ndwi_corr",
},
},
"include_in_feature_info": False,
"needed_bands": ["qa_ndwi_corr"],
"mpl_ramp": "RdBu",
"range": [-0.5, 0.5],
"legend": {
"begin": "-0.5",
"end": "0.5",
"ticks": ["-0.5", "0.0", "0.5"],
"units": "correlation",
},
}

style_intertidal_freq = {
"name": "intertidal_freq",
"title": "NDWI frequency",
"abstract": "NDWI inundation frequency",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
"mapped_bands": True,
"kwargs": {
"band": "qa_ndwi_freq",
},
},
"include_in_feature_info": False,
"needed_bands": ["qa_ndwi_freq"],
"mpl_ramp": "RdBu",
"range": [0, 100],
"legend": legend_intertidal_percentage_by_20,
}

# Create combined list that is imported and passed to the layer
styles_intertidal_list = [
style_intertidal_elevation_adaptive,
style_intertidal_elevation_uncertainty_adaptive,
style_intertidal_exposure,
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from datacube_ows.band_utils import scalable


@scalable
def elevation_adaptive(data, band, lot, hot, band_mapper=None):
"""
Experimental adaptive elevation function, using pixel-level
tide metadata to calculate relative elevation for any
given location.

This implementation should be free of any tile-based
discontinuities in the resulting visualisation.

# TODO: Add hillshading
"""

# Calculate observed tide range (max - min)
otr = data[hot] - data[lot]

# Calculate distance between elevation and minumum
# observed tide height
distance_to_min = data[band] - data[lot]

# Calculate proportion along observed tide range
proportion_array = distance_to_min / otr

return proportion_array


@scalable
def uncertainty_adaptive(data, band, lot, hot, band_mapper=None):
"""
Experimental adaptive elevation uncertainty function, using
pixel-level tide metadata to calculate relative uncertainty.
"""

# Calculate observed tide range (max - min)
otr = data[hot] - data[lot]

# Calculate proportion
proportion_array = data[band] / otr

return proportion_array
Loading
Loading