-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from equinor/change-ensemble-root
Change ensemble root
- Loading branch information
Showing
2 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters