downsample¶
-
image_tools.downsample.downsample(myarr, factor, estimator=<function nanmean>)[source] [edit on github]¶ Downsample a 2D array by averaging over factor pixels in each axis. Crops upper edge if the shape is not a multiple of factor.
This code is pure numpy and should be fast.
- keywords:
- estimator - default to mean. You can downsample by summing or
- something else if you want a different estimator (e.g., downsampling error: you want to sum & divide by sqrt(n))