imod.select.get_upper_active_grid_cells#
- imod.select.get_upper_active_grid_cells(active: DataArray | UgridDataArray) DataArray | UgridDataArray[source]#
- Returns grid of booleans designating location of the uppermost active grid cell. - Parameters:
- active ({xr.DataArray, xu.UgridDataArray}) – Grid of booleans (…, layer, y, x) designating active cell. 
- Returns:
- upper_active_grid_cells – Grid of booleans (…, layer, y, x) designating location of the uppermost active grid cell. 
- Return type:
- {xr.DataArray, xu.UgridDataArray} 
 - Examples - To get the uppermost active grid cells of an idomain grid and mask idomain with it: - >>> active = idomain > 0 >>> upper_active = get_upper_active_grid_cells(active) >>> idomain_upper = idomain.where(upper_active, 0) - To get the uppermost active grid cells of data grid with floats, where - np.nanindicates inactive cells and use it to mask data:- >>> active = data.notnull() >>> upper_active = get_upper_active_grid_cells(active) >>> data_upper = data.where(upper_active)