read_multi#
- eoio.interface.read_multi(paths: str | List[str], vars_sel: Dict[str, List[str]] | None = None, subset: Dict[str, Any] | None = None, read_params: Dict[str, Any] | None = None, processors: Dict[str, Any] | List[Dict[str, Any]] | None = None, concat_dim: str = 'time', concat_coord: str | List[Any] | Callable[[str, Dataset], Any] | None = None, concat_processors: Dict[str, Any] | List[Dict[str, Any]] | None = None, on_mismatch: str = 'error', attrs: str = 'reconcile', coord_attrs: List[str] | None = None, *args, **kwargs) Dataset[source]#
Read several EO product files as one call and concatenate them along a new (or existing) dimension.
Each path is read independently via
read()(with identicalvars_sel/subset/read_params/processorsapplied to every file), then the resulting datasets are concatenated alongconcat_dim.Typical uses are an in-situ time series (e.g. one Hypernets file per measurement cycle, each already carrying its own
timedimension) or a multi-date raster stack (e.g. several Sentinel-2 scenes stacked along a newtimedimension).- Parameters:
paths – Explicit list of product paths, a directory (all files inside it recognised by a registered reader), or a glob pattern. All entries are expected to resolve to the same reader type.
vars_sel – See
read(). Applied identically to every file.subset – See
read(). Applied identically to every file.read_params – See
read(). Applied identically to every file.processors – Post-processing steps run per file, before concatenation. See
read().concat_dim –
Name of the dimension to concatenate along. Default
"time".If
concat_dimis already a dimension on every per-file dataset (e.g. in-situ readers that carry their owntimedimension), the datasets are concatenated directly. Otherwise a new dimension is created per file viaexpand_dims, using the coordinate value resolved fromconcat_coord(e.g. a multi-date raster stack).concat_coord –
How to compute the coordinate value for each file along
concat_dimwhen a new dimension needs to be created:str– dot-path intods.attrs, e.g."product_metadata.sensing_time".list– explicit values, one per path, same order as the resolvedpaths.callable(path, ds) -> value– escape hatch, e.g. to parse a timestamp out of the filename.None(default) – ifconcat_dimalready exists on every dataset, used as-is; otherwise falls back to file order as an integer index coordinate, with a warning.
concat_processors – Post-processing steps run once on the final concatenated dataset.
on_mismatch –
How to handle datasets whose variable set or per-file shape (other than
concat_dim) doesn’t match — this also covers raster grid mismatches (a mismatched x/y shape is just another schema mismatch):"error"(default) – raise, naming the offending files."skip"– drop mismatched files, with a warning."union"– outer-join concat; missing values become NaN.
attrs –
How to combine dataset-level and per-variable attrs across files:
"reconcile"(default) – attrs identical across every file are kept; attrs that differ are kept as a per-file list attr (or promoted to a coordinate, seecoord_attrs) rather than being silently dropped."first"– cheap legacy behaviour: just keep the first file’s attrs, discarding the rest (xarray’s ownxr.concatdefault).
coord_attrs – Dataset-level attribute names to promote to a coordinate on
concat_diminstead of being kept as a list attr — e.g.coord_attrs=["product_name"]gives you a per-fileproduct_namecoordinate alongsidetime. Only used whenattrs="reconcile".
- Returns:
The concatenated
xarray.Dataset.