fetch_mas_data

Contents

fetch_mas_data#

fetch_mas_data(*, domains='cor', variables='br', hdf=5)#

Fetch MAS magnetohydrodynamic model output for the given domains and variables.

Downloads the requested MAS field files from the Carrington rotation 2309 standard run and returns their cached paths. One file is fetched for each requested (domain, variable) pair.

Parameters:
domainsstr | Iterable | None, optional

Model domain(s) to fetch: "cor" (corona) and/or "hel" (heliosphere). Accepts a comma-separated string, an iterable of domain names, or None to fetch both domains. Default is "cor".

variablesstr | Iterable | None, optional

Physical variable(s) to fetch, such as the magnetic field components "br", "bt", "bp" (\(\mathbf{B}\)) or the velocity components "vr", "vt", "vp" (\(\mathbf{v}\)). Accepts a comma-separated string, an iterable of variable names, or None to fetch every variable common to all requested domains. Default is "br".

hdfint, optional

HDF format version to download: 4 (.hdf) or 5 (.h5). Default is 5.

Returns:
pathsFilepaths

Named tuple whose fields are "{domain}_{variable}" and whose values are the Path of each downloaded file.

Raises:
ValueError

If hdf is not a supported HDF version.

KeyError

If variables is None and a requested domain is not present in DOM_VAR_MAP.

See also

fetch_pot3d_data

Fetch POT3D potential-field components.

fetch_mas_quantities

Fetch derived MAS quantities at the inner boundary.

Examples

>>> from psi_data import fetch_mas_data
>>> paths = fetch_mas_data(domains="cor,hel", variables="br,vr")
>>> paths.cor_br
PosixPath('.../cor/mhd/br002.h5')