.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_icl_sandstones_carbonates_2009_example.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_icl_sandstones_carbonates_2009_example.py: Imperial College London Sandstones & Carbonates 2009 Dataset ========================= This example shows how we can load an image from the Imperial College London Sandstones & Carbonates 2009 dataset. .. GENERATED FROM PYTHON SOURCE LINES 8-11 .. code-block:: default from drd.datasets.icl_sandstones_carbonates_2009 import load_icl_sandstones_carbonates_2009 import matplotlib.pyplot as plt .. GENERATED FROM PYTHON SOURCE LINES 12-18 Loading the Image ------------------------ We will use one of the utility functions called `load_icl_sandstones_carbonates_2009` to generate an xarray DataArray which already contains all the spatial axis information and scaling preconfigured. This way we will have a proper definition of the image data in terms of a spatial coordinate system. .. GENERATED FROM PYTHON SOURCE LINES 18-23 .. code-block:: default img = load_icl_sandstones_carbonates_2009("Berea") # This is the end of the 'code block' (if using an above IDE). All code within # this block can be easily executed all at once. .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Using downloaded and verified file: /home/runner/drd_data/Berea.7z .. GENERATED FROM PYTHON SOURCE LINES 24-27 Plotting the Image Data using xarray ------------------------ We will use xarray's ability to summarize or select our data to plot an average over the z dimension. .. GENERATED FROM PYTHON SOURCE LINES 27-31 .. code-block:: default img.mean(dim='z').plot() plt.tight_layout() plt.show() .. image-sg:: /auto_examples/images/sphx_glr_plot_icl_sandstones_carbonates_2009_example_001.png :alt: plot icl sandstones carbonates 2009 example :srcset: /auto_examples/images/sphx_glr_plot_icl_sandstones_carbonates_2009_example_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 32-33 We can clearly see how we first downloaded the image data from the web and subsequently compute an average over the micro-ct image dataset. .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.936 seconds) .. _sphx_glr_download_auto_examples_plot_icl_sandstones_carbonates_2009_example.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_icl_sandstones_carbonates_2009_example.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_icl_sandstones_carbonates_2009_example.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_