Download PROBA2/SWAP data

This example shows how to download PROBA2/SWAP data from the PROBA2 Science center using the ITI tool.

import glob
import os
from datetime import datetime
from sunpy.map import Map
import matplotlib.pyplot as plt

from itipy.download.download_proba2 import PROBA2Downloader

Initialize path where to download the data

base_path = os.getcwd()

Set up the downloader for PROBA2/SWAP with the path to download the data

downloader = PROBA2Downloader(base_path=base_path+'/swap')

Download the data for a specific date

downloader.downloadDate(date=datetime(2023, 5, 8, 15))
/home/docs/checkouts/readthedocs.org/user_builds/iti-documentation/envs/latest/lib/python3.8/site-packages/sunpy/net/vso/vso.py:210: SunpyUserWarning: VSO-C500 :soap:Server : Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at /var/www/vso/local/lib/perl5/Physics/Solar/VSO/DataProvider/ROB.pm line 83.

  warn_user(resp["error"])

Glob the downloaded files and sort them by date

swap_files = sorted(glob.glob('swap/*/*.fits', recursive=True))

In the next step we load the `.fits`files as SunPy maps.

swap_map = Map(swap_files[0])

We can visualize the map using the SunPy plotting capabilities

plt.figure(figsize=(10, 10))
swap_map.plot()
plt.show()
SWAP $174 \; \mathrm{\mathring{A}}$ 2023-05-08 14:59:40
INFO: Missing metadata for solar radius: assuming the standard radius of the photosphere. [sunpy.map.mapbase]
INFO:sunpy:Missing metadata for solar radius: assuming the standard radius of the photosphere.
INFO: Missing metadata for solar radius: assuming the standard radius of the photosphere. [sunpy.map.mapbase]
INFO:sunpy:Missing metadata for solar radius: assuming the standard radius of the photosphere.

Total running time of the script: (0 minutes 10.035 seconds)

Gallery generated by Sphinx-Gallery