resqpy.derived_model.zone_layer_ranges_from_array
- 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.
- Parameters:
zone_array (
3D numpy int arrayormasked array) – array holding zone index value per cellmin_k0 (
int, default0) – the minimum layer number (0 based) to be included in the rangesmax_k0 (
int, defaultNone) – 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 useduse_dominant_zone (
boolean, defaultFalse) – 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
- Returns:
a list of (int, int, int) being (zone_min_k0, zone_max_k0, zone_index) for each zone index value present
Notes
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!