There is one dset in both h5avg and h5concat that needs special treatment. The cfgs_srcs array is a 2-dimensional array storing the information
[[ cfg_0, Nsrc_0],
cfg_1, Nsrc_1],
...
]
h5avg: instead of averaging this dset, what we need to do is preserve the 0th column and add the second column. We don't need to match the 0th column to make sure it is the same, as this is almost guaranteed if the shape of the data matches. So - What we need is
cfgs_srcs_tmp = cfgs_srcs_0
cfgs_srcs_tmp[:,1] += cfgs_srcs_1[:,1]
... for all sets being averaged
h5concat: instead of simply concatenating, we need to add an offset to all dsets after the first so that they have a unique cfg identifying number. This is a two step procedure.
Identify the maximum cfg number in each cfgs_srcs dset being matched. Then round up to the next largest integer of the most significant digit. For example, the a15m135XL streams run from 500 - 1745. So this offset base would be cfg_offset=2000.
When performing the concatenation, we should add n*cfg_offset to the 0th column. For example:
cfgs_srcs_new =
for n,cs in enumerate(cfgs_srcs_sets):
if n == 0:
cfgs_srcs_new = cs
else:
tmp = cs
tmp[:,0] += n * cfg_offset
cfgs_srcs_new = np.concatenate((cfgs_srcs_new,tmp),axis=0)
There is one dset in both h5avg and h5concat that needs special treatment. The
cfgs_srcs
array is a 2-dimensional array storing the informationh5avg
: instead of averaging this dset, what we need to do is preserve the 0th column andadd
the second column. We don't need to match the 0th column to make sure it is the same, as this is almost guaranteed if the shape of the data matches. So - What we need ish5concat
: instead of simply concatenating, we need to add an offset to all dsets after the first so that they have a uniquecfg
identifying number. This is a two step procedure.Identify the maximum cfg number in each
cfgs_srcs
dset being matched. Then round up to the next largest integer of the most significant digit. For example, thea15m135XL
streams run from 500 - 1745. So this offset base would becfg_offset=2000
.When performing the concatenation, we should add
n*cfg_offset
to the 0th column. For example: