aloe.image.downsample module

Downsample a numpy array. Use for binning of images.

This code is (c) Adam Ginsburg (agpy)

Image Tools from: https://github.com/keflavich/image_tools

https://github.com/keflavich/image_tools/blob/master/image_tools/downsample.py

aloe.image.downsample.downsample(myarr, factor, estimator=<function nanmean>)[source]

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 np 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))
aloe.image.downsample.downsample_1d(myarr, factor, estimator=<function nanmean>)[source]

Downsample a 1D array by averaging over factor pixels. Crops right side if the shape is not a multiple of factor.

This code is pure np 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))
aloe.image.downsample.downsample_axis(myarr, factor, axis, estimator=<function nanmean>, truncate=False)[source]

Downsample an ND array by averaging over factor pixels along an axis. Crops right side if the shape is not a multiple of factor.

This code is pure np 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))
aloe.image.downsample.downsample_cube(myarr, factor, ignoredim=0)[source]

Downsample a 3D array by averaging over factor pixels on the last two axes.