.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_examples/Basic_Plots/solo_sis_plot_multi_species.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_Basic_Plots_solo_sis_plot_multi_species.py: Plot SIS Timeseries (multiple species) -------------------------------------- In this example, we use solo_sis_loader's package to plot timeseries SIS data. .. GENERATED FROM PYTHON SOURCE LINES 9-10 Import Required Modules .. GENERATED FROM PYTHON SOURCE LINES 10-20 .. code-block:: Python from datetime import datetime import matplotlib.dates as mdates import matplotlib.pyplot as plt import numpy as np import sunpy.net.attrs as a from solo_sis_loader import SIS .. GENERATED FROM PYTHON SOURCE LINES 21-32 .. code-block:: Python t_start = '2022-09-04' t_end = '2022-09-08' stime = a.Time(t_start, t_end) level = a.Level('L2') sis = SIS() response = sis.search(stime, level=level) files = sis.fetch(response) sis.load(files) .. rst-class:: sphx-glr-script-out .. code-block:: none Files Downloaded: 0%| | 0/5 [00:00 Size: 3MB Dimensions: (time: 14400, energy: 16) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 64B 0.0765 0.1033 0.1402 ... 6.169 8.731 12.18 Data variables: flux (time, energy) float32 922kB 0.0 0.0 nan 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 922kB 0.0 0.0 -1e+31 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 922kB 0.0 0.0 -1e+31 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: C axis_title: EPD-SIS-A (C-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [ 0.0649 0.0881 0.1185 0.162 0.2258 0.3164 0.4... energy_bin_width: [0.0232 0.0304 0.0435 0.0638 0.0906 0.1323 0.182 0.2... energy_bin_text: ['0.0649 - 0.0881 MeV/n' '0.0881 - 0.1185 MeV/n' '0.1..., 'Ca': Size: 3MB Dimensions: (time: 14400, energy: 16) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 64B 0.0589 0.0841 0.1209 ... 6.226 8.782 11.45 Data variables: flux (time, energy) float32 922kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 922kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 922kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: Ca axis_title: EPD-SIS-A (Ca-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [ 0.0485 0.0693 0.0989 0.1429 0.2096 0.3116 0.4... energy_bin_width: [0.0208 0.0296 0.044 0.0667 0.102 0.1466 0.1941 0.2... energy_bin_text: ['0.0485 - 0.0693 MeV/n' '0.0693 - 0.0989 MeV/n' '0.0..., 'Fe': Size: 3MB Dimensions: (time: 14400, energy: 15) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 60B 0.04735 0.07025 0.1062 ... 6.233 8.791 Data variables: flux (time, energy) float32 864kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 864kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 864kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: Fe axis_title: EPD-SIS-A (Fe-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [0.0384 0.0563 0.0842 0.1281 0.1968 0.2973 0.4447 0.6... energy_bin_width: [0.0179 0.0279 0.0439 0.0687 0.1005 0.1474 0.1963 0.2... energy_bin_text: ['0.0384 - 0.0563 MeV/n' '0.0563 - 0.0842 MeV/n' '0.0..., 'H': Size: 2MB Dimensions: (time: 14400, energy: 11) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 44B 0.2676 0.3604 0.5015 ... 4.325 6.142 8.303 Data variables: flux (time, energy) float32 634kB 62.96 101.3 60.22 ... 2.982 4.723 uncertainty (time, energy) float32 634kB 25.7 23.87 17.38 ... 2.982 4.723 rate (time, energy) float32 634kB 0.2 0.6 0.4 ... 0.03333 0.03333 Attributes: (12/14) instrument: telescope: A specie: H axis_title: EPD-SIS-A (H-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV) energy_low: [0.2315 0.3037 0.4172 0.5858 0.8422 1.216 1.75 2.5... energy_bin_width: [0.0722 0.1135 0.1686 0.2564 0.3738 0.534 0.753 1.0... energy_bin_text: ['0.2315 - 0.3037 MeV/n' '0.3037 - 0.4172 MeV/n' '0.4..., 'He3': Size: 2MB Dimensions: (time: 14400, energy: 12) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 48B 0.2054 0.2734 0.3738 ... 4.33 6.147 8.715 Data variables: flux (time, energy) float32 691kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 691kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 691kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: He3 axis_title: EPD-SIS-A (He3-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [0.1786 0.2323 0.3145 0.4332 0.6049 0.8599 1.23 1.7... energy_bin_width: [0.0537 0.0822 0.1187 0.1717 0.255 0.3701 0.53 0.7... energy_bin_text: ['0.1786 - 0.2323 MeV/n' '0.2323 - 0.3145 MeV/n' '0.3..., 'He4': Size: 2MB Dimensions: (time: 14400, energy: 13) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 52B 0.1379 0.1845 0.2522 ... 4.325 6.143 8.35 Data variables: flux (time, energy) float32 749kB nan 20.53 8.013 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 749kB -1e+31 9.183 4.627 ... 0.0 0.0 0.0 rate (time, energy) float32 749kB -1e+31 0.1667 0.1 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: He4 axis_title: EPD-SIS-A (He4-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [0.1179 0.1578 0.2112 0.2933 0.4117 0.586 0.8438 1.2... energy_bin_width: [0.0399 0.0534 0.0821 0.1184 0.1743 0.2578 0.3742 0.5... energy_bin_text: ['0.1179 - 0.1578 MeV/n' '0.1578 - 0.2112 MeV/n' '0.2..., 'Mg': Size: 3MB Dimensions: (time: 14400, energy: 16) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 64B 0.05885 0.08605 0.126 ... 8.753 12.19 Data variables: flux (time, energy) float32 922kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 922kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 922kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: Mg axis_title: EPD-SIS-A (Mg-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [ 0.0475 0.0702 0.1019 0.1501 0.218 0.3173 0.4... energy_bin_width: [0.0227 0.0317 0.0482 0.0679 0.0993 0.1414 0.1911 0.2... energy_bin_text: ['0.0475 - 0.0702 MeV/n' '0.0702 - 0.1019 MeV/n' '0.1..., 'N': Size: 3MB Dimensions: (time: 14400, energy: 16) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 64B 0.07395 0.1016 0.139 ... 6.175 8.738 12.18 Data variables: flux (time, energy) float32 922kB 0.0 0.0 nan 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 922kB 0.0 0.0 -1e+31 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 922kB 0.0 0.0 -1e+31 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: N axis_title: EPD-SIS-A (N-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [ 0.0618 0.0861 0.1172 0.1607 0.2216 0.3178 0.4... energy_bin_width: [0.0243 0.0311 0.0435 0.0609 0.0962 0.1311 0.1861 0.2... energy_bin_text: ['0.0618 - 0.0861 MeV/n' '0.0861 - 0.1172 MeV/n' '0.1..., 'Ne': Size: 3MB Dimensions: (time: 14400, energy: 16) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 64B 0.06485 0.0916 0.129 ... 6.191 8.75 12.19 Data variables: flux (time, energy) float32 922kB 0.0 0.0 nan 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 922kB 0.0 0.0 -1e+31 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 922kB 0.0 0.0 -1e+31 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: Ne axis_title: EPD-SIS-A (Ne-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [ 0.0534 0.0763 0.1069 0.1511 0.214 0.3126 0.4... energy_bin_width: [0.0229 0.0306 0.0442 0.0629 0.0986 0.1401 0.1904 0.2... energy_bin_text: ['0.0534 - 0.0763 MeV/n' '0.0763 - 0.1069 MeV/n' '0.1..., 'O': Size: 3MB Dimensions: (time: 14400, energy: 16) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 64B 0.0683 0.09655 0.1365 ... 8.741 12.18 Data variables: flux (time, energy) float32 922kB 0.0 0.0 nan 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 922kB 0.0 0.0 -1e+31 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 922kB 0.0 0.0 -1e+31 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: O axis_title: EPD-SIS-A (O-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [ 0.0566 0.08 0.1131 0.16 0.2263 0.32 0.4... energy_bin_width: [0.0234 0.0331 0.0469 0.0663 0.0937 0.1325 0.1875 0.2... energy_bin_text: ['0.0566 - 0.0800 MeV/n' '0.0800 - 0.1131 MeV/n' '0.1..., 'S': Size: 3MB Dimensions: (time: 14400, energy: 17) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 68B 0.04535 0.0606 0.0858 ... 8.771 11.95 Data variables: flux (time, energy) float32 979kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 979kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 979kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: S axis_title: EPD-SIS-A (S-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [ 0.0404 0.0503 0.0709 0.1007 0.1471 0.2134 0.3... energy_bin_width: [0.0099 0.0206 0.0298 0.0464 0.0663 0.1014 0.1465 0.1... energy_bin_text: ['0.0404 - 0.0503 MeV/n' '0.0503 - 0.0709 MeV/n' '0.0..., 'Si': Size: 3MB Dimensions: (time: 14400, energy: 17) Coordinates: * time (time) datetime64[ns] 115kB 2022-09-04T00:00:28 ... 2022-09-... * energy (energy) float32 68B 0.047 0.0636 0.09005 ... 6.205 8.762 12.19 Data variables: flux (time, energy) float32 979kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 uncertainty (time, energy) float32 979kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 rate (time, energy) float32 979kB 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 Attributes: (12/14) instrument: telescope: A specie: Si axis_title: EPD-SIS-A (Si-Flux) axis_label_time: Time (UTC) ... ... units_time: UTC units_energy: MeV/n units_flux: particles / (s cm^2 sr MeV/n) energy_low: [ 0.042 0.052 0.0752 0.1049 0.1518 0.2173 0.3... energy_bin_width: [0.01 0.0232 0.0297 0.0469 0.0655 0.0985 0.1451 0.1... energy_bin_text: ['0.0420 - 0.0520 MeV/n' '0.0520 - 0.0752 MeV/n' '0.0...} .. GENERATED FROM PYTHON SOURCE LINES 33-68 .. code-block:: Python energy = 0.26 # MeV/n resample = '30min' species_colors = {'H': 'black', 'He3': 'tab:red', 'He4': 'tab:blue', 'O': 'tab:orange', 'Si': 'magenta', 'Fe': 'seagreen'} fig, axis = plt.subplots(figsize=(6, 4), dpi=200) species = ['H', 'He3', 'He4', 'O', 'Si', 'Fe'] for specie in species: flux = sis.dataset[specie].flux.sel(energy=energy, method='nearest').resample(time=resample).mean() flux = flux.where(flux != 0, np.nan) flux.plot.line(x='time', color=species_colors[specie], ax=axis, label=f'{specie} ({1e3*flux.energy:.2f} keV/n)') # , **kwargs axis.set_xlim([datetime(2022, 9, 4), datetime(2022, 9, 9)]) axis.set_yscale('log') axis.yaxis.minorticks_on() axis.xaxis.set_major_locator(mdates.AutoDateLocator()) axis.xaxis.set_minor_locator(mdates.HourLocator()) axis.set_xlabel('Time (UTC)') axis.set_ylabel('Flux (#/(cm$^2$ s sr MeV/nuc))') axis.set_title('Solar Orbiter (SIS-A)') axis.legend(loc='upper left', bbox_to_anchor=(1, 1), fontsize=7) fig.tight_layout() plt.show() .. image-sg:: /_examples/Basic_Plots/images/sphx_glr_solo_sis_plot_multi_species_001.png :alt: Solar Orbiter (SIS-A) :srcset: /_examples/Basic_Plots/images/sphx_glr_solo_sis_plot_multi_species_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.904 seconds) .. _sphx_glr_download__examples_Basic_Plots_solo_sis_plot_multi_species.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: solo_sis_plot_multi_species.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: solo_sis_plot_multi_species.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: solo_sis_plot_multi_species.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_