.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "source/auto_examples/plot_psd.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_source_auto_examples_plot_psd.py: Example on plotting particle concentration data timeseries ---------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 6-19 .. image-sg:: /source/auto_examples/images/sphx_glr_plot_psd_001.png :alt: plot psd :srcset: /source/auto_examples/images/sphx_glr_plot_psd_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/PySP2/PySP2/pysp2/util/peak_fit.py:470: RuntimeWarning: divide by zero encountered in divide peak2area = np.max(data2, axis=1)/denominator Processing record 0 /home/runner/work/PySP2/PySP2/pysp2/util/peak_fit.py:384: OptimizeWarning: Covariance of the parameters could not be estimated coeff, var_matrix = curve_fit(_gaus, bins_fit, data_fit, p0=p0, method='lm', maxfev=40, ftol=1e-3) /home/runner/work/PySP2/PySP2/pysp2/util/peak_fit.py:564: OptimizeWarning: Covariance of the parameters could not be estimated coeff, var_matrix = curve_fit(_gaus, bins_fit, temp1_fit, p0=p0, method='lm', maxfev=50, ftol=1e-3) Processing record 1000 Processing record 2000 Processing record 3000 Processing record 4000 Processing record 5000 /home/runner/work/PySP2/PySP2/pysp2/util/peak_fit.py:78: RuntimeWarning: Mean of empty slice ratio = np.nanmean( 5877 records processed in 5.879107475280762 s /home/runner/work/PySP2/PySP2/pysp2/util/particle_properties.py:38: RuntimeWarning: All-NaN slice encountered PkHt_ch0 = np.nanmax(np.stack([input_ds['PkHt_ch0'].values, input_ds['FtAmp_ch0'].values]), axis=0) /home/runner/work/PySP2/PySP2/pysp2/util/particle_properties.py:39: RuntimeWarning: All-NaN slice encountered PkHt_ch4 = np.nanmax(np.stack([input_ds['PkHt_ch4'].values, input_ds['FtAmp_ch4'].values]), axis=0) Number of scattering particles accepted = 4799 Number of scattering particles rejected for min. peak height = 11 Number of scattering particles rejected for peak width = 16 Number of scattering particles rejected for fat peak = 0 Number of scattering particles rejected for peak pos. = 91 | .. code-block:: Python import matplotlib.pyplot as plt import pysp2 my_sp2b = pysp2.io.read_sp2(pysp2.testing.EXAMPLE_SP2B) my_ini = pysp2.io.read_config(pysp2.testing.EXAMPLE_INI) my_binary = pysp2.util.gaussian_fit(my_sp2b, my_ini) my_hk = pysp2.io.read_hk_file(pysp2.testing.EXAMPLE_HK) my_binary = pysp2.util.calc_diams_masses(my_binary) my_psds = pysp2.util.process_psds(my_binary, my_hk, my_ini) my_psds['NumConcIncan'].plot() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 9.444 seconds) .. _sphx_glr_download_source_auto_examples_plot_psd.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_psd.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_psd.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_psd.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_