resqpy.derived_model.single_layer_grid

resqpy.derived_model.single_layer_grid(epc_file, source_grid=None, k0_min=None, k0_max=None, inactive_laissez_faire=True, new_grid_title=None, new_epc_file=None)

Extends an existing model with a new version of the source grid converted to a single, thick, layer.

Parameters:
  • epc_file (string) – file name to rewrite the model’s xml to; if source grid is None, model is loaded from this file

  • source_grid (grid.Grid object, optional) – a multi-layer RESQML grid object; if None, the epc_file is loaded and it should contain one ijk grid object (or one ‘ROOT’ grid) which is used as the source grid

  • k0_min (int, optional) – the minimum layer number in the source grid (zero based) to include in the single layer version; default is zero (ie. top layer in source grid)

  • k0_max (int, optional) – the maximum layer number in the source grid (zero based) to include in the single layer version; default is nk - 1 (ie. bottom layer in source grid)

  • inactive_laissez_faire (boolean, optional) – if True, a cell in the single layer grid will be set active if any of the corresponding cells in the source grid are active; otherwise all corresponding cells in the source grid must be active for the single layer cell to be active; default is True

  • new_grid_title (string) – used as the citation title text for the new grid object

  • new_epc_file (string, optional) – if None, the source epc_file is extended with the new grid object; if present, a new epc file (& associated h5 file) is created to contain the single layer grid (& crs)

Returns:

new grid object (grid.Grid) with a single layer representation of the source grid