This notebook presents two different ways to retrieve RPW data:
NOTES:
SunPy provides a user-friendly interface for searching the SOAR for data files and downloading. Internally this makes calls to the SOAR Web API. Please see sunpy-soar / Example usage for more details of how to use SunPy with sunpy-soar.
In the example below, we retrieve the latest version of solo_L2_tds-surv-tswf-e data for 2021-10-09.
NOTE: the Product()
method takes the Descriptor in upper case as argument.
# (Adapted for RPW from https://github.com/SolarOrbiterWorkshop/solo8_tutorials/tree/main/MAG_tutorial)
# Import external packages
from sunpy.net import Fido
import sunpy.net.attrs as a
import sunpy_soar
from IPython.display import display
# Set input arguments to fetch for RPW data files
instrument = a.Instrument('RPW')
time = a.Time('2021-10-09', '2021-10-09')
level = a.Level(2)
product = a.soar.Product('RPW-TDS-SURV-TSWF-E')
# Perform search for RPW data files
result = Fido.search(instrument & time & level & product)
display(result)
Instrument | Data product | Level | Start time | End time | Data item ID | Filename | Filesize |
---|---|---|---|---|---|---|---|
Mbyte | |||||||
str3 | str19 | str2 | str23 | str23 | str36 | str44 | float64 |
RPW | RPW-TDS-SURV-TSWF-E | L2 | 2021-10-09 00:00:00.000 | 2021-10-10 00:00:00.000 | solo_L2_rpw-tds-surv-tswf-e_20211009 | solo_L2_rpw-tds-surv-tswf-e_20211009_V01.cdf | 106.66 |
# Download files in /Data folder
files = Fido.fetch(result, path='Data', overwrite=True, progress=True)
display(files)
Files Downloaded: 0%| | 0/1 [00:00<?, ?file/s]
solo_L2_rpw-tds-surv-tswf-e_20211009_V01.cdf: 0%| | 0.00/107M [00:00<?, ?B/s]
<parfive.results.Results object at 0x7f7ff8039f40> ['Data/solo_L2_rpw-tds-surv-tswf-e_20211009_V01.cdf']
The SOAR provides a Web API through which data files can be requested and downloaded. Any program that can normally make HTTP requests can be used access the SOAR through the Web API. Please see Solar Orbiter Archive / Programmatic Access / Data Requests for more details.
Here is an example of downloading the latest version of RPW data item solo_L2_rpw-tnr-surv_20211009
using wget
%%sh
# (Adapted for RPW from https://github.com/SolarOrbiterWorkshop/solo8_tutorials/tree/main/MAG_tutorial)
# Define the name of the data item we want to download
DATA_ITEM="solo_L2_rpw-tnr-surv_20211009"
# Define the path of the directory where downloaded file will be saved
DATA_DIR="${PWD}/Data"
# Create the directory where data will be downloaded if it doesn't exist
mkdir -p "${DATA_DIR}"
# Make a web request to receive the data product in this case using wget
API_URL_TEMPLATE="http://soar.esac.esa.int/soar-sl-tap/data?retrieval_type=LAST_PRODUCT&product_type=SCIENCE&data_item_id="
wget --content-disposition -P "${DATA_DIR}" "${API_URL_TEMPLATE}${DATA_ITEM}" --progress=bar:force:noscroll
echo "Done"
--2022-09-16 12:16:41-- http://soar.esac.esa.int/soar-sl-tap/data?retrieval_type=LAST_PRODUCT&product_type=SCIENCE&data_item_id=solo_L2_rpw-tnr-surv_20211009 Résolution de soar.esac.esa.int (soar.esac.esa.int)… 193.147.153.149 Connexion à soar.esac.esa.int (soar.esac.esa.int)|193.147.153.149|:80… connecté. requête HTTP transmise, en attente de la réponse… 200 Taille : 234427923 (224M) [application/octet-stream] Sauvegarde en : « /Users/xbonnin/Work/Projects/SolarOrbiter/RPW/ROC/Software/Git/Tutorials/python-tnr-tds-tutorial/Data/solo_L2_rpw-tnr-surv_20211009_V02.cdf.2 » solo_L2_rpw-tnr-sur 100%[===================>] 223,57M 3,94MB/s ds 57s 2022-09-16 12:17:38 (3,94 MB/s) — « /Users/xbonnin/Work/Projects/SolarOrbiter/RPW/ROC/Software/Git/Tutorials/python-tnr-tds-tutorial/Data/solo_L2_rpw-tnr-surv_20211009_V02.cdf.2 » sauvegardé [234427923/234427923]
Done
At the end of this notebook, if everything has worked well, you should find the following CDF files in your /Data folder: