class ginga.AutoCuts.Histogram(logger, usecrop=None, sample='crop', full_px_limit=None, num_points=None, pct=0.999, numbins=2048)[source]

Bases: AutoCutsBase

Calculate the cut levels based on a histogram analysis of the data.


Logger for tracing and debugging.

samplestr (optional, ‘crop’, ‘grid’, or ‘full’, default: ‘crop’)

Specifies how to access the image for calculation: - crop: crop an area from the middle of the image - grid: sample data in a grid pattern across the image - full: use the full image data

full_px_limitint (optional, defaults to 1M)

Specifies the limit for using the full data if sample == ‘full’. If the number of pixels in the image is larger than this, then the image will fall back to using a crop.

num_pointsint (optional, defaults to None)

Specifies the number of points in the grid if sample == ‘grid’, or the diameter of the crop, if sample == ‘crop’ (or ‘full’ and number of pixels exceeds full_px_limit). If None, the number pixels will be calculated to a “reasonable representative sample”.

pctfloat (optional, range: 0.0 - 1.0, defaults to 0.999)

Specifies the percentage of the histogram bins to retain

numbinsint (optional, defaults to 2048)

Specifies the number of bins used in calculating the histogram

Methods Summary


See subclass documentation.


See subclass documentation.

calc_histogram(data[, pct, numbins])

Internal function used by this class.


Methods Documentation


See subclass documentation.


See subclass documentation.

calc_histogram(data, pct=1.0, numbins=2048)[source]

Internal function used by this class.

classmethod get_params_metadata()[source]