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

Refactor QCProperties #128

Merged
merged 1 commit into from
Apr 13, 2021
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
66 changes: 55 additions & 11 deletions docs/qcforward/grid_statistics.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This method checks if property statistics from 3D grids are within user specifie
thresholds. If worse than a given set of limits, either a warning is given or a
full stop of the workflow is forced.

Both discrete and continous properties are supported.

Signature
^^^^^^^^^
Expand All @@ -31,10 +32,13 @@ actions
property
Name of property (either a property icon in RMS, or a file name)

calculation
Name of statistical value to check (optional). Default option is "Avg" for continous properties,
while other valid options are "Min, Max and Stddev". Default option for discrete properties is "Percent".
codename
The discrete property code name to check value for (optional).
.. note:: A codename is only needed for discrete properties

calculation
Name of statistical value to check (optional). Default option is "Avg",
while other valid options for continous properties are "Min", "Max" and "Stddev".

selectors
A dictionary of conditions to extract statistics from. e.g. a specific zone and/or region (optional).
Expand All @@ -55,11 +59,15 @@ actions

For example ``[0.05, 0.35]`` will give a warning if the statistic is < than 0.05 and > than 0.35.

.. note:: For discrete properties the statistical value will be reported in fractions.

warn_outside
Same as warn_outside key above, but instead defines when to give a warning (optional).

description
A string to describe each action (optional).




Optional fields
Expand All @@ -85,8 +93,8 @@ nametag
Examples
~~~~~~~~

Example when executed inside RMS (basic):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Example when executed inside RMS (continous properties - basic):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: python

Expand Down Expand Up @@ -122,9 +130,47 @@ Example when executed inside RMS (basic):
check()


Example when executed inside RMS (discrete properties - basic):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: python

from fmu.tools import qcforward as qcf

# Check average grid statistics for porosity and permeability

GRIDNAME = "SimGrid"
REPORT = "somefile.csv"
ACTIONS = [
{
"property": "Facies",
"codename": "Sand",
"selectors": {"Zone": "Top_Zone"},
"stop_outside": [0.4, 0.8],
},
{
"property": "Facies",
"codename": "Sand",
"selectors": {"Zone": "Mid_Zone"},
"stop_outside": [0.2, 0.5],
},
]

def check():

usedata = {
"grid": GRIDNAME,
"actions": ACTIONS,
"report": REPORT,
}

qcf.grid_statistics(usedata, project=project)

if __name__ == "__main__":
check()

Example when executed inside RMS (more settings):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Example when executed inside RMS (continous properties - more settings):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: python

Expand All @@ -149,15 +195,14 @@ Example when executed inside RMS (more settings):
actions.append(
{
"property": "PORO",
"selectors": {"ZONE": zone},
"selectors": {"Zone": zone},
"filters": {"FLUID": {"include": ["Gas", "Oil"]}},
"stop_outside": limits,
},
)

usedata = {
"nametag": "MYDATA1",
"path": PATH,
"grid": GRIDNAME,
"report": REPORT,
"actions": actions,
Expand Down Expand Up @@ -233,13 +278,12 @@ The YAML file may in case look like:
warn_outside: [0.18, 0.25]
- property: PORO
selectors:
ZONE: Top_Zone
Zone: Top_Zone
filters:
REGION:
exclude: ["Surroundings"]
stop_outside: [0, 1]
warn_outside: [0.18, 0.25]
path: ../input/qc_files/
report: somefile.csv
nametag: QC_PORO
verbosity: info
Loading