.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_examples/02_simple_inversion/plot_09_individual_errors.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__examples_02_simple_inversion_plot_09_individual_errors.py: Using individual data errors in CRTomo ====================================== In principle an individual data error can be assigned to each data point. However, since data errors are not easily determined in geoelectrical applications, it is common to employ various data error models that exploit empirically observed relationships between the data errors and the measurements themselves. .. GENERATED FROM PYTHON SOURCE LINES 13-14 Setup: .. GENERATED FROM PYTHON SOURCE LINES 14-24 .. code-block:: Python import numpy as np import crtomo mesh = crtomo.crt_grid.create_surface_grid(nr_electrodes=10, spacing=1) tdm = crtomo.tdMan(grid=mesh) tdm.add_homogeneous_model(100, 0) tdm.configs.gen_dipole_dipole(skipc=0) measurements = tdm.measurements() .. rst-class:: sphx-glr-script-out .. code-block:: none This grid was sorted using CutMcK. The nodes were resorted! Triangular grid found attempting modeling b'\nlibgomp: Invalid value for environment variable OMP_NUM_THREADS\n ######### CMod ############\nLicence:\nCopyright \xc2\xa9 1990-2020 Andreas Kemna \nCopyright \xc2\xa9 2008-2020 CRTomo development team (see AUTHORS file)\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \xe2\x80\x9cSoftware\xe2\x80\x9d), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \xe2\x80\x9cAS IS\xe2\x80\x9d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n \n \n CRMod Process_ID :: 5351\n OpenMP max threads: 4\n Git-Branch master\n Commit-ID cb89ccd2c4341b9b08bbe7bb08f5aea0d60916ee\n Created Mon-Mar-25-14:34:56-2024\n Compiler \n OS GNU/Linux\n\n Reading Input-Files\n++ check 1\r++ check 2 done!\n\rGetting voltage 1\rGetting voltage 2\rGetting voltage 3\rGetting voltage 4\rGetting voltage 5\rGetting voltage 6\rGetting voltage 7\rGetting voltage 8\rGetting voltage 9\rGetting voltage 10\rGetting voltage 11\rGetting voltage 12\rGetting voltage 13\rGetting voltage 14\rGetting voltage 15\rGetting voltage 16\rGetting voltage 17\rGetting voltage 18\rGetting voltage 19\rGetting voltage 20\rGetting voltage 21\rGetting voltage 22\rGetting voltage 23\rGetting voltage 24\rGetting voltage 25\rGetting voltage 26\rGetting voltage 27\rGetting voltage 28 No electrode cap file\n \n Rescheduling..\n less nodes than wavenumbers\n OpenMP threads: 3( 4)\n\n\r Calculating Potentials : Wavenumber 1 \r Calculating Potentials : Wavenumber 2 \r Calculating Potentials : Wavenumber 3 \r Calculating Potentials : Wavenumber 4 \r Calculating Potentials : Wavenumber 6 \r Calculating Potentials : Wavenumber 6 \r Calculating Potentials : Wavenumber 7 \r Calculating Potentials : Wavenumber 9 \r Calculating Potentials : Wavenumber 9 done, now processing\n solution time 0d/ 0h/ 0m/ 0s/ 29ms\n\n Modelling completedSTOP 0\n' reading voltages .. GENERATED FROM PYTHON SOURCE LINES 25-26 Determine individual errors in some meaningful way .. GENERATED FROM PYTHON SOURCE LINES 26-29 .. code-block:: Python mag_errors = np.arange(0, measurements.shape[0]) + 1 pha_errors = np.arange(0, measurements.shape[0]) + 1000 .. GENERATED FROM PYTHON SOURCE LINES 30-31 Register them .. GENERATED FROM PYTHON SOURCE LINES 31-38 .. code-block:: Python tdm.register_data_errors( tdm.configs.add_measurements(mag_errors), tdm.configs.add_measurements(pha_errors), norm_mag=1, norm_pha=1, ) .. GENERATED FROM PYTHON SOURCE LINES 39-40 Note that the volt.dat will look slightly different now .. GENERATED FROM PYTHON SOURCE LINES 40-41 .. code-block:: Python tdm.save_to_tomodir('td_test') .. _sphx_glr_download__examples_02_simple_inversion_plot_09_individual_errors.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_09_individual_errors.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_09_individual_errors.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_09_individual_errors.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_