How to use the ecl2df.common.ecl_keyworddata_to_df function in ecl2df

To help you get started, we’ve selected a few ecl2df examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github equinor / ecl2df / ecl2df / satfunc.py View on Github external
def swfn_fromdeck(deck, ntsfun=None):
    """Extract SWFN data from a deck

    Args:
        deck (str or opm.common Deck)
        ntsfun (int): Number of SATNUM regions in deck. Will
            be inferred if not present in deck
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTSFUN", deck, ntsfun)
    return common.ecl_keyworddata_to_df(
        deck, "SWFN", renamer=RENAMERS["SWFN"], recordcountername="SATNUM"
    )
github equinor / ecl2df / ecl2df / pvt.py View on Github external
def pvdo_fromdeck(deck, ntpvt=None):
    """Extract PVDO from a deck

    Args:
        deck (str or opm.common Deck)
        ntpvt (int): Number of PVT regions in deck. Will
            be inferred if not present in deck.
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTPVT", deck, ntpvt)
    pvdg_df = common.ecl_keyworddata_to_df(
        deck, "PVDO", renamer=RENAMERS["PVDO"], recordcountername="PVTNUM"
    )
    return pvdg_df
github equinor / ecl2df / ecl2df / satfunc.py View on Github external
def swof_fromdeck(deck, ntsfun=None):
    """Extract SWOF data from a deck

    Args:
        deck (str or opm.common Deck)
        ntsfun (int): Number of SATNUM regions in deck. Will
            be inferred if not present in deck
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTSFUN", deck, ntsfun)
    return common.ecl_keyworddata_to_df(
        deck, "SWOF", renamer=RENAMERS["SWOF"], recordcountername="SATNUM"
    )
github equinor / ecl2df / ecl2df / satfunc.py View on Github external
def slgof_fromdeck(deck, ntsfun=None):
    """Extract SLGOF data from a deck

    Args:
        deck (str or opm.common Deck)
        ntsfun (int): Number of SATNUM regions in deck. Will
            be inferred if not present in deck
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTSFUN", deck, ntsfun)
    return common.ecl_keyworddata_to_df(
        deck, "SLGOF", renamer=RENAMERS["SLGOF"], recordcountername="SATNUM"
    )
github equinor / ecl2df / ecl2df / pvt.py View on Github external
def pvto_fromdeck(deck, ntpvt=None):
    """Extract PVTO from a deck

    Args:
        deck (str or opm.common Deck)
        ntpvt (int): Number of PVT regions in deck. Will
            be inferred if not present in deck.
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTPVT", deck, ntpvt)
    pvto_df = common.ecl_keyworddata_to_df(
        deck, "PVTO", renamer=RENAMERS["PVTO"], emptyrecordcountername="PVTNUM"
    )
    return pvto_df
github equinor / ecl2df / ecl2df / satfunc.py View on Github external
def sof3_fromdeck(deck, ntsfun=None):
    """Extract SOF3 data from a deck

    Args:
        deck (str or opm.common Deck)
        ntsfun (int): Number of SATNUM regions in deck. Will
            be inferred if not present in deck
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTSFUN", deck, ntsfun)
    return common.ecl_keyworddata_to_df(
        deck, "SOF3", renamer=RENAMERS["SOF3"], recordcountername="SATNUM"
    )
github equinor / ecl2df / ecl2df / satfunc.py View on Github external
def sgof_fromdeck(deck, ntsfun=None):
    """Extract SGOF data from a deck

    Args:
        deck (str or opm.common Deck)
        ntsfun (int): Number of SATNUM regions in deck. Will
            be inferred if not present in deck
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTSFUN", deck, ntsfun)
    return common.ecl_keyworddata_to_df(
        deck, "SGOF", renamer=RENAMERS["SGOF"], recordcountername="SATNUM"
    )
github equinor / ecl2df / ecl2df / pvt.py View on Github external
def density_fromdeck(deck, ntpvt=None):
    """Extract DENSITY from a deck

    Args:
        deck (str or opm.common Deck)
        ntpvt (int): Number of PVT regions in deck. Will
            be inferred if not present in deck.
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTPVT", deck, ntpvt)
    return common.ecl_keyworddata_to_df(
        deck, "DENSITY", renamer=RENAMERS["DENSITY"], recordcountername="PVTNUM"
    )
github equinor / ecl2df / ecl2df / equil.py View on Github external
if "EQLDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("EQLDIMS", "NTEQUL", deck, ntequl)

    phasecount = sum(["OIL" in deck, "GAS" in deck, "WATER" in deck])
    phases = phases_from_deck(deck)
    if not phases or phases not in RENAMERS:
        raise ValueError(
            "Could not determine phase configuration, got '{}'".format(phases)
        )
    columnrenamer = RENAMERS[phases_from_deck(deck)]
    if phasecount == 1:
        columnrenamer = {"DATUM_DEPTH": "DATUM", "DATUM_PRESSURE": "PRESSURE"}
    if not columnrenamer:
        raise ValueError("Unsupported phase configuration")

    dataframe = common.ecl_keyworddata_to_df(
        deck, "EQUIL", renamer=columnrenamer, recordcountername="EQLNUM"
    )

    # The column handling can be made prettier..
    for col in dataframe.columns:
        if "IGNORE" in col:
            del dataframe[col]

    return dataframe
github equinor / ecl2df / ecl2df / pvt.py View on Github external
def rock_fromdeck(deck, ntpvt=None):
    """Extract ROCK from a deck

    Args:
        deck (str or opm.common Deck)
        ntpvt (int): Number of PVT regions in deck. Will
            be inferred if not present in deck.
    """
    if "TABDIMS" not in deck:
        deck = inferdims.inject_xxxdims_ntxxx("TABDIMS", "NTPVT", deck, ntpvt)
    return common.ecl_keyworddata_to_df(
        deck, "ROCK", renamer=RENAMERS["ROCK"], recordcountername="PVTNUM"
    )