Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5avg and h5concat feature request for cfgs_srcs #24

Open
walkloud opened this issue Sep 6, 2019 · 1 comment
Open

h5avg and h5concat feature request for cfgs_srcs #24

walkloud opened this issue Sep 6, 2019 · 1 comment
Assignees

Comments

@walkloud
Copy link
Member

walkloud commented Sep 6, 2019

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.

  1. 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.

  2. 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)
@walkloud
Copy link
Member Author

instead of the code deciding the offset - the user should have to supply it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants