hexrd.imageseries.stats module
aggregate statistics for imageseries
The functions here operate on the frames of an imageseries and return a
single aggregate image. For each function, there is a corresponding iterable
that allows you to run the function in smaller bits; the bits are either groups
of frames or groups of rows, depending on the function. The iterable returns a
sequence of images, the last being the final result.
For example:
# Using the standard function call
img = stats.average(ims)
# Using the iterable with 10 chunks
for img in stats.average_iter(ims, 10):
# update progress bar
pass
NOTE:
* Perhaps we should rename min -> minimum and max -> maximum to avoid
conflicting with the python built-ins
-
hexrd.imageseries.stats.average(ims, nframes=0)[source]
average over frames
-
hexrd.imageseries.stats.average_iter(ims, nchunk, nframes=0)[source]
average over frames
Note: average returns a float even if images are uint
-
hexrd.imageseries.stats.max(ims, nframes=0)[source]
maximum over frames
-
hexrd.imageseries.stats.max_iter(ims, nchunk, nframes=0)[source]
iterator for max function
-
hexrd.imageseries.stats.median(ims, nframes=0)[source]
-
hexrd.imageseries.stats.median_iter(ims, nchunks, nframes=0, use_buffer=True)[source]
-
hexrd.imageseries.stats.min(ims, nframes=0)[source]
minimum over frames
-
hexrd.imageseries.stats.min_iter(ims, nchunk, nframes=0)[source]
iterator for min function
-
hexrd.imageseries.stats.percentile(ims, pctl, nframes=0)[source]
percentile function over frames
ims - the imageseries
pctl - the percentile
nframes - the number of frames to use (default/0 = all)
-
hexrd.imageseries.stats.percentile_iter(ims, pctl, nchunks, nframes=0, use_buffer=True)[source]
iterator for percentile function