.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/downloads/download_sdo.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_generated_gallery_downloads_download_sdo.py: ========================= Download SDO/AIA data ========================= This example shows how to download SDO AIA data from the `Joint Science Operations Center (JSOC) `__ using the ITI tool. .. GENERATED FROM PYTHON SOURCE LINES 7-17 .. code-block:: Python import os from datetime import datetime from sunpy.map import Map import matplotlib.pyplot as plt from itipy.data.dataset import get_intersecting_files from itipy.download.download_sdo import SDODownloader .. GENERATED FROM PYTHON SOURCE LINES 18-19 Initialize path where to download the data .. GENERATED FROM PYTHON SOURCE LINES 19-21 .. code-block:: Python base_path = os.getcwd() .. GENERATED FROM PYTHON SOURCE LINES 22-25 Set up the downloader for SDO with the path to download the data The SDO downloader allows to download AIA data in all available wavelengths. In addition to the EUV observations from AIA, we can download the HMI magnetograms at 6173 Å. .. GENERATED FROM PYTHON SOURCE LINES 25-28 .. code-block:: Python jsoc_email = os.environ["JSOC_EMAIL"] downloader = SDODownloader(base_path=base_path+'/sdo', email=jsoc_email, wavelengths=[171, 193, 211, 304]) .. GENERATED FROM PYTHON SOURCE LINES 29-30 Download the data for a specific date .. GENERATED FROM PYTHON SOURCE LINES 30-32 .. code-block:: Python downloader.downloadDate(date=datetime(2022, 4, 5, 5)) .. GENERATED FROM PYTHON SOURCE LINES 33-34 We can now glob the downloaded files and sort them by date .. GENERATED FROM PYTHON SOURCE LINES 34-36 .. code-block:: Python aia_files = get_intersecting_files(base_path+'/sdo', [171, 193, 211, 304]) .. GENERATED FROM PYTHON SOURCE LINES 37-38 In the next step we load the `.fits` files as SunPy maps. .. GENERATED FROM PYTHON SOURCE LINES 38-43 .. code-block:: Python aia_map171 = [Map(f) for f in aia_files[0]] aia_map193 = [Map(f) for f in aia_files[1]] aia_map211 = [Map(f) for f in aia_files[2]] aia_map304 = [Map(f) for f in aia_files[3]] .. GENERATED FROM PYTHON SOURCE LINES 44-45 We can visualize the map of the two instruments using the SunPy plotting capabilities .. GENERATED FROM PYTHON SOURCE LINES 45-50 .. code-block:: Python fig, axs = plt.subplots(1, 4, subplot_kw={'projection': aia_map171[0]}, figsize=(20, 10), dpi=100) aia_map171[0].plot(axes=axs[0]) aia_map193[0].plot(axes=axs[1]) aia_map211[0].plot(axes=axs[2]) aia_map304[0].plot(axes=axs[3]) plt.show() .. image-sg:: /generated/gallery/downloads/images/sphx_glr_download_sdo_001.png :alt: AIA $171 \; \mathrm{\mathring{A}}$ 2022-04-05 05:00:09, AIA $193 \; \mathrm{\mathring{A}}$ 2022-04-05 05:00:04, AIA $211 \; \mathrm{\mathring{A}}$ 2022-04-05 04:59:57, AIA $304 \; \mathrm{\mathring{A}}$ 2022-04-05 05:00:05 :srcset: /generated/gallery/downloads/images/sphx_glr_download_sdo_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/iti-documentation/envs/latest/lib/python3.8/site-packages/sunpy/map/mapbase.py:2650: SunpyUserWarning: The map world coordinate system (WCS) is different from the axes WCS. The map data axes may not correctly align with the coordinate axes. To automatically transform the data to the coordinate axes, specify `autoalign=True`. warn_user('The map world coordinate system (WCS) is different from the axes WCS. ' /home/docs/checkouts/readthedocs.org/user_builds/iti-documentation/envs/latest/lib/python3.8/site-packages/sunpy/map/mapbase.py:2650: SunpyUserWarning: The map world coordinate system (WCS) is different from the axes WCS. The map data axes may not correctly align with the coordinate axes. To automatically transform the data to the coordinate axes, specify `autoalign=True`. warn_user('The map world coordinate system (WCS) is different from the axes WCS. ' /home/docs/checkouts/readthedocs.org/user_builds/iti-documentation/envs/latest/lib/python3.8/site-packages/sunpy/map/mapbase.py:2650: SunpyUserWarning: The map world coordinate system (WCS) is different from the axes WCS. The map data axes may not correctly align with the coordinate axes. To automatically transform the data to the coordinate axes, specify `autoalign=True`. warn_user('The map world coordinate system (WCS) is different from the axes WCS. ' .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 13.667 seconds) .. _sphx_glr_download_generated_gallery_downloads_download_sdo.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: download_sdo.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: download_sdo.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: download_sdo.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_