.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_surface_detection.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_surface_detection.py: Indentation Surface Detection ============================= This example loads a FischerScope HDF5 file with surface detection enabled. .. GENERATED FROM PYTHON SOURCE LINES 7-16 .. code-block:: Python from pathlib import Path import micromechanics from micromechanics.indentation import Indentation repository_root = Path(micromechanics.__file__).resolve().parents[1] file_name = repository_root / "examples/FischerScope/N1_1.hdf5" .. GENERATED FROM PYTHON SOURCE LINES 17-19 Inspect the raw file first. The initial depth and force offsets show why a surface correction is needed before comparing indentation curves. .. GENERATED FROM PYTHON SOURCE LINES 19-23 .. code-block:: Python indentation = Indentation(str(file_name), nuMat=0.45) indentation.plot() .. image-sg:: /auto_examples/images/sphx_glr_plot_surface_detection_001.png :alt: plot surface detection :srcset: /auto_examples/images/sphx_glr_plot_surface_detection_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Open hdf5-file: /home/runner/work/micromechanics/micromechanics/examples/FischerScope/N1_1.hdf5 Run analyse() to show the full data. .. GENERATED FROM PYTHON SOURCE LINES 24-27 Use a load threshold to define the contact point. This shifts the depth axis so contact starts at zero, but it intentionally leaves the load signal unchanged. Other surface criteria and filters can be selected through the same dictionary. .. GENERATED FROM PYTHON SOURCE LINES 27-31 .. code-block:: Python indentation = Indentation(str(file_name), nuMat=0.45, surface={"load": 0.1}) indentation.plot() .. image-sg:: /auto_examples/images/sphx_glr_plot_surface_detection_002.png :alt: plot surface detection :srcset: /auto_examples/images/sphx_glr_plot_surface_detection_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Open hdf5-file: /home/runner/work/micromechanics/micromechanics/examples/FischerScope/N1_1.hdf5 Run analyse() to show the full data. .. GENERATED FROM PYTHON SOURCE LINES 32-35 Add ``tare load`` when the force should also be shifted to zero at contact. This is useful for plots where both axes should represent values relative to first contact. .. GENERATED FROM PYTHON SOURCE LINES 35-38 .. code-block:: Python indentation = Indentation(str(file_name), nuMat=0.45, surface={"load": 0.1, "tare load": True}) indentation.plot() .. image-sg:: /auto_examples/images/sphx_glr_plot_surface_detection_003.png :alt: plot surface detection :srcset: /auto_examples/images/sphx_glr_plot_surface_detection_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Open hdf5-file: /home/runner/work/micromechanics/micromechanics/examples/FischerScope/N1_1.hdf5 Run analyse() to show the full data. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.196 seconds) .. _sphx_glr_download_auto_examples_plot_surface_detection.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_surface_detection.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_surface_detection.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_surface_detection.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_