UCBerkeleySETI / blimpy

Breakthrough Listen I/O Methods for Python
https://blimpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
46 stars 41 forks source link

Introduce Filterbank file downsampling capability #267

Closed texadactyl closed 2 years ago

texadactyl commented 2 years ago

The operator will supply an input path, output path, and a group_size for the purpose of summing. For every every group_size time samples of the input data, the utility will sum the data element values into one total based on the polarisation index and fine-requency channel index. This summing is performed for each polarisation index and each channel index within a given polarisation.

E.g. if the group size = 3, then for polarisation index 1 (relative to 0) and channel index 42 (relative to 0), the sum for time samples 21 through 23 (relative to 0) for single element outdata[7, 1, 42] is given by: indata[21, 1, 42] + indata[22, 1, 42] + indata[23, 1, 42]

The number of output samples = input array time dimension integer-divided by group_size. If the remainder of that division > 0, then the excess samples from the input array are dropped.

E.g. if the group size = 3 and the input data has 62 time samples, then the last 2 input samples are discarded.

The summing group size must be >= 2 and < input data time dimension.

Note that the tsamp header field in the output is set = the group size multiplied by the input tsamp value.

cc: @wfarah @david-macmahon