EclReader#

class pyflowdiagnostics.readers.ecl_bin_reader.EclReader(input_file_path: str)[source]#

Bases: object

Reads SLB ECLIPSE style binary output files (.INIT, .EGRID, .UNRST, .X00xx).

This class provides methods to read various ECLIPSE output files, including initial conditions (.INIT), grid data (.EGRID), and restart files (.UNRST, .X00xx). It handles endianness detection and data type conversion.

input_file_path#

Path to the main ECLIPSE input file (.DATA or .IXF).

Type:

str

input_file_path_base#

Base path of the input file (without extension).

Type:

str

init_file_path#

Path to the initial conditions file (.INIT).

Type:

str

egrid_file_path#

Path to the grid data file (.EGRID).

Type:

str

unrst_file_path#

Path to the unified restart file (.UNRST). Currently not used.

Type:

str

Methods Summary

read_egrid([keys])

Reads data from the grid data file (.EGRID).

read_init([keys])

Reads data from the initial conditions file (.INIT).

read_rst([keys, tstep_id])

Reads data from a restart file (UNRST or .X00xx).

read_rst_step([keys, tstep_id])

read_unrst(file_path[, keys, tstep_id])

Methods Documentation

read_egrid(keys: list = None) dict[source]#

Reads data from the grid data file (.EGRID).

Parameters:

keys (list, optional) – List of keys to read. If None, all keys are read. Defaults to None.

Returns:

Dictionary containing the requested data, keyed by the provided keys.

Returns an empty dictionary if no keys are provided.

Return type:

dict

read_init(keys: list = None) dict[source]#

Reads data from the initial conditions file (.INIT).

Parameters:

keys (list, optional) – List of keys to read. If None, all keys are read. Defaults to None.

Returns:

Dictionary containing the requested data, keyed by the provided keys.

Returns an empty dictionary if no keys are provided.

Return type:

dict

read_rst(keys: list = None, tstep_id: int = None) dict[source]#

Reads data from a restart file (UNRST or .X00xx).

Parameters:
  • keys (list, optional) – List of keys to read. If None, all keys are read. Defaults to None.

  • tstep_id (int, optional) – Time step ID. Required for reading restart files. Defaults to None.

Returns:

Dictionary containing the requested data, keyed by the provided keys.

Returns an empty dictionary if no keys are provided.

Return type:

dict

Raises:
  • NotImplementedError – If unified is True (UNRST support not implemented).

  • ValueError – If tstep_id is None.

  • FileNotFoundError – If the specified restart file is not found.

read_rst_step(keys: list = None, tstep_id: int = None) dict[source]#
read_unrst(file_path: str, keys: list = None, tstep_id: int = None) dict[source]#