import matplotlib.pyplot as plt
import hipecta.core as core
[docs]def pixel_position(tmp, ax=None, **kwargs):
"""
Plot the pixel position of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, **kwargs)
ax.set_title('Pixel position')
ax.axis('equal')
return ax
[docs]def mat_slice(tmp, ax=None, **kwargs):
"""
Plot the matrix of the calibrated signal of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
if not 'aspect' in kwargs:
kwargs['aspect'] = 'auto'
im = ax.imshow(tmp.matSignal, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Matrix sliced ADC signal')
return ax
[docs]def gain_hi(tmp, ax=None, **kwargs):
"""
Plot the high gain of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabGainHi, **kwargs)
ax.figure.colorbar(im)
ax.set_title('High gain')
ax.axis('equal')
return ax
[docs]def gain_lo(tmp, ax=None, **kwargs):
"""
Plot the low gain of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabGainLo, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Low gain')
ax.axis('equal')
return ax
[docs]def ped_hi(tmp, ax=None, **kwargs):
"""
Plot the pedestal high gain for one slice of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabPedHi, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Pedestal high gain (1 slice)')
ax.axis('equal')
return ax
[docs]def ped_lo(tmp, ax=None, **kwargs):
"""
Plot the pedestal low gain for one slice of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabPedLo, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Pedestal low gain (1 slice)')
ax.axis('equal')
return ax
[docs]def mat_calib(tmp, ax=None, **kwargs):
"""
Plot the matrix of the calibrated signal of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
if not 'aspect' in kwargs:
kwargs['aspect'] = 'auto'
im = ax.imshow(tmp.matCalibratedSignal, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Matrix calibrated signal')
return ax
[docs]def injunction_table(tmp, ax=None, **kwargs):
"""
Plot the matrix of the injunction table of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.plot(tmp.tabInjunction, **kwargs)
ax.set_title('Injunction table')
return ax
[docs]def mat_neighbour_quad_sum(tmp, ax=None, **kwargs):
"""
Plot the matrix of the summed neighbours signal (last slice) of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
if not 'aspect' in kwargs:
kwargs['aspect'] = 'auto'
im = ax.imshow(tmp.matNeighbourQuadSum, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Summed neighbours signal (last slice)')
return ax
[docs]def mat_neighbour_slice(tmp, ax=None, **kwargs):
"""
Plot the matrix of the slice signal (last slice) of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
if not 'aspect' in kwargs:
kwargs['aspect'] = 'auto'
im = ax.imshow(tmp.matNeighbourSlice, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Summed neighbours slice signal (last slice)')
return ax
[docs]def mat_neighbour_pixel_sum(tmp, ax=None, **kwargs):
"""
Plot the matrix of photo-electron sum of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
if not 'aspect' in kwargs:
kwargs['aspect'] = 'auto'
im = ax.imshow(tmp.matNeighbourPixelSum, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Summed neighbours Pe')
return ax
[docs]def max_value(tmp, ax=None, **kwargs):
"""
Plot the maximum values of the sliced calibrated signal of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabMax, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Max values')
ax.axis('equal')
return ax
[docs]def max_pos(tmp, ax=None, **kwargs):
"""
Plot the slices of the maximum values of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabPosMax, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Slices of the maximum values')
ax.axis('equal')
return ax
[docs]def calib_signal(tmp, ax=None, **kwargs):
"""
Plot the calibrated signal (after cleaning if there is one) of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabCalibSignal, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Calibrated signal (after cleaning if there is one)')
ax.axis('equal')
return ax
[docs]def gain_correction(tmp, ax=None, **kwargs):
"""
Plot the gain correction of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabGainCorrection, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Gain correction')
ax.axis('equal')
return ax
[docs]def mat_signal_quad(tmp, ax=None, **kwargs):
"""
Plot the Matrix of the calibrated integrated signal of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
if not 'aspect' in kwargs:
kwargs['aspect'] = 'auto'
im = ax.imshow(tmp.matSignalQuad, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Calibrated integrated signal')
return ax
[docs]def mat_keep_quad(tmp, ax=None, **kwargs):
"""
Plot the Matrix of the keeped pixel (1 keep, 0 drop) of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
if not 'aspect' in kwargs:
kwargs['aspect'] = 'auto'
im = ax.imshow(tmp.matKeepSignalQuad, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Keep pixel')
return ax
[docs]def keep_hex(tmp, ax=None, **kwargs):
"""
Plot the keeped pixel after the cleaning of the temporary hipecta.core.PRecoTemporary
-------------
Return matplotlib axis of the corresponding plot
"""
ax = plt.gca() if ax is None else ax
im = ax.scatter(tmp.tabPosPixelX, tmp.tabPosPixelY, c=tmp.tabKeepSignalHex, **kwargs)
ax.figure.colorbar(im)
ax.set_title('Keep pixel')
ax.axis('equal')
return ax
[docs]def plot_all(tmp):
"""
Plot all the control plots of the temporary hipecta.core.PRecoTemporary
"""
fig = plt.figure(figsize=(18,22))
fig.subplots_adjust(left=0.2, wspace=0.6)
gridSize = (5,3)
gain_hi(tmp, plt.subplot2grid(gridSize, (0,0)))
gain_lo(tmp, plt.subplot2grid(gridSize, (0,1)))
gain_correction(tmp, plt.subplot2grid(gridSize, (0,2)))
ped_hi(tmp, plt.subplot2grid(gridSize, (1,0)))
ped_lo(tmp, plt.subplot2grid(gridSize, (1,1)))
mat_slice(tmp, plt.subplot2grid(gridSize, (2,0)))
mat_calib(tmp, plt.subplot2grid(gridSize, (2,1)))
calib_signal(tmp, plt.subplot2grid(gridSize, (2,2)))
max_value(tmp, plt.subplot2grid(gridSize, (3,0)))
max_pos(tmp, plt.subplot2grid(gridSize, (3,1)))
injunction_table(tmp, plt.subplot2grid(gridSize, (3,2)))
mat_signal_quad(tmp, plt.subplot2grid(gridSize, (4,0)))
mat_keep_quad(tmp, plt.subplot2grid(gridSize, (4,1)))
keep_hex(tmp, plt.subplot2grid(gridSize, (4,2)))
plt.tight_layout()
plt.show()