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

Add difference functionality to DEA Intertidal on prod/DEA Maps #1283

Merged
merged 5 commits into from
Sep 2, 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
2 changes: 1 addition & 1 deletion .github/workflows/terria_preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
**Terria Cube preview:**
https://terria-cube.terria.io/#clean&https://raw.githubusercontent.com/GeoscienceAustralia/dea-config/${{ github.head_ref }}/dev/terria/terria-cube-v8.json

<img align="left" width="128" height="48" src="https://knowledge.dea.ga.gov.au/_images/dea-logo-inline.svg" alt="DEA Maps">
<img align="left" width="128" height="48" src="https://raw.githubusercontent.com/GeoscienceAustralia/dea-config/master/_static/dea-logo-small.png" alt="DEA Maps">

**DEA Maps preview:**
https://maps.dea.ga.gov.au/#clean&https://raw.githubusercontent.com/GeoscienceAustralia/dea-config/${{ github.head_ref }}/prod/terria/dea-maps-v8.json
Binary file added _static/dea-logo-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,34 @@
"hot": "ta_hot",
},
},
"multi_date": [
{
"allowed_count_range": [2, 2],
"animate": False,
"preserve_user_date_order": True,
"pass_raw_data": True,
"aggregator_function": {
"function": "ows_refactored.sea_ocean_coast.intertidal_c3.utils_intertidal.multi_date_raw_elevation",
"mapped_bands": True,
"kwargs": {
"band": "elevation",
}
},
"mpl_ramp": "RdBu",
"range": [-0.5, 0.5],
"legend": {
"title": "Elevation change (metres)",
"begin": "-0.5",
"end": "0.5",
"ticks": [
"-0.5",
"0.0",
"0.5",
]
},
"feature_info_label": "elevation_difference",
},
],
"include_in_feature_info": False,
"needed_bands": ["elevation", "ta_lot", "ta_hot"],
"mpl_ramp": "viridis",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,15 @@ def uncertainty_adaptive(data, band, lot, hot, band_mapper=None):
proportion_array = data[band] / otr

return proportion_array


def multi_date_raw_elevation(data, band, band_mapper=None):
"""
Compares two elevation layers and calculates difference in elevation.
"""
if band_mapper is not None:
band = band_mapper(band)

data1, data2 = (data.sel(time=dt) for dt in data.coords["time"].values)

return data2[band] - data1[band]
8 changes: 7 additions & 1 deletion prod/terria/dea-maps-v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -1150,13 +1150,19 @@
"linkedWcsUrl": "https://ows.dea.ga.gov.au/",
"linkedWcsCoverage": "ga_s2ls_intertidal_cyear_3",
"dateFormat": "'Year: 'yyyy",
"availableDiffStyles": ["intertidal_elevation_adaptive"],
"leafletUpdateInterval": 750,
"tileErrorHandlingOptions": {
"ignoreUnknownTileErrors": true
},
"shortReport": "<small>For more information and to download data, visit the <a href='https://knowledge.dea.ga.gov.au/data/product/dea-intertidal/'>DEA Intertidal product description</a></small>",
"diffItemProperties": {
"featureInfoTemplate": {
"template": "<div style='width:510px'><h1 style='font-weight:normal'>Digital Earth Australia Intertidal</h1>Elevation differences are shown for pixels with data in both timesteps only.<br><br>Intertidal elevation in {{data.0.time}}: <h1 style='font-weight:normal'><b>{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.elevation}}{{/terria.formatNumber}} metres (± {{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.elevation_uncertainty}}{{/terria.formatNumber}})</b></h1>Intertidal elevation in {{data.1.time}}: <h1 style='font-weight:normal'><b>{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.1.bands.elevation}}{{/terria.formatNumber}} metres (± {{#terria.formatNumber}}{maximumFractionDigits:2}{{data.1.bands.elevation_uncertainty}}{{/terria.formatNumber}})</b></h1><hr><br><small>For more information about intertidal mapping accuracy and limitations and data access options, visit the <a href='https://knowledge.dea.ga.gov.au/data/product/dea-intertidal/'>DEA Intertidal product description.</a></small><br/><br/></div>"
}
},
"featureInfoTemplate": {
"template": "<div style='width:510px'><h1 style='font-weight:normal'>Digital Earth Australia Intertidal</h1>This location had an elevation above modelled Mean Sea Level (MSL): <h1 style='font-weight:normal'><b>{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.elevation}}{{/terria.formatNumber}} metres (± {{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.elevation_uncertainty}}{{/terria.formatNumber}})</b></h1>It was exposed from tidal inundation for: <h2 style='font-weight:normal'><b>{{data.0.bands.exposure}}%</b> of the <b>{{#terria.formatDateTime}}{format: \"yyyy\"}{{data.0.time}}{{/terria.formatDateTime}}</b> analysis period</h2><hr><br>Mapped intertidal extents can be affected by biases in the tidal conditions observed by satellites<a href='https://knowledge.dea.ga.gov.au/data/product/dea-intertidal/?tab=details#tidal-attribute-layers-ta'></a>. At this location, satellites observed the coastline at tide heights ranging from <b>{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.ta_lot}}{{/terria.formatNumber}}</b> to <b>+{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.ta_hot}}{{/terria.formatNumber}}</b> metres above MSL, compared to the full astronomical tide range of <b>{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.ta_lat}}{{/terria.formatNumber}}</b> to <b>+{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.ta_hat}}{{/terria.formatNumber}}</b> metres above MSL.<br><br>This resulted in satellite data observing <b>~{{data.0.bands.ta_spread}}%</b> of the astronomical tide range, and failing to observe the lowest <b>~{{data.0.bands.ta_offset_low}}%</b> and highest <b>~{{data.0.bands.ta_offset_high}}%</b> of tides.<br><br><hr><br><small>For more information about intertidal mapping accuracy and limitations and data access options, visit the <a href='https://knowledge.dea.ga.gov.au/data/product/dea-intertidal/'>DEA Intertidal product description.</a></small><br/><br/></div>"
"template": "<div style='width:510px'><h1 style='font-weight:normal'>Digital Earth Australia Intertidal</h1>This location had an elevation above modelled Mean Sea Level (MSL): <h1 style='font-weight:normal'><b>{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.elevation}}{{/terria.formatNumber}} metres (± {{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.elevation_uncertainty}}{{/terria.formatNumber}})</b></h1>It was exposed from tidal inundation for: <h2 style='font-weight:normal'><b>{{data.0.bands.exposure}}%</b> of the <b>{{#terria.formatDateTime}}{format: \"yyyy\"}{{data.0.time}}{{/terria.formatDateTime}}</b> analysis period</h2><hr><br>Mapped intertidal extents can be affected by biases in the tidal conditions observed by satellites<a href='https://knowledge.dea.ga.gov.au/data/product/dea-intertidal/?tab=details#tidal-attribute-layers-ta'></a>. At this location, satellites observed the coastline at tide heights ranging from <b>{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.ta_lot}}{{/terria.formatNumber}}</b> to <b>+{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.ta_hot}}{{/terria.formatNumber}}</b> metres above MSL, compared to the full astronomical tide range of <b>{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.ta_lat}}{{/terria.formatNumber}}</b> to <b>+{{#terria.formatNumber}}{maximumFractionDigits:2}{{data.0.bands.ta_hat}}{{/terria.formatNumber}}</b> metres above MSL.<br><br>This resulted in satellite data observing <b>~{{data.0.bands.ta_spread}}%</b> of the astronomical tide range, and failing to observe the lowest <b>~{{data.0.bands.ta_offset_low}}%</b> and highest <b>~{{data.0.bands.ta_offset_high}}%</b> of tides.<br><br><hr><h3 style='font-weight:normal'><a href='{{data_links}}'><b>Data access and download</b></a></h3><small>For more information about intertidal mapping accuracy and limitations and data access options, visit the <a href='https://knowledge.dea.ga.gov.au/data/product/dea-intertidal/'>DEA Intertidal product description.</a></small><br/><br/></div>"
},
"id": "ghtu564",
},
Expand Down
Loading