Skip to content
Snippets Groups Projects

Adds function to concatenate runs along trainId dimension

Merged Laurent Mercadier requested to merge combine_runs into master
1 file
+ 5
3
Compare changes
  • Side-by-side
  • Inline
+ 5
3
@@ -451,15 +451,17 @@ def load(fields, runNB, proposalNB, semesterNB, topic='SCS', display=False,
return result
def concatenateRuns(runs):
""" Concatenate two runs with identical data variables along the trainId dimension
""" Concatenate a list of two runs with identical data variables along the
trainId dimension.
Input:
runs: (list) the xarray Datasets to concatenate
Output:
a concatenated xarray Dataset
"""
keys = runs[0].keys()
keys = sorted(runs[0].keys())
for run in runs[1:]:
if run.keys() != keys:
if sorted(run.keys()) != keys:
print('data fields between different runs are not identical. Cannot combine runs.')
return
Loading