.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/data_processing/data_smoothing.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_data_processing_data_smoothing.py: Data Smoothing ============== This example shows how to smooth a dataset. .. GENERATED FROM PYTHON SOURCE LINES 9-10 Load the data .. GENERATED FROM PYTHON SOURCE LINES 10-20 .. code-block:: Python import lumispy as lum cl1 = lum.data.asymmetric_peak_map() cl1 = cl1.remove_background(signal_range=(550.0, 620.0), background_type="Offset") cl1 = cl1.isig[:-3] cl1.spikes_removal_tool(interactive=False) cl2 = cl1.deepcopy() cl3 = cl1.deepcopy() .. GENERATED FROM PYTHON SOURCE LINES 21-22 Display the original data .. GENERATED FROM PYTHON SOURCE LINES 22-25 .. code-block:: Python cl1.inav[0, 0].plot() .. image-sg:: /auto_examples/data_processing/images/sphx_glr_data_smoothing_001.png :alt: 880_30K_map2a Signal :srcset: /auto_examples/data_processing/images/sphx_glr_data_smoothing_001.png, /auto_examples/data_processing/images/sphx_glr_data_smoothing_001_5_00x.png 5.00x :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 26-29 The current dataset is quite noisy. One way to improve that is by smoothing the data using :py:meth:`hyperspy.api.signals.Signal1D.smooth_lowess` (see docstring for detailed explanation of the parameters). .. GENERATED FROM PYTHON SOURCE LINES 29-34 .. code-block:: Python cl1.smooth_lowess(smoothing_parameter=0.1, number_of_iterations=2) cl1.inav[0, 0].plot() .. image-sg:: /auto_examples/data_processing/images/sphx_glr_data_smoothing_002.png :alt: 880_30K_map2a Signal :srcset: /auto_examples/data_processing/images/sphx_glr_data_smoothing_002.png, /auto_examples/data_processing/images/sphx_glr_data_smoothing_002_5_00x.png 5.00x :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none 0%| | 0/16 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: data_smoothing.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: data_smoothing.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_