rubin_sim.maf.batches.read_and_combine(orbitRoot, baseDir, splits, metricfile)

Read and combine the metric results from split locations, returning a single bundle.

This will read the files from baseDir/orbitRoot_[split]/metricfile where split = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], etc. (the subsets the original orbit file was split into).

orbitRoot: str

The root of the orbit file - l7_5k, mbas_5k, etc.

baseDir: str

The root directory containing the subset directories. (e.g. ‘.’ often)

splits: np.ndarray or list of ints

The integers describing the split directories (e.g. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

metricfile: str

The metric filename.


A single metric bundle containing the combined data from each of the subsets.

Note that this won’t work for particularly complex metric values, such as the parent Discovery metrics.
However, you can read and combine their child metrics, as for these we can propagate the data masks.