Coordinated Data Analysis Web (CDAWeb)

The Coordinated Data Analysis Web (CDAWeb) contains selected public non-solar heliophysics data from current and past heliophysics missions and projects. Many datasets from current missions are updated regularly (even daily), including reprocessing older time periods, and SPDF only preserves the latest version.

Basics: Getting data from CDA module

The easiest solution is to use your python terminal completion and browse spz.inventories.data_tree.cda to find your product. Once you have found your product, then simply ask CDA module to get data for the provided time range:

>>> import speasy as spz
>>> # Let's assume you wanted to get Solar Orbiter 'Magnetic field vector in RTN coordinates'
>>> solo_mag_rtn = spz.get_data(spz.inventories.tree.cda.Solar_Orbiter.SOLO.MAG.SOLO_L2_MAG_RTN_NORMAL_1_MINUTE.B_RTN, "2021-01-01", "2021-01-02")
>>> solo_mag_rtn.columns
['B_r', 'B_t', 'B_n']
>>> solo_mag_rtn.values.shape
(1438, 3)

Specific CDAWeb options

The CDAWeb module lets you choose the access method among BEST, FILE, and API. The default is BEST.

  • BEST — automatically selects between FILE and API for each dataset.

  • FILE — downloads data files directly from the CDAWeb archive.

  • API — retrieves data through the CDAWeb REST API.

Note

Most CDAWeb datasets are CDF, but 70 are NetCDF. Those can go through FILE too, on two conditions the container format does not tell: their files must carry the ISTP attributes the NetCDF codec needs (DEPEND_0, VAR_TYPE), and CDAWeb’s file naming must really describe the archive. Speasy settles it by loading the requested variable from the first file it would download, and remembers the answer for a week. Whatever fails — plain NetCDF, the datasets CDAWeb describes with one sample file name instead of a pattern, the seven published as GIF or MPEG, and every parameter CDAWeb computes itself — keeps going through the REST API. None of the current NetCDF datasets passes, so this mostly opens the door for the ones to come.

Note

FILE (and therefore BEST, the default) reuses the Direct archive access machinery: Speasy translates CDAWeb’s own description of how a dataset’s files are named and foldered into the same split_rule / url_pattern / fname_regex settings you would write by hand for your own archive. Nothing to configure, but that page is where the behaviour is documented — in particular how file versions are picked when an archive publishes several for the same time range.

You can specify the method by passing the method argument to spz.get_data().

>>> import speasy as spz
>>> # Let's assume you wanted to get Solar Orbiter 'Magnetic field vector in RTN coordinates'
>>> solo_mag_rtn = spz.get_data(spz.inventories.tree.cda.Solar_Orbiter.SOLO.MAG.SOLO_L2_MAG_RTN_NORMAL_1_MINUTE.B_RTN, "2021-01-01", "2021-01-02", method='API')
>>> solo_mag_rtn.columns
['B_r', 'B_t', 'B_n']
>>> solo_mag_rtn.values.shape
(1438, 3)

You can also set the default method globally:

>>> import speasy as spz
>>> spz.config.cdaweb.preferred_access_method.set('BEST')