convert_geometry_hex1d_to_rect2d

ctapipe.image.convert_geometry_hex1d_to_rect2d(geom, signal, key=None, add_rot=0)[source]

converts the geometry object of a camera with a hexagonal grid into a square grid by slanting and stretching the 1D arrays of pixel x and y positions and signal intensities are converted to 2D arrays. If the signal array contains a time-dimension it is conserved.

Parameters
geomCameraGeometry object

geometry object of hexagonal cameras

signalndarray

1D (no timing) or 2D (with timing) array of the pmt signals

key(default: None)

arbitrary key (float, string) to store the transformed geometry in a buffer The geometries (hex and rect) will be stored in a buffer. The key is necessary to make the conversion back from rect to hex.

add_rotint/float (default: 0)

parameter to apply an additional rotation of add_rot times 60°

Returns
new_geomCameraGeometry object

geometry object of the slanted picture now with a rectangular grid and a 2D grid for the pixel positions. contains now a 2D masking array signifying which of the pixels came from the original geometry and which are simply fillers from the rectangular grid

rot_imgndarray 2D (no timing) or 3D (with timing)

the rectangular signal image

Examples

camera = subarray.tel[tel_id].camera image = event.r0.tel[tel_id].image[0] key = camera.camera_name square_geom, square_image = convert_geometry_hex1d_to_rect2d(camera, image, key=key)