.. 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_histogram.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_histogram.py: Plot SIS He Mass Spectrogram ---------------------------- In this example, we use solo_sis_loader's package to plot the He mass spectrogram. .. 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 sunpy.net.attrs as a from matplotlib import colors from solo_sis_loader import SIS_histo .. GENERATED FROM PYTHON SOURCE LINES 21-32 .. code-block:: Python t_start = '2022-11-11' t_end = '2022-11-16' stime = a.Time(t_start, t_end) level = a.Level('L2') sish = SIS_histo() response = sish.search(stime, level=level) files = sish.fetch(response) sish.load(files) .. rst-class:: sphx-glr-script-out .. code-block:: none Files Downloaded: 0%| | 0/6 [00:00
<xarray.Dataset> Size: 95kB
    Dimensions:  (time: 288, mass: 80)
    Coordinates:
      * time     (time) datetime64[ns] 2kB 2022-11-11T00:43:16 ... 2022-11-17T00:...
      * mass     (mass) float32 320B 2.025 2.075 2.125 2.175 ... 5.875 5.925 5.975
    Data variables:
        flux     (time, mass) float32 92kB 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
    Attributes:
        instrument:       <sunpy.net.attrs.Instrument(EPD: Energetic Particle Det...
        detector:         <sunpy.net.attrs.Detector: SIS object at 0x7fbfda587650>
        telescope:        A
        axis_title:       EPD-SIS-A Mass Histogram)
        axis_label_time:  Time (UTC)
        axis_label_mass:  Mass (amu)
        axis_label_flux:  Flux (counts)
        units_time:       UTC
        units_mass:       amu
        units_flux:       counts
        mass_bins_low:    [2.   2.05 2.1  2.15 2.2  2.25 2.3  2.35 2.4  2.45 2.5 ...
        mass_bin_width:   [0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05...


.. GENERATED FROM PYTHON SOURCE LINES 33-65 .. code-block:: Python fig, axis = plt.subplots(figsize=(6, 5), dpi=200) sish.dataset.flux.plot.pcolormesh(x='time', cmap='turbo', add_colorbar=False, norm=colors.LogNorm(vmin=1, vmax=100), ax=axis) axis.axhline(y=3.016029, linestyle='--', color='tab:red') axis.axhline(y=4.002603, linestyle='--', color='tab:blue') axis.set_xlim([datetime(2022, 11, 11), datetime(2022, 11, 16)]) axis.set_ylim([2, 5]) axis.set_yticklabels(axis.get_yticks(), rotation=90, va='center') axis.set_ylabel('Mass (AMU)') axis.set_xlabel('Time (UTC)') axis.yaxis.minorticks_on() axis.xaxis.set_major_locator(mdates.AutoDateLocator()) axis.xaxis.set_minor_locator(mdates.HourLocator()) plt.setp(axis.get_xticklabels(), rotation=0, ha='center') axis.set_title('Helium mass spectrogram (SolO SIS-A, 0.5-2 MeV/nuc)') fig.tight_layout() plt.show() .. image-sg:: /_examples/Basic_Plots/images/sphx_glr_solo_sis_plot_histogram_001.png :alt: Helium mass spectrogram (SolO SIS-A, 0.5-2 MeV/nuc) :srcset: /_examples/Basic_Plots/images/sphx_glr_solo_sis_plot_histogram_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/solo-sis-loader/checkouts/latest/docs/source/examples/Basic_Plots/solo_sis_plot_histogram.py:48: UserWarning: set_ticklabels() should only be used with a fixed number of ticks, i.e. after set_ticks() or using a FixedLocator. axis.set_yticklabels(axis.get_yticks(), rotation=90, va='center') .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.579 seconds) .. _sphx_glr_download__examples_Basic_Plots_solo_sis_plot_histogram.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_histogram.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: solo_sis_plot_histogram.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: solo_sis_plot_histogram.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_