resqpy.derived_model.interpolated_grid

resqpy.derived_model.interpolated_grid(epc_file, grid_a, grid_b, a_to_b_0_to_1=0.5, split_tolerance=0.01, inherit_properties=False, inherit_realization=None, inherit_all_realizations=False, new_grid_title=None, new_epc_file=None)

Extends an existing model with a new grid geometry linearly interpolated between the two source_grids.

Parameters
  • epc_file (string) – file name to rewrite the model’s xml to

  • grid_a (grid.Grid objects) – a pair of RESQML grid objects representing the end cases, between which the new grid will be interpolated

  • grid_b (grid.Grid objects) – a pair of RESQML grid objects representing the end cases, between which the new grid will be interpolated

  • a_to_b_0_to_1 (float, default 0.5) – the interpolation factor in the range zero to one; a value of 0.0 will yield a copy of grid a, a value of 1.0 will yield a copy of grid b, intermediate values will yield a grid with all points interpolated

  • split_tolerance (float, default 0.01) – maximum offset of corner points for shared point to be generated; units are same as those in grid crs; only relevant if working from corner points, ignored otherwise

  • inherit_properties (boolean, default False) – if True, the new grid will have a copy of any properties associated with grid_a

  • inherit_realization (int, optional) – realization number for which properties will be inherited; ignored if inherit_properties is False

  • inherit_all_realizations (boolean, default False) – if True (and inherit_realization is None), properties for all realizations will be inherited; if False, only properties with a realization of None are inherited; ignored if inherit_properties is False or inherit_realization is not None

  • 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 interpolated grid (& crs)

Returns

new grid object (grid.Grid) with geometry interpolated between grid a and grid b

Notes

the hdf5 file used by the grid_a model is appended to, so it is recommended that the grid_a model’s epc is specified as the first argument (unless a new epc file is required, sharing the hdf5 file)