Skip to content

Commit

Permalink
Merge pull request #1246 from GeoscienceAustralia/intertidal_ows_updates
Browse files Browse the repository at this point in the history
Add DEA Intertidal adaptive uncertainty layer
  • Loading branch information
vnewey authored Mar 19, 2024
2 parents 583e1f9 + d2e68e6 commit f464c04
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 12 deletions.
3 changes: 2 additions & 1 deletion dev/services/wms/inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,14 @@
"product": [
"ga_s2ls_intertidal_cyear_3"
],
"styles_count": 7,
"styles_count": 8,
"styles_list": [
"intertidal_elevation",
"intertidal_elevation_micro",
"intertidal_elevation_macro",
"intertidal_elevation_adaptive",
"intertidal_elevation_uncertainty",
"intertidal_elevation_uncertainty_adaptive",
"intertidal_exposure",
"intertidal_extents"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

style_intertidal_elevation = {
"name": "intertidal_elevation",
"title": "Elevation",
"title": "Elevation (mesotidal)",
"abstract": "Intertidal elevation in metres above Mean Sea Level",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
Expand All @@ -43,7 +43,7 @@

style_intertidal_elevation_micro = {
"name": "intertidal_elevation_micro",
"title": "Elevation (microtidal style)",
"title": "Elevation (microtidal)",
"abstract": "Intertidal elevation in metres above Mean Sea Level",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
Expand All @@ -70,7 +70,7 @@

style_intertidal_elevation_macro = {
"name": "intertidal_elevation_macro",
"title": "Elevation (macrotidal style)",
"title": "Elevation (macrotidal)",
"abstract": "Intertidal elevation in metres above Mean Sea Level",
"index_function": {
"function": "datacube_ows.band_utils.single_band",
Expand Down Expand Up @@ -199,7 +199,7 @@

style_intertidal_elevation_adaptive = {
"name": "intertidal_elevation_adaptive",
"title": "Elevation (experimental adaptive style)",
"title": "Elevation (adaptive)",
"abstract": "Intertidal elevation in metres above Mean Sea Level",
"index_function": {
"function": "ows_refactored.sea_ocean_coast.intertidal_c3.utils_intertidal.elevation_adaptive",
Expand All @@ -213,16 +213,44 @@
"include_in_feature_info": False,
"needed_bands": ["elevation", "ta_lot", "ta_hot"],
"mpl_ramp": "viridis",
"range": [0.05, 0.7],
"range": [0.1, 0.7],
"legend": {
"begin": "0.0",
"end": "1.0",
"ticks": ["0.0", "0.5", "1.0"],
"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 (adaptive)",
"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.1, 0.3],
"legend": {
"begin": "0.1",
"end": "0.3",
"ticks": ["0.1", "0.3"],
"units": "",
"tick_labels": {
"0.0": {"label": "Low"},
"0.5": {"label": ""},
"1.0": {"label": "High"},
"0.1": {"label": "Low"},
"0.3": {"label": "High"},
},
},
}
Expand All @@ -234,6 +262,7 @@
style_intertidal_elevation_macro,
style_intertidal_elevation_adaptive,
style_intertidal_elevation_uncertainty,
style_intertidal_elevation_uncertainty_adaptive,
style_intertidal_exposure,
style_intertidal_extents,
]
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ def elevation_adaptive(data, band, lot, hot, band_mapper=None):
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

0 comments on commit f464c04

Please sign in to comment.