- resqpy.derived_model.zone_layer_ranges_from_array(zone_array, min_k0=0, max_k0=None, use_dominant_zone=False)¶
Returns a list of (zone_min_k0, zone_max_k0, zone_index) derived from zone_array.
zone_array (3D numpy int array or masked array) – array holding zone index value per cell
min_k0 (int, default 0) – the minimum layer number (0 based) to be included in the ranges
max_k0 (int, default None) – the maximum layer number (0 based) to be included in the ranges; note that this layer is included (unlike in python ranges); if None, the maximum layer number in zone_array is used
use_dominant_zone (boolean, default False) – if True, the most common zone value in each layer is used for the whole layer; if False, then variation of zone values in active cells in a layer will raise an assertion error
a list of (int, int, int) being (zone_min_k0, zone_max_k0, zone_index) for each zone index value present
the function requires zone indices (for active cells, if zone_array is masked) within a layer to be consistent: an assertion error is raised otherwise; the returned list is sorted by layer ranges rather than zone index; if use_dominant_zone is True then a side effect of the function is to modify the values in zone_array to be consistent across each layer, effectively reassigning some cells to a different zone!