Skip to content

Commit

Permalink
Merge pull request #9 from equinor/change-ensemble-root
Browse files Browse the repository at this point in the history
Change ensemble root
  • Loading branch information
jcrivenaes authored May 5, 2021
2 parents 037e464 + f33590e commit ed9fb22
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 2 deletions.
97 changes: 96 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,97 @@
# fmu-dataio
Utility functions for data transfer of FMU data with rich metadata, for REP, SUMO, etc
Utility functions for data transfer of FMU data with rich metadata, for REP, SUMO, WEBVIZ, etc.

These fmu.dataio can be ran both inside RMS and outside RMS.

For surfaces, grids, wells, polygons, the input object must be parsed by
xtgeo. For tables, the input is a pandas dataframe.

A configuration input is required and will within Equinor be read from the
so-called global_variables.yml produced by fmu-config. Details on syntax
will be given in the documentation.

As default, output with metadata will be stored in `../../share/results` for each
realization, while ensemble metadata when ran with ERT will be stored in
`/scratch/<field>/<user>/<case>/iter-<n>/share/metadata`

## Usage

### Export a surface

```
import xtgeo
from fmu.config import utilities as ut
from fmu.dataio import ExportData
CFG = ut.yaml_load("../../fmuconfig/output/global_variables.yml")
def export_some_surface():
srf = xtgeo.surface_from_file("top_of_some.gri")
exp = ExportData(
config=CFG,
content="depth",
unit="m",
vertical_domain={"depth": "msl"},
timedata=None,
is_prediction=True,
is_observation=False,
tagname="Some Descr",
verbosity="WARNING",
)
exp.to_file(srf)
if __name__ == "__main__":
export_some_surface()
```



### Export a table

This is coming functionality and code in example is tentative!

```
import pandas as pd
from fmu.config import utilities as ut
from fmu.dataio import ExportData
CFG = ut.yaml_load("../../fmuconfig/output/global_variables.yml")
def export_some_table():
vol = pd.read_csv("some_table_vol.csv")
exp = ExportData(
config=CFG,
content="volumetrics",
unit="m",
is_prediction=True,
is_observation=False,
tagname="voltable",
)
exp.to_file(vol)
if __name__ == "__main__":
export_some_table()
```

## Installation

Install a spesific version (e.g. 0.1.1) directly from github through

```
pip install git+ssh://[email protected]/equinor/[email protected]
```

Local development and testing:

```
pip install -e .[tests,docs]
pytest
```
2 changes: 1 addition & 1 deletion src/fmu/dataio/dataio.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def _store_ensemble_metadata(self):
runpath = self._meta_fmu["ensemble"]["case"]["runpath"]
iterfolder = self._meta_fmu["ensemble"]["iterfolder"]

share_ensroot = pathlib.Path(runpath) / "share" / "metadata" / iterfolder
share_ensroot = pathlib.Path(runpath) / iterfolder / "share" / "metadata"

try:
share_ensroot.mkdir(parents=True, exist_ok=False)
Expand Down

0 comments on commit ed9fb22

Please sign in to comment.