From 8dbe875ff558c1882c40888f7596d2d8398c875e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20C=2E=20Riven=C3=A6s?= Date: Fri, 6 Jan 2023 09:12:07 +0100 Subject: [PATCH] Add 'calculation' as field for content 'seismic' --- .../0.8.0/examples/surface_seismic_amplitude.yml | 2 +- schema/definitions/0.8.0/schema/fmu_results.json | 8 +++++++- src/fmu/dataio/_definitions.py | 3 ++- tests/test_units/test_dataio.py | 6 ++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/schema/definitions/0.8.0/examples/surface_seismic_amplitude.yml b/schema/definitions/0.8.0/examples/surface_seismic_amplitude.yml index 58134c844..814ebd568 100644 --- a/schema/definitions/0.8.0/examples/surface_seismic_amplitude.yml +++ b/schema/definitions/0.8.0/examples/surface_seismic_amplitude.yml @@ -73,6 +73,7 @@ data: # The data block describes the actual data (e.g. surface). Only present in seismic: attribute: amplitude_timeshifted + calculation: mean zrange: 12.0 filter_size: 1.0 scaling_factor: 1.0 @@ -189,4 +190,3 @@ masterdata: stratigraphic_column: identifier: DROGON_2020 uuid: 00000000-0000-0000-0000-000000000000 # mock uuid for Drogon - diff --git a/schema/definitions/0.8.0/schema/fmu_results.json b/schema/definitions/0.8.0/schema/fmu_results.json index 39032e4b6..28bc53496 100644 --- a/schema/definitions/0.8.0/schema/fmu_results.json +++ b/schema/definitions/0.8.0/schema/fmu_results.json @@ -557,6 +557,12 @@ "amplitude_timeshifted" ] }, + "calculation": { + "type": "string", + "examples": [ + "mean" + ] + }, "zrange": { "type": "number", "examples": [ @@ -1281,4 +1287,4 @@ } } ] -} \ No newline at end of file +} diff --git a/src/fmu/dataio/_definitions.py b/src/fmu/dataio/_definitions.py index 6dd859982..34b192837 100644 --- a/src/fmu/dataio/_definitions.py +++ b/src/fmu/dataio/_definitions.py @@ -40,7 +40,8 @@ def __post_init__(self): "thickness": None, "property": {"attribute": str, "is_discrete": bool}, "seismic": { - "attribute": str, + "attribute": str, # e.g. amplitude + "calculation": str, # e.g. mean "zrange": float, "filter_size": float, "scaling_factor": float, diff --git a/tests/test_units/test_dataio.py b/tests/test_units/test_dataio.py index dd224c11d..392c30e39 100644 --- a/tests/test_units/test_dataio.py +++ b/tests/test_units/test_dataio.py @@ -129,7 +129,8 @@ def test_content_valid_dict(regsurf, globalconfig2): name="TopVolantis", content={ "seismic": { - "attribute": "myattribute", + "attribute": "amplitude", + "calculation": "mean", "zrange": 12.0, "stacking_offset": "0-15", } @@ -138,7 +139,8 @@ def test_content_valid_dict(regsurf, globalconfig2): mymeta = eobj.generate_metadata(regsurf) assert mymeta["data"]["content"] == "seismic" assert mymeta["data"]["seismic"] == { - "attribute": "myattribute", + "attribute": "amplitude", + "calculation": "mean", "zrange": 12.0, "stacking_offset": "0-15", }