fluxcompensator.utils.resolution.ConservingZoom

class fluxcompensator.utils.resolution.ConservingZoom(array, initial_resolution, new_resolution)

Changes resolution of arrays under conservation of the total sum. E. g. total val conservation.

Parameters:

array : numpy.ndarray

2D array, where resolution should be changed.

initial_resolution : float

Initial resolution of the entries in the array. Units are arcsec/pixel.

new_resolution : float

Wanted resolution of the entries in the array. Units are arcsec/pixel.

Methods

zoom() Actual change of resolution or zooming.
zoom_grid(name[, dpi, zoom_in]) Visualization of old and new grid.

Methods (detail)

zoom()

Actual change of resolution or zooming. Is an O(n^2) operation.

Returns:

array : numpy.ndarray

3D array with changed resolution. Note: now number of x and y entireties may have changed.

zoom_grid(name, dpi=None, zoom_in=1.0)

Visualization of old and new grid.

Parameters:

name : str

Name of the current project. E.g. use name from the FluxCompensator run to match with the file names.

dpi : None, scalar > 0

The resolution in dots per inch. None is default and will use the val savefig.dpi in the matplotlibrc file.

zoom_in : float <= 1.

If there are too many pixels it is helpful, to zoom in at the origin of the grid. The float zoom_in is the fraction of the initial grid size in arcsec. Default is 1..