Skip to main content

CDF Format

Read NASA Common Data Format (CDF) files as one dict per record index across variables.

Overview

PropertyValue
Format idcdf
ClassCDFIterable
Extensions.cdf
ReadYes
WriteNo
Extracdf (spacepy / NASA CDF C library)
Maturitystable

Record shape

Keys are CDF variable names; values are Python scalars or lists:

{"Epoch": "...", "VariableA": 1.2, "VariableB": [0.0, 1.0]}

Use list_tables() for variable names. Requires a filename (or a named file object). Also needs the NASA CDF C library; see https://cdf.gsfc.nasa.gov.

Usage

from iterable import open_iterable

with open_iterable("data.cdf", format="cdf") as source:
print(source.list_tables())
for row in source:
print(row)

Install with pip install iterabledata[cdf].

See also