convert_geometry_rect2d_back_to_hexe1d

ctapipe.image.geometry_converter.convert_geometry_rect2d_back_to_hexe1d(geom, signal, key=None, add_rot=None)[source]

reverts the geometry distortion performed by convert_geometry_hexe1d_to_rect_2d back to a hexagonal grid stored in 1D arrays

Parameters
geomCameraGeometry

geometry object where pixel positions are stored in a 2D rectangular camera grid

signalndarray

pixel intensity stored in a 2D rectangular camera grid

key:

key to retrieve buffered geometry information (see convert_geometry_hex1d_to_rect2d)

add_rot:

not used – only here for backwards compatibility

Returns
old_geomCameraGeometry

the original geometry of the image

signalndarray

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

Notes

The back-conversion works with an internal buffer to store the transfer map (which was produced in the first conversion). If key is not found in said buffer, this function tries to perform a mock conversion. For this, it needs a CameraGeometry instance of the original camera layout, which it tries to load by name (i.e. the camera_name). The function assumes the original camera_name can be inferred from the given, modified one by: geom.camera_name.split('_')[0].

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) hex_geom, hex_image = convert_geometry_rect2d_back_to_hexe1d(square_geom, square_image, key = key)