Closed emmanuelfonseca closed 3 years ago
For reference, probably the simplest way to do this for a 2D array is
def rebin(arr, new_shape):
"""Rebin 2D array arr to shape new_shape by averaging."""
shape = (new_shape[0], arr.shape[0] // new_shape[0],
new_shape[1], arr.shape[1] // new_shape[1])
return arr.reshape(shape).mean(-1).mean(1)
so as long as you can figure out what the current vs. final desired shape is, this should work. The limitation being that the new_shape
must exactly divide the old shape. And you can always just downsample in one dimension by keeping the other dimension the same as in arr
.
see PR #22.
the current
fitburst
runs on the native resolution of CHIME/FRB data. add the appropriate functions and method (presumably to theDataReader
object) to allow for downsampling in frequency and/or time, prior to least-squares fitting.