You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Downsample the resolution of the cube via a number of different methods, e.g.:
mean
sum
min
max
median
Collapse an axis, which is a special case of the first point
Upsample based on N-D fits, e.g. spline fits.
The first pass of this functionality should only support upsampling or downsampling an integer multiple of the resolution along each axis. Later versions could support resampling onto a user-defined grid for each axis/axes. However, this may be beyond the minimalist scope of ndcube and perhaps more advanced resampling methods should be left to higher level subclasses of the ndcube data classes.
A possible API might be
my_cube.resample((1, 1/2, 3, 100), method=None)
where my_cube is a 4-D NDCube instance and the input is a tuple of the resample factor for each data axis, i.e. the size of each pixel as a factor of the original pixel size in that axis. In this scheme, 1 denotes no resampling.
A number, x where 0 < x < 1, e.g. 1/2, denotes the axis will be upsampled so that each pixel is half as big as the original pixel along that axis. In this case, x will be inverted and rounded to the nearest integer and that will be the upsample factor.
Numbers > 1, e.g. 3, denote that the new pixels will be 3 times as big as the original pixels along this axis. In the first pass, this number must be an integer factor of the number of pixels along that axis. Numbers > 1 will be rounded to the nearest integer.
A number that is >= the number of pixels along the axis collapses the axis entirely and reduces the dimensionality of the cube.
The method kwarg (or a better name) would denote how the resampling would be done. In cases where the resample factor is > 1, i.e. downsampling, the allowed values may be "mean", "sum", "min", "max", "median".
In cases where the resample factor is < 1, the allowed values may be "spline", or whatever fitting types are supported.
Additional context
The text was updated successfully, but these errors were encountered:
Description
NDCube
should have the ability to:The first pass of this functionality should only support upsampling or downsampling an integer multiple of the resolution along each axis. Later versions could support resampling onto a user-defined grid for each axis/axes. However, this may be beyond the minimalist scope of
ndcube
and perhaps more advanced resampling methods should be left to higher level subclasses of thendcube
data classes.A possible API might be
where
my_cube
is a 4-DNDCube
instance and the input is atuple
of the resample factor for each data axis, i.e. the size of each pixel as a factor of the original pixel size in that axis. In this scheme,1
denotes no resampling.A number,
x
where0 < x < 1
, e.g.1/2
, denotes the axis will be upsampled so that each pixel is half as big as the original pixel along that axis. In this case, x will be inverted and rounded to the nearest integer and that will be the upsample factor.Numbers > 1, e.g.
3
, denote that the new pixels will be 3 times as big as the original pixels along this axis. In the first pass, this number must be an integer factor of the number of pixels along that axis. Numbers > 1 will be rounded to the nearest integer.A number that is
>=
the number of pixels along the axis collapses the axis entirely and reduces the dimensionality of the cube.The
method
kwarg (or a better name) would denote how the resampling would be done. In cases where the resample factor is > 1, i.e. downsampling, the allowed values may be"mean"
,"sum"
,"min"
,"max"
,"median"
.In cases where the resample factor is < 1, the allowed values may be
"spline"
, or whatever fitting types are supported.Additional context
The text was updated successfully, but these errors were encountered: