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

DOC: Updates to examples according to latest changes #788

Merged
merged 1 commit into from
Sep 20, 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 docs/src/datamodel/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ Expand below to see a full example of valid metadata for surface exported from F

.. toggle::

.. literalinclude:: ../../schema/definitions/0.8.0/examples/surface_depth.yml
.. literalinclude:: ../../../schema/definitions/0.8.0/examples/surface_depth.yml
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was giving warnings during sphinx build as it could not find the example.

:language: yaml

|
Expand Down
18 changes: 4 additions & 14 deletions docs/src/example_surface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ fmu:

iteration:
id: 0 # always an int, will be 0 for e.g. "pred"
uid: 44cd1b84-766f-4c93-9050-g921861d9420--iter-0 # case.uuid + iteration.name
uuid: 44cd1b84-766f-4c93-9050-g921861d9420--iter-0 # case.uuid + iteration.name
name: "iter-0" # /"pred"
restart_from: 15ce3b84-766f-4c93-9050-b154861f9100--0 # fmu.case.id for another iteration/case

realization: # could be expanded in the future?
name: "realization-33"
id: 33
uid: 44cd1b84-766f-4c93-9050-g921861d9420--0--33 # case.uuid + iteration.id + realization.id
uuid: 44cd1b84-766f-4c93-9050-g921861d9420--0--33 # case.uuid + iteration.id + realization.id
parameters: # directly pass parameters.txt. This is potentially a lot of content, only a stub is included here.
- SENSNAME: faultseal
- SENSCASE: low
Expand Down Expand Up @@ -133,25 +133,15 @@ data: # The data block describes the actual data (e.g. surface). Only present in

display:
name: Top Volantis
line:
show: true
color: black
points:
show: false
color: null
contours:
show: true
color: black
fill:
show: true
colors: gist_earth

access:
asset:
name: Drogon
ssdl:
access_level: internal
rep_include: true
classification: internal


masterdata:
smda:
Expand Down
3 changes: 3 additions & 0 deletions docs/src/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ Press + to see generated YAML files for metadata.
Exporting volume tables RMS or file
-----------------------------------

Below is an example of exporting volume tables from csv-files, while an example
of easy export of RMS volumetrics can be found here :ref:`example-export-volumes-rms`.

Python script
~~~~~~~~~~~~~

Expand Down
18 changes: 5 additions & 13 deletions docs/src/preparations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ Example from Drogon:

asset:
name: Drogon
ssdl:
access_level: internal
rep_include: true
classification: internal


Under ``asset.name`` you will put the name of your asset. If you plan to upload data to
Expand All @@ -111,18 +109,12 @@ Sumo, you will be told by the Sumo team what asset should be.
piece of information that governs both ownership and access to data when stored in the
cloud. Sometimes, asset is identical to "field" but frequently it is not.

Under ``ssdl``, you will enter some defaults regarding data sharing with the Subsurface Data Lake.

The ``ssdl.access_level`` sets the (default) sensitivity of exported data. Valid entries
here are ``internal`` and ``restricted``. The ``ssdl.rep_include`` sets the default flag
for signalling inclusion of exported data in the Reservoir Experience Platform. This is
a boolean, and valid entries are ``True`` and ``False``.
Under ``classification`` the (default) sensitivity of exported data is entered. Valid entries
here are ``internal`` and ``restricted``. Note that this is only a default. You can override
thie setting at any point when exporting data.

.. note::
The ``access.ssdl.access_level`` is currently also used for access handling in Sumo.

Note that these are defaults. You can override these settings at any point when exporting
data, and also note that no data will be lifted to the datalake without explicit action by you.
The ``access.classification`` is currently also used for access handling in Sumo.


global_variables.yml | **stratigraphy**
Expand Down
2 changes: 2 additions & 0 deletions docs/src/rms_oneliners.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ a few lines will be needed.

Currently only volumes are exposed, but this will be extended in the near future.

.. _example-export-volumes-rms:

Exporting volumetrics from RMS
------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def export_geogrid_geometry():
name=GNAME,
content="depth",
unit="m",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
timedata=None,
is_prediction=True,
is_observation=False,
Expand All @@ -56,7 +57,8 @@ def export_geogrid_parameters(outgrid):
geometry=outgrid,
config=CFG,
content={"property": {"is_discrete": False}},
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
timedata=None,
is_prediction=True,
is_observation=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,12 @@

CFG = ut.yaml_load("../../fmuconfig/output/global_variables.yml")

IN_ROXAR = False

PRJ = None
if IN_ROXAR:
PRJ = project # type: ignore # noqa # pylint: disable=undefined-variable
VTABLES = ["geogrid_volumes", "simgrid_volumes"]
else:
VFOLDER = "../output/volumes/"
VFILES = ["geogrid_vol.csv", "simgrid_vol.csv"]

VFOLDER = "../output/volumes/"
VFILES = ["geogrid_vol.csv", "simgrid_vol.csv"]

TAGNAME = "volumes"

# renaming columns from RMS to FMU standard
RENAMING = {
"Proj. real.": "REALIZATION",
"Zone": "ZONE",
"Segment": "REGION",
"BulkOil": "BULK_OIL",
"PoreOil": "PORV_OIL",
"HCPVOil": "HCPV_OIL",
"STOIIP": "STOIIP_OIL",
"AssociatedGas": "ASSOCIATEDGAS_OIL",
"BulkGas": "BULK_GAS",
"PoreGas": "PORV_GAS",
"HCPVGas": "HCPV_GAS",
"GIIP": "GIIP_GAS",
"AssociatedLiquid": "ASSOCIATEDOIL_GAS",
"Bulk": "BULK_TOTAL",
"Pore": "PORV_TOTAL",
}


def volume_as_dataframe_files(vfile):
"""Read volume (CSV files) and return dataframe."""
Expand All @@ -64,22 +38,6 @@ def volume_as_dataframe_files(vfile):
return dframe, gridname


def volume_as_dataframe_rms(vtable):
"""Read volume table in RMS and return dataframe."""

# "geogrid_volumes" --> "geogrid" etc
gridname = vtable.replace("_volumes", "")

table = PRJ.volumetric_tables[vtable]
dtdict = table.get_data_table().to_dict()

dframe = pd.DataFrame.from_dict(dtdict)
dframe.rename(columns=RENAMING, inplace=True)
# skip REALIZATION
dframe.drop("REALIZATION", axis=1, inplace=True)
return dframe, gridname


def export_dataio(df, gridname):
"""Get the dataframe and export to SUMO via dataio."""

Expand All @@ -99,10 +57,6 @@ def export_dataio(df, gridname):


if __name__ == "__main__":
if IN_ROXAR:
for vtable in VTABLES:
export_dataio(*volume_as_dataframe_rms(vtable))

else:
for vfile in VFILES:
export_dataio(*volume_as_dataframe_files(vfile))
for vfile in VFILES:
df, gridname = volume_as_dataframe_files(vfile)
export_dataio(df, gridname)
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ masterdata:
access:
asset:
name: Drogon
ssdl:
access_level: internal
rep_include: true
classification: internal
model:
name: ff
revision: 21.1.0.dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ def main():

ed = dataio.ExportData(
config=CFG,
name="noname_here",
name="all",
unit="fraction",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
content="property",
timedata=None,
is_prediction=True,
is_observation=False,
tagname="average_poro",
workflow="rms property model",
)
fname = ed.export(surf, name="all") # note that 'name' here will be used
fname = ed.export(surf)
print(f"File name is {fname}")

# -------------------------------------
Expand All @@ -60,7 +61,8 @@ def main():
config=CFG,
name="topvolantis",
unit="m",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
content="depth",
timedata=None,
is_prediction=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ def export_faultlines():

ed = dataio.ExportData(
config=CFG,
content="depth",
content="fault_lines",
unit="m",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
timedata=None,
is_prediction=True,
is_observation=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def export_faultroom_surface():
config=CFG,
content="fault_properties",
unit="unset",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
is_prediction=True,
is_observation=False,
workflow="rms structural model",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def main():
name=name,
unit="fraction",
content={"property": {"attribute": attribute, "is_discrete": False}},
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
timedata=None,
is_prediction=True,
is_observation=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ masterdata:
access:
asset:
name: Drogon
ssdl:
access_level: internal
rep_include: true
classification: internal
model:
name: ff
revision: 21.1.0.dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ def main():

ed = dataio.ExportData(
config=CFG,
name="noname_here",
name="all",
unit="fraction",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
content="property",
timedata=None,
is_prediction=True,
is_observation=False,
tagname="average_poro",
workflow="rms property model",
)
fname = ed.export(surf, name="all") # note that 'name' here will be used
fname = ed.export(surf)
print(f"File name is {fname}")

# -------------------------------------
Expand All @@ -60,7 +61,8 @@ def main():
config=CFG,
name="topvolantis",
unit="m",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
content="depth",
timedata=None,
is_prediction=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ masterdata:
access:
asset:
name: Drogon
ssdl:
access_level: internal
rep_include: true
classification: internal
model:
name: ff
revision: 21.1.0.dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@ def main():

ed = dataio.ExportData(
config=CFG,
name="noname_here",
name="all",
unit="fraction",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
content="property",
timedata=None,
is_prediction=True,
is_observation=False,
tagname="average_poro",
workflow="rms property model",
)
fname = ed.export(surf, name="all") # note that 'name' here will be used
fname = ed.export(surf)
print(f"File name is {fname}")

# -------------------------------------
Expand All @@ -60,7 +61,8 @@ def main():
config=CFG,
name="topvolantis",
unit="m",
vertical_domain={"depth": "msl"},
vertical_domain="depth",
domain_reference="msl",
content="depth",
timedata=None,
is_prediction=True,
Expand Down