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 multidate handling to DEA Intertidal using raw band data #1275

Merged
merged 4 commits into from
Jul 16, 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
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,33 @@
"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": {
"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)
SpacemanPaul marked this conversation as resolved.
Show resolved Hide resolved

return data2[band] - data1[band]
1 change: 1 addition & 0 deletions dev/terria/terria-cube-v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,7 @@
"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
Expand Down
Loading