sdf_xarray.combine_datasets

sdf_xarray.combine_datasets#

sdf_xarray.combine_datasets(path_glob, data_vars=None, deck_path=None, **kwargs)[source]#

Combine all datasets using a single time dimension, optionally extract data from only the listed data_vars.

Coordinates with the “point_data” attribute come from SDF point meshes, i.e. particle positions such as X_Particles_proton. They have one value per particle along an ID_<species> dimension rather than a grid, and SDFPreprocess gives them a time dimension because particles move. They are usually only in some files (with keep_particles=True, on dumps that output particles). When concatenating along time, xarray fills a data variable missing from a file with NaN’s, but raises if a coordinate is missing. So each file’s point coordinates are temporarily turned into data variables and turned back into coordinates after combining. Their names are recorded here because particle data variables (e.g. Particles_Px_proton) carry “point_data” too, so they can’t be told apart by the attribute later.

Return type:

Dataset

Parameters: