AutoCutsBase
- class ginga.AutoCuts.AutoCutsBase(logger)[source]
Bases:
object
Base class for auto cuts algorithms.
Methods Summary
calc_cut_levels
(image)Calculate the cut levels of an image according to the parameters.
calc_cut_levels_data
(data_np)Calculate the cut levels of a ndarray according to the parameters.
cut_levels
(data_np, loval, hival[, vmin, vmax])Apply the cut levels to data.
Return the list of autocuts algorithms.
get_autocut_levels
(image)Calculate the cut levels of an image according to the parameters.
get_crop
(image[, crop_radius])Get a cropped region of data from an image.
get_crop_data
(data[, crop_radius])Get a cropped region of data from a ndarray.
get_full
(image[, px_limit])Get the full (or cropped) array of data from an image.
get_sample
(image[, num_points])Return a sample from the full data array of the passed image.
get_sample_data
(data[, num_points])Return a sample from a data array.
update_params
(**param_dict)Methods Documentation
- calc_cut_levels(image)[source]
Calculate the cut levels of an image according to the parameters.
- Parameters:
- imagesubclass of
BaseImage
Image object from which the cut levels should be calculated
- imagesubclass of
- Returns:
- cut_levelstuple of float (loval, hival)
The cut levels that were calculated
- calc_cut_levels_data(data_np)[source]
Calculate the cut levels of a ndarray according to the parameters.
- Parameters:
- data_npndarray
A numpy array of data from which the cut levels should be calculated
- Returns:
- cut_levelstuple of float (loval, hival)
The cut levels that were calculated
- cut_levels(data_np, loval, hival, vmin=0.0, vmax=255.0)[source]
Apply the cut levels to data.
- Parameters:
- data_npndarray
A numpy array of data to which the cut levels should be applied
- lovalfloat
The low cut level
- hivalfloat
The high cut level
- vminfloat (optional, default 0.0)
The floor of the range which is the output of the cut levels
- vmaxfloat (optional, default 255.0)
The ceiling of the range which is the output of the cut levels
- Returns:
- resultndarray
The result of applying the cut levels to the input array
- get_algorithms()[source]
Return the list of autocuts algorithms.
- Parameters:
- None
- Returns:
- names: tuple of str
The names of the autocut algorithms
- get_autocut_levels(image)
Calculate the cut levels of an image according to the parameters.
- Parameters:
- imagesubclass of
BaseImage
Image object from which the cut levels should be calculated
- imagesubclass of
- Returns:
- cut_levelstuple of float (loval, hival)
The cut levels that were calculated
- get_full(image, px_limit=None)[source]
Get the full (or cropped) array of data from an image.
- Parameters:
- imagesubclass of
BaseImage
Image object from which the cut levels should be calculated
- px_limitint (optional, default
None
) The limit for extracting the full image data. If the number of pixels in the data is larger than this value, a crop from the data will be used instead.
- imagesubclass of
- Returns:
- resultndarray
The (possibly cropped) data
- get_sample(image, num_points=None)[source]
Return a sample from the full data array of the passed image.
- Parameters:
- Returns:
- resultndarray
The sampled data