.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_basic_indentation.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_basic_indentation.py: Basic Indentation Analysis ========================== This example analyses a FischerScope HDF5 file and plots each indentation curve. .. GENERATED FROM PYTHON SOURCE LINES 8-20 .. code-block:: Python from pathlib import Path import matplotlib.pyplot as plt import pandas as pd import micromechanics from micromechanics.indentation import Indentation, Tip repository_root = Path(micromechanics.__file__).resolve().parents[1] file_name = repository_root / "examples" / "FischerScope" / "N1_1.hdf5" .. GENERATED FROM PYTHON SOURCE LINES 21-23 Define the tip and load the measurement file. The material Poisson ratio enters the conversion from reduced modulus to Young's modulus. .. GENERATED FROM PYTHON SOURCE LINES 23-28 .. code-block:: Python tip = Tip() indentation = Indentation(str(file_name), nuMat=0.5, tip=tip) rows = [] .. rst-class:: sphx-glr-script-out .. code-block:: none Open hdf5-file: /home/runner/work/micromechanics/micromechanics/examples/FischerScope/N1_1.hdf5 .. GENERATED FROM PYTHON SOURCE LINES 29-31 Each iteration selects the next indentation test. ``analyse`` performs the Oliver-Pharr evaluation and stores the resulting values in ``metaUser``. .. GENERATED FROM PYTHON SOURCE LINES 31-37 .. code-block:: Python for testname in indentation: indentation.analyse() plt.plot(indentation.h, indentation.p, label=testname) rows.append(indentation.metaUser.copy()) .. image-sg:: /auto_examples/images/sphx_glr_plot_basic_indentation_001.png :alt: plot basic indentation :srcset: /auto_examples/images/sphx_glr_plot_basic_indentation_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 38-40 The force-depth plot gives a quick visual check for repeated measurements, while the dataframe collects the numerical metadata for inspection or export. .. GENERATED FROM PYTHON SOURCE LINES 40-47 .. code-block:: Python plt.xlabel("Depth / um") plt.ylabel("Load / mN") plt.legend() df = pd.DataFrame(rows) print(df) .. image-sg:: /auto_examples/images/sphx_glr_plot_basic_indentation_002.png :alt: plot basic indentation :srcset: /auto_examples/images/sphx_glr_plot_basic_indentation_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/micromechanics/micromechanics/docs/source/examples/plot_basic_indentation.py:43: UserWarning: No artists with labels found to put in legend. Note that artists whose label start with an underscore are ignored when legend() is called with no argument. plt.legend() measurementType S_mN/um ... segment code 0 Fischer Scope Indentation HDF5 [14.35122316486651] ... [1] main.py 1 Fischer Scope Indentation HDF5 [15.745680750614438] ... [1] main.py 2 Fischer Scope Indentation HDF5 [15.90439805730888] ... [1] main.py 3 Fischer Scope Indentation HDF5 [16.09010295147651] ... [1] main.py 4 Fischer Scope Indentation HDF5 [15.759372606477493] ... [1] main.py 5 Fischer Scope Indentation HDF5 [15.862357777910967] ... [1] main.py 6 Fischer Scope Indentation HDF5 [15.871862721628293] ... [1] main.py 7 Fischer Scope Indentation HDF5 [15.996196579279452] ... [1] main.py 8 Fischer Scope Indentation HDF5 [15.24746967801729] ... [1] main.py 9 Fischer Scope Indentation HDF5 [15.376666240263122] ... [1] main.py 10 Fischer Scope Indentation HDF5 [16.09475997375254] ... [1] main.py 11 Fischer Scope Indentation HDF5 [15.181851666496254] ... [1] main.py 12 Fischer Scope Indentation HDF5 [15.703335447957938] ... [1] main.py 13 Fischer Scope Indentation HDF5 [15.990322177801245] ... [1] main.py 14 Fischer Scope Indentation HDF5 [16.191081893635452] ... [1] main.py 15 Fischer Scope Indentation HDF5 [15.072117198490727] ... [1] main.py [16 rows x 11 columns] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.688 seconds) .. _sphx_glr_download_auto_examples_plot_basic_indentation.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_basic_indentation.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_basic_indentation.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_basic_indentation.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_