Cluster Science Archive (CSA)

The Cluster Science Archive (CSA) provides access to all science and support data from the Cluster (2000–2024) and Double Star (2004–2008) missions. Its integration into Speasy exposes all the CSA’s public datasets. CSA stores them as CEF (Cluster Exchange Format) files, and Speasy downloads them as CEF by default, read with CEFast. The datasets that follow the ISTP (International Solar-Terrestrial Physics) conventions — the bulk of the Cluster/Double Star science data — can also be downloaded as CDF (Common Data Format) files, which CSA converts on each request, about twice as slowly. Both give the same SpeasyVariable: time axis, support axes (DEPEND_1, DEPEND_2…), column names (LABEL_1), units and fill values. Only some metadata names differ. To get CDF where CSA has it, set spz.config.csa.output_format.set("CDF_ISTP"), or pass output_format="CDF_ISTP" to one request.

Basics: Getting data from CSA module

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

>>> import speasy as spz
>>> # Let's assume you wanted to get 'Cluster C3, Magnetic Field Vector, spin resolution in GSE'
>>> c3_fgm_spin = spz.csa.get_data(spz.inventories.tree.csa.Cluster.Cluster_3.FGM3.C3_CP_FGM_SPIN.B_vec_xyz_gse__C3_CP_FGM_SPIN, "2018-01-01", "2018-01-01T01")
>>> c3_fgm_spin.columns
['Bx', 'By', 'Bz']
>>> c3_fgm_spin.values.astype("float32")
array([[  4.603,  13.444, -16.832],
       [  4.684,  12.852, -16.708],
       [  2.86 ,  12.794, -17.362],
       ...,
       [ 20.586,  -4.407, -29.247],
       [ 20.741,  -0.268, -29.078],
       [ 20.356,   1.052, -27.904]], shape=(852, 3), dtype=float32)

A product can also be named by its "DATASET_ID/variable_id" string id, and get_variable() takes the dataset and variable as separate arguments:

import speasy as spz
# these two calls fetch the same product as above
b = spz.get_data("csa/C3_CP_FGM_SPIN/B_vec_xyz_gse__C3_CP_FGM_SPIN", "2018-01-01", "2018-01-01T01")
b = spz.csa.get_variable(dataset="C3_CP_FGM_SPIN", variable="B_vec_xyz_gse__C3_CP_FGM_SPIN",
                         start_time="2018-01-01", stop_time="2018-01-01T01")

Each dataset only covers a finite time range; parameter_range() and dataset_range() tell you what it is before you ask:

spz.csa.dataset_range("C3_CP_FGM_SPIN")
spz.csa.parameter_range("C3_CP_FGM_SPIN/B_vec_xyz_gse__C3_CP_FGM_SPIN")

Note

Asking for data outside a dataset’s range is not an error: get_data() returns None and logs a warning naming the dataset’s actual range.