.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "user-guide\10-cleanup.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_user-guide_10-cleanup.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_user-guide_10-cleanup.py:


Data cleanup
============

More often than not, data contained in databases is not entirely consistent,
causing errors. It therefore is useful to have some utilities at hand to clean
up data. We included some convenience methods to help clean up inconsistent
datasets.

.. GENERATED FROM PYTHON SOURCE LINES 10-12

.. code-block:: Python
   :dedent: 1










.. GENERATED FROM PYTHON SOURCE LINES 14-15

We'll start with the usual imports

.. GENERATED FROM PYTHON SOURCE LINES 15-19

.. code-block:: Python

    import numpy as np

    import imod








.. GENERATED FROM PYTHON SOURCE LINES 20-21

These imports can be ignored

.. GENERATED FROM PYTHON SOURCE LINES 21-24

.. code-block:: Python

    from imod.schemata import ValidationError
    from imod.util import print_if_error








.. GENERATED FROM PYTHON SOURCE LINES 25-28

There is a separate example contained in
:doc:`hondsrug </examples/mf6/hondsrug>`
that you should look at if you are interested in the model building

.. GENERATED FROM PYTHON SOURCE LINES 28-33

.. code-block:: Python

    tmpdir = imod.util.temporary_directory()

    gwf_simulation = imod.data.hondsrug_simulation(tmpdir / "hondsrug_saved")









.. GENERATED FROM PYTHON SOURCE LINES 34-40

Update existing model with new data
-----------------------------------

Your dear colleague has brought you some new data for the river package, which
should be much better than the previous dataset "riv" included in the
database.

.. GENERATED FROM PYTHON SOURCE LINES 41-45

.. code-block:: Python


    gwf_model = gwf_simulation["GWF"]
    new_riv_ds = imod.data.colleagues_river_data(tmpdir / "hondsrug_saved")








.. GENERATED FROM PYTHON SOURCE LINES 46-47

Let's do a brief visual check if the colleague's data seems alright:

.. GENERATED FROM PYTHON SOURCE LINES 47-52

.. code-block:: Python


    imod.visualize.plot_map(
        new_riv_ds["stage"].max(dim="layer"), "viridis", np.linspace(-1, 19, 9)
    )




.. image-sg:: /user-guide/images/sphx_glr_10-cleanup_001.png
   :alt: 10 cleanup
   :srcset: /user-guide/images/sphx_glr_10-cleanup_001.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    (<Figure size 640x480 with 2 Axes>, <Axes: >)



.. GENERATED FROM PYTHON SOURCE LINES 53-56

Hmmmm, the western side of the river stage grid seems suspiciously inactive...
We have to contact our colleague later. For now, let's work with what we have
and update the model.

.. GENERATED FROM PYTHON SOURCE LINES 57-62

.. code-block:: Python


    old_riv = gwf_model.pop("riv")

    gwf_model["new_riv"] = imod.mf6.River(**new_riv_ds)








.. GENERATED FROM PYTHON SOURCE LINES 63-64

Lets's write the simulation with our updated model!

.. GENERATED FROM PYTHON SOURCE LINES 65-73

.. code-block:: Python


    tmp_dir = imod.util.temporary_directory()

    # Ignore the "with" statement, it is to succesfully render the Jupyter notebook
    # online.
    with print_if_error(ValidationError):
        gwf_simulation.write(tmp_dir)





.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    Simulation validation status:
        - GWF model:
            - model options package:
            - new_riv package:
                - stage:
                    - not all values comply with criterion: >= bottom_elevation
                - conductance:
                    - nodata is not aligned with stage
                    - not all values comply with criterion: > 0.0
                - bottom_elevation:
                    - nodata is not aligned with stage
                -> You might fix this by calling the package's ``.cleanup()`` method.




.. GENERATED FROM PYTHON SOURCE LINES 74-81

Oh no! Our river package has a completely inconsistent dataset.
The model validation raises the following issues:

* The bottom elevation exceeds stage in some cells
* NoData cells are not aligned between stage and conductance
* NoData cells are not aligned between stage and bottom_elevation
* There are conductance values with value <= 0.0

.. GENERATED FROM PYTHON SOURCE LINES 84-88

*Exercise*: Use the function ``imod.visualize.plot_map`` to visually inspect
the errors in your colleagues dataset. You can alter the variable name to
inspect different variables.


.. GENERATED FROM PYTHON SOURCE LINES 89-94

.. code-block:: Python


    imod.visualize.plot_map(
        new_riv_ds["stage"].max(dim="layer"), "viridis", np.linspace(-1, 19, 9)
    )




.. image-sg:: /user-guide/images/sphx_glr_10-cleanup_002.png
   :alt: 10 cleanup
   :srcset: /user-guide/images/sphx_glr_10-cleanup_002.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    (<Figure size 640x480 with 2 Axes>, <Axes: >)



.. GENERATED FROM PYTHON SOURCE LINES 95-97

We can also check where stage exceeds river bottom elevation using basic
xarray functionality.

.. GENERATED FROM PYTHON SOURCE LINES 98-103

.. code-block:: Python


    stage_above_riv_bot = new_riv_ds["stage"] < new_riv_ds["bottom_elevation"]

    imod.visualize.plot_map(stage_above_riv_bot.max(dim="layer"), "viridis", [0, 1])




.. image-sg:: /user-guide/images/sphx_glr_10-cleanup_003.png
   :alt: 10 cleanup
   :srcset: /user-guide/images/sphx_glr_10-cleanup_003.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    (<Figure size 640x480 with 2 Axes>, <Axes: >)



.. GENERATED FROM PYTHON SOURCE LINES 104-107

So luckily the area affected by this error is only small. Let's investigate
the size of the error here.


.. GENERATED FROM PYTHON SOURCE LINES 108-115

.. code-block:: Python


    diff = new_riv_ds["bottom_elevation"] - new_riv_ds["stage"]

    max_diff = diff.max().values

    max_diff





.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    array(0.10000038)



.. GENERATED FROM PYTHON SOURCE LINES 116-118

That is a relatively subtle error, which is probably why it slipped your
colleague's attention. Let's plot the troublesome area:

.. GENERATED FROM PYTHON SOURCE LINES 119-126

.. code-block:: Python


    imod.visualize.plot_map(
        diff.where(stage_above_riv_bot).max(dim="layer"),
        "viridis",
        np.linspace(0, max_diff, 9),
    )




.. image-sg:: /user-guide/images/sphx_glr_10-cleanup_004.png
   :alt: 10 cleanup
   :srcset: /user-guide/images/sphx_glr_10-cleanup_004.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    (<Figure size 640x480 with 2 Axes>, <Axes: >)



.. GENERATED FROM PYTHON SOURCE LINES 127-147

That is only a small area. Plotting these errors can help you analyze the size
of problems and communicate with your colleague where there are problems.

The ``cleanup`` method
----------------------

The data quality seems acceptable for now to carry on modelling, so we can
already set up a model for the project. We need to communicate with colleagues
later that there are mistakes, so that the errors can be corrected.

iMOD Python has a set of utilities to help you with cleaning erronous data.
Note that these cleanup utilities can only fix a limited set of common
mistakes, in ways you might not need/like. It therefore is always wise to
verify if you think the fixes are correct in this case.

Let's clean up the problematic river data using the
:meth:`imod.mf6.River.cleanup` method. Note that this method changes the data
inplace. This means that the package will be updated, without returning a new
copy of the package. This means that we need to copy the dirty dataset first,
before we can do comparisons of the dataset before and after the fix.

.. GENERATED FROM PYTHON SOURCE LINES 148-151

.. code-block:: Python


    dirty_ds = gwf_model["new_riv"].dataset.copy()








.. GENERATED FROM PYTHON SOURCE LINES 152-156

We can now clean up the package. To clean up the River package, the method
requires the model discretization, contained in the
:class:`imod.mf6.StructuredDiscretization` package. In this model, we named
this package "dis".

.. GENERATED FROM PYTHON SOURCE LINES 157-163

.. code-block:: Python


    dis_pkg = gwf_model["dis"]
    gwf_model["new_riv"].cleanup(dis=dis_pkg)

    cleaned_ds = gwf_model["new_riv"].dataset








.. GENERATED FROM PYTHON SOURCE LINES 164-170

According to the method's explanation (the method calls
:func:`imod.prepare.cleanup_riv`), the bottom elevation should be altered by
the cleanup function.

Let's first see if the stages were altered, we'll calculate the difference
between the original stage and cleaned version.

.. GENERATED FROM PYTHON SOURCE LINES 171-179

.. code-block:: Python


    diff_stage = dirty_ds["stage"] - cleaned_ds["stage"]

    fig, ax = imod.visualize.plot_map(
        diff_stage.max(dim="layer"), "viridis", np.linspace(0, max_diff, 9)
    )
    ax.set_title("stage lowered by cleanup (m)")




.. image-sg:: /user-guide/images/sphx_glr_10-cleanup_005.png
   :alt: stage lowered by cleanup (m)
   :srcset: /user-guide/images/sphx_glr_10-cleanup_005.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    Text(0.5, 1.0, 'stage lowered by cleanup (m)')



.. GENERATED FROM PYTHON SOURCE LINES 180-184

The stages are indeed not altered.

Let's see if the bottom elevations are lowered, we'll calculate the difference
between the original bottom elevation and cleaned version.

.. GENERATED FROM PYTHON SOURCE LINES 185-193

.. code-block:: Python


    diff_riv_bot = dirty_ds["bottom_elevation"] - cleaned_ds["bottom_elevation"]

    fig, ax = imod.visualize.plot_map(
        diff_riv_bot.max(dim="layer"), "viridis", np.linspace(0, max_diff, 9)
    )
    ax.set_title("river bottom lowered by cleanup (m)")




.. image-sg:: /user-guide/images/sphx_glr_10-cleanup_006.png
   :alt: river bottom lowered by cleanup (m)
   :srcset: /user-guide/images/sphx_glr_10-cleanup_006.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    Text(0.5, 1.0, 'river bottom lowered by cleanup (m)')



.. GENERATED FROM PYTHON SOURCE LINES 194-211

You can see the bottom elevation was lowered by the cleanup method.
Furthermore the area in the west where no active stages were defined are also
deactivated.

We advice to always verify if the data is cleaned in a manner that fits your
use-case. For example, you might need to raise the stages to the river bottom
elevation, instead of lowering the latter to the former like the ``cleanup``
method just did. In such case, you need to manually fix the data.

The ``cleanup`` method helps getting your data through the model validation,
but is not guaranteed to be the "best" way to clean up your data!

Writing the cleaned model
-------------------------

Now that the river package has been cleaned, let's see if we can write the
model.

.. GENERATED FROM PYTHON SOURCE LINES 212-215

.. code-block:: Python


    gwf_simulation.write(tmp_dir)








.. GENERATED FROM PYTHON SOURCE LINES 216-227

Great! The model was succesfully written!

Cleaning data without a MODFLOW 6 simulation
--------------------------------------------

There might be situations where you do not have a MODFLOW 6 simulation or River
package at hand, and you still want to clean up your river grids. In this
case, you can use the :func:`imod.prepare.cleanup_riv` function. This function
requires you to to separately provide your grids and returns a dictionary of
grids.


.. GENERATED FROM PYTHON SOURCE LINES 228-241

.. code-block:: Python


    idomain = dis_pkg["idomain"]
    bottom = dis_pkg["bottom"]
    stage = dirty_ds["stage"]
    conductance = dirty_ds["conductance"]
    bottom_elevation = dirty_ds["bottom_elevation"]

    riv_cleaned_dict = imod.prepare.cleanup_riv(
        idomain, bottom, stage, conductance, bottom_elevation
    )

    riv_cleaned_dict





.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    {'stage': <xarray.DataArray 'stage' (layer: 13, y: 200, x: 500)> Size: 5MB
    array([[[      nan,       nan,       nan, ..., 1.4399999, 1.41     ,
             1.39     ],
            [      nan,       nan,       nan, ...,       nan, 1.39     ,
             1.39     ],
            [      nan,       nan,       nan, ...,       nan, 1.0799999,
             0.85     ],
            ...,
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan]],

           [[      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
    ...
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan]],

           [[      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            ...,
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan]]], shape=(13, 200, 500), dtype=float32)
    Coordinates:
      * x        (x) float64 4kB 2.375e+05 2.375e+05 2.376e+05 ... 2.5e+05 2.5e+05
      * y        (y) float64 2kB 5.64e+05 5.64e+05 5.639e+05 ... 5.59e+05 5.59e+05
      * layer    (layer) int32 52B 1 2 3 4 5 6 7 8 9 10 11 12 13
        dx       float64 8B 25.0
        dy       float64 8B -25.0, 'conductance': <xarray.DataArray 'conductance' (layer: 13, y: 200, x: 500)> Size: 5MB
    array([[[  nan,   nan,   nan, ..., 29.86,  2.71, 29.86],
            [  nan,   nan,   nan, ...,   nan,  4.52, 26.24],
            [  nan,   nan,   nan, ...,   nan,  0.9 , 11.67],
            ...,
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]],

           [[  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            ...,
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]],

           [[  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            ...,
    ...
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]],

           [[  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            ...,
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]],

           [[  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            ...,
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]]],
          shape=(13, 200, 500), dtype=float32)
    Coordinates:
      * x        (x) float64 4kB 2.375e+05 2.375e+05 2.376e+05 ... 2.5e+05 2.5e+05
      * y        (y) float64 2kB 5.64e+05 5.64e+05 5.639e+05 ... 5.59e+05 5.59e+05
      * layer    (layer) int32 52B 1 2 3 4 5 6 7 8 9 10 11 12 13
        dx       float64 8B 25.0
        dy       float64 8B -25.0, 'bottom_elevation': <xarray.DataArray 'bottom_elevation' (layer: 13, y: 200, x: 500)> Size: 5MB
    array([[[ nan,  nan,  nan, ..., 1.39, 1.36, 1.34],
            [ nan,  nan,  nan, ...,  nan, 1.34, 1.34],
            [ nan,  nan,  nan, ...,  nan, 1.03, 0.51],
            ...,
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]],

           [[ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            ...,
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]],

           [[ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            ...,
    ...
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]],

           [[ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            ...,
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]],

           [[ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            ...,
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]]],
          shape=(13, 200, 500), dtype=float32)
    Coordinates:
      * x        (x) float64 4kB 2.375e+05 2.375e+05 2.376e+05 ... 2.5e+05 2.5e+05
      * y        (y) float64 2kB 5.64e+05 5.64e+05 5.639e+05 ... 5.59e+05 5.59e+05
      * layer    (layer) int32 52B 1 2 3 4 5 6 7 8 9 10 11 12 13
        dx       float64 8B 25.0
        dy       float64 8B -25.0}



.. GENERATED FROM PYTHON SOURCE LINES 242-244

This returns a dictionary which you can use however you want, and furthermore
feed to the River package.

.. GENERATED FROM PYTHON SOURCE LINES 245-250

.. code-block:: Python


    riv_pkg = imod.mf6.River(**riv_cleaned_dict)

    riv_pkg






.. raw:: html

    <div class="output_subarea output_html rendered_html output_result">
    <div>River</div><div><svg style="position: absolute; width: 0; height: 0; overflow: hidden">
    <defs>
    <symbol id="icon-database" viewBox="0 0 32 32">
    <path d="M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z"></path>
    <path d="M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z"></path>
    <path d="M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z"></path>
    </symbol>
    <symbol id="icon-file-text2" viewBox="0 0 32 32">
    <path d="M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z"></path>
    <path d="M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
    <path d="M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
    <path d="M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z"></path>
    </symbol>
    </defs>
    </svg>
    <style>/* CSS stylesheet for displaying xarray objects in jupyterlab.
     *
     */

    :root {
      --xr-font-color0: var(
        --jp-content-font-color0,
        var(--pst-color-text-base rgba(0, 0, 0, 1))
      );
      --xr-font-color2: var(
        --jp-content-font-color2,
        var(--pst-color-text-base, rgba(0, 0, 0, 0.54))
      );
      --xr-font-color3: var(
        --jp-content-font-color3,
        var(--pst-color-text-base, rgba(0, 0, 0, 0.38))
      );
      --xr-border-color: var(
        --jp-border-color2,
        hsl(from var(--pst-color-on-background, white) h s calc(l - 10))
      );
      --xr-disabled-color: var(
        --jp-layout-color3,
        hsl(from var(--pst-color-on-background, white) h s calc(l - 40))
      );
      --xr-background-color: var(
        --jp-layout-color0,
        var(--pst-color-on-background, white)
      );
      --xr-background-color-row-even: var(
        --jp-layout-color1,
        hsl(from var(--pst-color-on-background, white) h s calc(l - 5))
      );
      --xr-background-color-row-odd: var(
        --jp-layout-color2,
        hsl(from var(--pst-color-on-background, white) h s calc(l - 15))
      );
    }

    html[theme="dark"],
    html[data-theme="dark"],
    body[data-theme="dark"],
    body.vscode-dark {
      --xr-font-color0: var(
        --jp-content-font-color0,
        var(--pst-color-text-base, rgba(255, 255, 255, 1))
      );
      --xr-font-color2: var(
        --jp-content-font-color2,
        var(--pst-color-text-base, rgba(255, 255, 255, 0.54))
      );
      --xr-font-color3: var(
        --jp-content-font-color3,
        var(--pst-color-text-base, rgba(255, 255, 255, 0.38))
      );
      --xr-border-color: var(
        --jp-border-color2,
        hsl(from var(--pst-color-on-background, #111111) h s calc(l + 10))
      );
      --xr-disabled-color: var(
        --jp-layout-color3,
        hsl(from var(--pst-color-on-background, #111111) h s calc(l + 40))
      );
      --xr-background-color: var(
        --jp-layout-color0,
        var(--pst-color-on-background, #111111)
      );
      --xr-background-color-row-even: var(
        --jp-layout-color1,
        hsl(from var(--pst-color-on-background, #111111) h s calc(l + 5))
      );
      --xr-background-color-row-odd: var(
        --jp-layout-color2,
        hsl(from var(--pst-color-on-background, #111111) h s calc(l + 15))
      );
    }

    .xr-wrap {
      display: block !important;
      min-width: 300px;
      max-width: 700px;
    }

    .xr-text-repr-fallback {
      /* fallback to plain text repr when CSS is not injected (untrusted notebook) */
      display: none;
    }

    .xr-header {
      padding-top: 6px;
      padding-bottom: 6px;
      margin-bottom: 4px;
      border-bottom: solid 1px var(--xr-border-color);
    }

    .xr-header > div,
    .xr-header > ul {
      display: inline;
      margin-top: 0;
      margin-bottom: 0;
    }

    .xr-obj-type,
    .xr-array-name {
      margin-left: 2px;
      margin-right: 10px;
    }

    .xr-obj-type {
      color: var(--xr-font-color2);
    }

    .xr-sections {
      padding-left: 0 !important;
      display: grid;
      grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;
    }

    .xr-section-item {
      display: contents;
    }

    .xr-section-item input {
      display: inline-block;
      opacity: 0;
      height: 0;
    }

    .xr-section-item input + label {
      color: var(--xr-disabled-color);
      border: 2px solid transparent !important;
    }

    .xr-section-item input:enabled + label {
      cursor: pointer;
      color: var(--xr-font-color2);
    }

    .xr-section-item input:focus + label {
      border: 2px solid var(--xr-font-color0) !important;
    }

    .xr-section-item input:enabled + label:hover {
      color: var(--xr-font-color0);
    }

    .xr-section-summary {
      grid-column: 1;
      color: var(--xr-font-color2);
      font-weight: 500;
    }

    .xr-section-summary > span {
      display: inline-block;
      padding-left: 0.5em;
    }

    .xr-section-summary-in:disabled + label {
      color: var(--xr-font-color2);
    }

    .xr-section-summary-in + label:before {
      display: inline-block;
      content: "►";
      font-size: 11px;
      width: 15px;
      text-align: center;
    }

    .xr-section-summary-in:disabled + label:before {
      color: var(--xr-disabled-color);
    }

    .xr-section-summary-in:checked + label:before {
      content: "▼";
    }

    .xr-section-summary-in:checked + label > span {
      display: none;
    }

    .xr-section-summary,
    .xr-section-inline-details {
      padding-top: 4px;
      padding-bottom: 4px;
    }

    .xr-section-inline-details {
      grid-column: 2 / -1;
    }

    .xr-section-details {
      display: none;
      grid-column: 1 / -1;
      margin-bottom: 5px;
    }

    .xr-section-summary-in:checked ~ .xr-section-details {
      display: contents;
    }

    .xr-array-wrap {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: 20px auto;
    }

    .xr-array-wrap > label {
      grid-column: 1;
      vertical-align: top;
    }

    .xr-preview {
      color: var(--xr-font-color3);
    }

    .xr-array-preview,
    .xr-array-data {
      padding: 0 5px !important;
      grid-column: 2;
    }

    .xr-array-data,
    .xr-array-in:checked ~ .xr-array-preview {
      display: none;
    }

    .xr-array-in:checked ~ .xr-array-data,
    .xr-array-preview {
      display: inline-block;
    }

    .xr-dim-list {
      display: inline-block !important;
      list-style: none;
      padding: 0 !important;
      margin: 0;
    }

    .xr-dim-list li {
      display: inline-block;
      padding: 0;
      margin: 0;
    }

    .xr-dim-list:before {
      content: "(";
    }

    .xr-dim-list:after {
      content: ")";
    }

    .xr-dim-list li:not(:last-child):after {
      content: ",";
      padding-right: 5px;
    }

    .xr-has-index {
      font-weight: bold;
    }

    .xr-var-list,
    .xr-var-item {
      display: contents;
    }

    .xr-var-item > div,
    .xr-var-item label,
    .xr-var-item > .xr-var-name span {
      background-color: var(--xr-background-color-row-even);
      border-color: var(--xr-background-color-row-odd);
      margin-bottom: 0;
      padding-top: 2px;
    }

    .xr-var-item > .xr-var-name:hover span {
      padding-right: 5px;
    }

    .xr-var-list > li:nth-child(odd) > div,
    .xr-var-list > li:nth-child(odd) > label,
    .xr-var-list > li:nth-child(odd) > .xr-var-name span {
      background-color: var(--xr-background-color-row-odd);
      border-color: var(--xr-background-color-row-even);
    }

    .xr-var-name {
      grid-column: 1;
    }

    .xr-var-dims {
      grid-column: 2;
    }

    .xr-var-dtype {
      grid-column: 3;
      text-align: right;
      color: var(--xr-font-color2);
    }

    .xr-var-preview {
      grid-column: 4;
    }

    .xr-index-preview {
      grid-column: 2 / 5;
      color: var(--xr-font-color2);
    }

    .xr-var-name,
    .xr-var-dims,
    .xr-var-dtype,
    .xr-preview,
    .xr-attrs dt {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      padding-right: 10px;
    }

    .xr-var-name:hover,
    .xr-var-dims:hover,
    .xr-var-dtype:hover,
    .xr-attrs dt:hover {
      overflow: visible;
      width: auto;
      z-index: 1;
    }

    .xr-var-attrs,
    .xr-var-data,
    .xr-index-data {
      display: none;
      border-top: 2px dotted var(--xr-background-color);
      padding-bottom: 20px !important;
      padding-top: 10px !important;
    }

    .xr-var-attrs-in + label,
    .xr-var-data-in + label,
    .xr-index-data-in + label {
      padding: 0 1px;
    }

    .xr-var-attrs-in:checked ~ .xr-var-attrs,
    .xr-var-data-in:checked ~ .xr-var-data,
    .xr-index-data-in:checked ~ .xr-index-data {
      display: block;
    }

    .xr-var-data > table {
      float: right;
    }

    .xr-var-data > pre,
    .xr-index-data > pre,
    .xr-var-data > table > tbody > tr {
      background-color: transparent !important;
    }

    .xr-var-name span,
    .xr-var-data,
    .xr-index-name div,
    .xr-index-data,
    .xr-attrs {
      padding-left: 25px !important;
    }

    .xr-attrs,
    .xr-var-attrs,
    .xr-var-data,
    .xr-index-data {
      grid-column: 1 / -1;
    }

    dl.xr-attrs {
      padding: 0;
      margin: 0;
      display: grid;
      grid-template-columns: 125px auto;
    }

    .xr-attrs dt,
    .xr-attrs dd {
      padding: 0;
      margin: 0;
      float: left;
      padding-right: 10px;
      width: auto;
    }

    .xr-attrs dt {
      font-weight: normal;
      grid-column: 1;
    }

    .xr-attrs dt:hover span {
      display: inline-block;
      background: var(--xr-background-color);
      padding-right: 10px;
    }

    .xr-attrs dd {
      grid-column: 2;
      white-space: pre-wrap;
      word-break: break-all;
    }

    .xr-icon-database,
    .xr-icon-file-text2,
    .xr-no-icon {
      display: inline-block;
      vertical-align: middle;
      width: 1em;
      height: 1.5em !important;
      stroke-width: 0;
      stroke: currentColor;
      fill: currentColor;
    }

    .xr-var-attrs-in:checked + label > .xr-icon-file-text2,
    .xr-var-data-in:checked + label > .xr-icon-database,
    .xr-index-data-in:checked + label > .xr-icon-database {
      color: var(--xr-font-color0);
      filter: drop-shadow(1px 1px 5px var(--xr-font-color2));
      stroke-width: 0.8px;
    }
    </style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt; Size: 16MB
    Dimensions:           (x: 500, y: 200, layer: 13)
    Coordinates:
      * x                 (x) float64 4kB 2.375e+05 2.375e+05 ... 2.5e+05 2.5e+05
      * y                 (y) float64 2kB 5.64e+05 5.64e+05 ... 5.59e+05 5.59e+05
      * layer             (layer) int32 52B 1 2 3 4 5 6 7 8 9 10 11 12 13
        dx                float64 8B 25.0
        dy                float64 8B -25.0
    Data variables:
        stage             (layer, y, x) float32 5MB nan nan nan nan ... nan nan nan
        conductance       (layer, y, x) float32 5MB nan nan nan nan ... nan nan nan
        bottom_elevation  (layer, y, x) float32 5MB nan nan nan nan ... nan nan nan
        print_input       bool 1B False
        print_flows       bool 1B False
        save_flows        bool 1B False
        observations      object 8B None
        repeat_stress     object 8B None</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-29e83379-95d9-4a4a-8c81-c603a84e9a39' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-29e83379-95d9-4a4a-8c81-c603a84e9a39' class='xr-section-summary'  title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>x</span>: 500</li><li><span class='xr-has-index'>y</span>: 200</li><li><span class='xr-has-index'>layer</span>: 13</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-aa11c4e4-525a-4d12-ba11-b8b96fd8cc63' class='xr-section-summary-in' type='checkbox'  checked><label for='section-aa11c4e4-525a-4d12-ba11-b8b96fd8cc63' class='xr-section-summary' >Coordinates: <span>(5)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>x</span></div><div class='xr-var-dims'>(x)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>2.375e+05 2.375e+05 ... 2.5e+05</div><input id='attrs-0c1766b6-ac2a-4578-a39d-f8efdf838109' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-0c1766b6-ac2a-4578-a39d-f8efdf838109' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-89236723-a5bb-42cf-bec7-517b5b20e16c' class='xr-var-data-in' type='checkbox'><label for='data-89236723-a5bb-42cf-bec7-517b5b20e16c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([237512.5, 237537.5, 237562.5, ..., 249937.5, 249962.5, 249987.5],
          shape=(500,))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>y</span></div><div class='xr-var-dims'>(y)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>5.64e+05 5.64e+05 ... 5.59e+05</div><input id='attrs-2b55d13f-035a-4165-b42c-5af9ce776efb' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-2b55d13f-035a-4165-b42c-5af9ce776efb' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-14935d3b-e61f-44a3-b3e8-b0b28688097f' class='xr-var-data-in' type='checkbox'><label for='data-14935d3b-e61f-44a3-b3e8-b0b28688097f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([563987.5, 563962.5, 563937.5, 563912.5, 563887.5, 563862.5, 563837.5,
           563812.5, 563787.5, 563762.5, 563737.5, 563712.5, 563687.5, 563662.5,
           563637.5, 563612.5, 563587.5, 563562.5, 563537.5, 563512.5, 563487.5,
           563462.5, 563437.5, 563412.5, 563387.5, 563362.5, 563337.5, 563312.5,
           563287.5, 563262.5, 563237.5, 563212.5, 563187.5, 563162.5, 563137.5,
           563112.5, 563087.5, 563062.5, 563037.5, 563012.5, 562987.5, 562962.5,
           562937.5, 562912.5, 562887.5, 562862.5, 562837.5, 562812.5, 562787.5,
           562762.5, 562737.5, 562712.5, 562687.5, 562662.5, 562637.5, 562612.5,
           562587.5, 562562.5, 562537.5, 562512.5, 562487.5, 562462.5, 562437.5,
           562412.5, 562387.5, 562362.5, 562337.5, 562312.5, 562287.5, 562262.5,
           562237.5, 562212.5, 562187.5, 562162.5, 562137.5, 562112.5, 562087.5,
           562062.5, 562037.5, 562012.5, 561987.5, 561962.5, 561937.5, 561912.5,
           561887.5, 561862.5, 561837.5, 561812.5, 561787.5, 561762.5, 561737.5,
           561712.5, 561687.5, 561662.5, 561637.5, 561612.5, 561587.5, 561562.5,
           561537.5, 561512.5, 561487.5, 561462.5, 561437.5, 561412.5, 561387.5,
           561362.5, 561337.5, 561312.5, 561287.5, 561262.5, 561237.5, 561212.5,
           561187.5, 561162.5, 561137.5, 561112.5, 561087.5, 561062.5, 561037.5,
           561012.5, 560987.5, 560962.5, 560937.5, 560912.5, 560887.5, 560862.5,
           560837.5, 560812.5, 560787.5, 560762.5, 560737.5, 560712.5, 560687.5,
           560662.5, 560637.5, 560612.5, 560587.5, 560562.5, 560537.5, 560512.5,
           560487.5, 560462.5, 560437.5, 560412.5, 560387.5, 560362.5, 560337.5,
           560312.5, 560287.5, 560262.5, 560237.5, 560212.5, 560187.5, 560162.5,
           560137.5, 560112.5, 560087.5, 560062.5, 560037.5, 560012.5, 559987.5,
           559962.5, 559937.5, 559912.5, 559887.5, 559862.5, 559837.5, 559812.5,
           559787.5, 559762.5, 559737.5, 559712.5, 559687.5, 559662.5, 559637.5,
           559612.5, 559587.5, 559562.5, 559537.5, 559512.5, 559487.5, 559462.5,
           559437.5, 559412.5, 559387.5, 559362.5, 559337.5, 559312.5, 559287.5,
           559262.5, 559237.5, 559212.5, 559187.5, 559162.5, 559137.5, 559112.5,
           559087.5, 559062.5, 559037.5, 559012.5])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>layer</span></div><div class='xr-var-dims'>(layer)</div><div class='xr-var-dtype'>int32</div><div class='xr-var-preview xr-preview'>1 2 3 4 5 6 7 8 9 10 11 12 13</div><input id='attrs-3d4eea0e-0d12-4aa9-af87-9d25aeaf1c38' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-3d4eea0e-0d12-4aa9-af87-9d25aeaf1c38' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ed03650c-fc28-410e-9de3-fef6e77c8240' class='xr-var-data-in' type='checkbox'><label for='data-ed03650c-fc28-410e-9de3-fef6e77c8240' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13], dtype=int32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>dx</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>25.0</div><input id='attrs-29dd6bdd-45aa-4265-b4e5-54e264214715' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-29dd6bdd-45aa-4265-b4e5-54e264214715' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-04be9653-9ca3-4ac5-b8ee-56df0973d9a0' class='xr-var-data-in' type='checkbox'><label for='data-04be9653-9ca3-4ac5-b8ee-56df0973d9a0' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(25.)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>dy</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-25.0</div><input id='attrs-1ec76ec6-0549-41fb-93ed-7fe9e6d56ea1' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1ec76ec6-0549-41fb-93ed-7fe9e6d56ea1' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-de93e5c2-faa6-41d5-85f2-cdc15071edc1' class='xr-var-data-in' type='checkbox'><label for='data-de93e5c2-faa6-41d5-85f2-cdc15071edc1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(-25.)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-f06f0c1d-5201-4b5d-9f7e-fdd820ece6ae' class='xr-section-summary-in' type='checkbox'  checked><label for='section-f06f0c1d-5201-4b5d-9f7e-fdd820ece6ae' class='xr-section-summary' >Data variables: <span>(8)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>stage</span></div><div class='xr-var-dims'>(layer, y, x)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-e0bef57c-bd81-47f8-900c-3c2c693760f4' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-e0bef57c-bd81-47f8-900c-3c2c693760f4' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-92902f48-0f80-47a3-9994-dca7d070f2bc' class='xr-var-data-in' type='checkbox'><label for='data-92902f48-0f80-47a3-9994-dca7d070f2bc' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[      nan,       nan,       nan, ..., 1.4399999, 1.41     ,
             1.39     ],
            [      nan,       nan,       nan, ...,       nan, 1.39     ,
             1.39     ],
            [      nan,       nan,       nan, ...,       nan, 1.0799999,
             0.85     ],
            ...,
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan]],

           [[      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
    ...
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan]],

           [[      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            ...,
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan],
            [      nan,       nan,       nan, ...,       nan,       nan,
                   nan]]], shape=(13, 200, 500), dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>conductance</span></div><div class='xr-var-dims'>(layer, y, x)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-7d8a62a4-79e2-435d-a2b8-65904cb4dc79' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-7d8a62a4-79e2-435d-a2b8-65904cb4dc79' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-67220128-d184-4fd5-bf0e-7e630053802f' class='xr-var-data-in' type='checkbox'><label for='data-67220128-d184-4fd5-bf0e-7e630053802f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[  nan,   nan,   nan, ..., 29.86,  2.71, 29.86],
            [  nan,   nan,   nan, ...,   nan,  4.52, 26.24],
            [  nan,   nan,   nan, ...,   nan,  0.9 , 11.67],
            ...,
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]],

           [[  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            ...,
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]],

           [[  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            ...,
    ...
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]],

           [[  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            ...,
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]],

           [[  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            ...,
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan],
            [  nan,   nan,   nan, ...,   nan,   nan,   nan]]],
          shape=(13, 200, 500), dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>bottom_elevation</span></div><div class='xr-var-dims'>(layer, y, x)</div><div class='xr-var-dtype'>float32</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-35e50766-9bed-4eda-ad8c-a8f2609dbad5' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-35e50766-9bed-4eda-ad8c-a8f2609dbad5' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-4eb62bc3-fd78-44e9-8228-b3ac28176b9d' class='xr-var-data-in' type='checkbox'><label for='data-4eb62bc3-fd78-44e9-8228-b3ac28176b9d' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[ nan,  nan,  nan, ..., 1.39, 1.36, 1.34],
            [ nan,  nan,  nan, ...,  nan, 1.34, 1.34],
            [ nan,  nan,  nan, ...,  nan, 1.03, 0.51],
            ...,
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]],

           [[ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            ...,
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]],

           [[ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            ...,
    ...
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]],

           [[ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            ...,
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]],

           [[ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            ...,
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan],
            [ nan,  nan,  nan, ...,  nan,  nan,  nan]]],
          shape=(13, 200, 500), dtype=float32)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>print_input</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>bool</div><div class='xr-var-preview xr-preview'>False</div><input id='attrs-1bea2215-3bb3-402b-913f-5f338bc90017' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1bea2215-3bb3-402b-913f-5f338bc90017' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6f984d48-56f0-40fc-8dd8-ec05a15ece40' class='xr-var-data-in' type='checkbox'><label for='data-6f984d48-56f0-40fc-8dd8-ec05a15ece40' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(False)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>print_flows</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>bool</div><div class='xr-var-preview xr-preview'>False</div><input id='attrs-836bd9d9-d967-47f2-93cd-bb6e41008de3' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-836bd9d9-d967-47f2-93cd-bb6e41008de3' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-a2701c67-2ea8-40a8-adae-e73d8ea5268b' class='xr-var-data-in' type='checkbox'><label for='data-a2701c67-2ea8-40a8-adae-e73d8ea5268b' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(False)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>save_flows</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>bool</div><div class='xr-var-preview xr-preview'>False</div><input id='attrs-1e08b882-2ade-4192-88a4-1fcfa1892350' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-1e08b882-2ade-4192-88a4-1fcfa1892350' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f71fe0d5-b0d5-46be-be38-29c440b1cea5' class='xr-var-data-in' type='checkbox'><label for='data-f71fe0d5-b0d5-46be-be38-29c440b1cea5' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(False)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>observations</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>None</div><input id='attrs-3658f475-460d-45bf-857f-038f6068a107' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-3658f475-460d-45bf-857f-038f6068a107' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ae2eaa6a-aef6-4ad1-8e06-8f8cfab5c424' class='xr-var-data-in' type='checkbox'><label for='data-ae2eaa6a-aef6-4ad1-8e06-8f8cfab5c424' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(None, dtype=object)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>repeat_stress</span></div><div class='xr-var-dims'>()</div><div class='xr-var-dtype'>object</div><div class='xr-var-preview xr-preview'>None</div><input id='attrs-09832a54-e9d2-4f73-af35-3cf3fd621a83' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-09832a54-e9d2-4f73-af35-3cf3fd621a83' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b5b532f5-f142-4d9e-92ba-12ba1d9bf2d6' class='xr-var-data-in' type='checkbox'><label for='data-b5b532f5-f142-4d9e-92ba-12ba1d9bf2d6' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array(None, dtype=object)</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-94fb0946-9b08-4373-a6a0-706c43ba9530' class='xr-section-summary-in' type='checkbox'  ><label for='section-94fb0946-9b08-4373-a6a0-706c43ba9530' class='xr-section-summary' >Indexes: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>x</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-8565ade8-cb22-4214-bc62-e269d2d4109b' class='xr-index-data-in' type='checkbox'/><label for='index-8565ade8-cb22-4214-bc62-e269d2d4109b' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([237512.5, 237537.5, 237562.5, 237587.5, 237612.5, 237637.5, 237662.5,
           237687.5, 237712.5, 237737.5,
           ...
           249762.5, 249787.5, 249812.5, 249837.5, 249862.5, 249887.5, 249912.5,
           249937.5, 249962.5, 249987.5],
          dtype=&#x27;float64&#x27;, name=&#x27;x&#x27;, length=500))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>y</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-3c04d2bd-f389-4821-9eb5-ecea47a46a0d' class='xr-index-data-in' type='checkbox'/><label for='index-3c04d2bd-f389-4821-9eb5-ecea47a46a0d' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([563987.5, 563962.5, 563937.5, 563912.5, 563887.5, 563862.5, 563837.5,
           563812.5, 563787.5, 563762.5,
           ...
           559237.5, 559212.5, 559187.5, 559162.5, 559137.5, 559112.5, 559087.5,
           559062.5, 559037.5, 559012.5],
          dtype=&#x27;float64&#x27;, name=&#x27;y&#x27;, length=200))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>layer</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-73bc4e7e-39d9-4a9b-803c-0dedfe6a7da1' class='xr-index-data-in' type='checkbox'/><label for='index-73bc4e7e-39d9-4a9b-803c-0dedfe6a7da1' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], dtype=&#x27;int32&#x27;, name=&#x27;layer&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-31a56b9b-f494-4a4e-88ed-89e9bf512414' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-31a56b9b-f494-4a4e-88ed-89e9bf512414' class='xr-section-summary'  title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>
    </div>
    <br />
    <br />


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 2.974 seconds)


.. _sphx_glr_download_user-guide_10-cleanup.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: 10-cleanup.ipynb <10-cleanup.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: 10-cleanup.py <10-cleanup.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: 10-cleanup.zip <10-cleanup.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_