pymepix.processing.logic package

Submodules

pymepix.processing.logic.centroid_calculator module

pymepix.processing.logic.datatypes_tpx4 module

Defines different packet types in Timepix4

class pymepix.processing.logic.datatypes_tpx4.PacketType(*values)[source]

Bases: IntEnum

Defines different types of Timepix4 packet

CtrlDataTest = 234

Continuous flow of test packets

CtrlDataTestB = 235

Continuous flow of test packets

DESYHeader = 248

Indicates DESY-specific header added to data stream

FrameEnd = 241

Indicates end of frame in frame mode

FrameStart = 240

Indicates start of frame in frame mode

Heartbeat = 224

Heartbeat timestamp

NoData = 4

Slow control link packets of FFFFFFFF00000000 indicate no data - this is a special case

PC24bitData = 3

Data from photon counting 24 bit mode

PixelData = 1

Decoded Pixel Data

RawData = 0

Raw 8-byte word

SequenceEnd = 243

Indicates end of sequence in frame mode

SequenceStart = 242

Indicates start of sequence in frame mode

ShutterFall = 226

Shutter fall timestamp

ShutterRise = 225

Shutter rise timestamp

SignalFall = 229

Configurable input signal fall timestamp

SignalRise = 228

Configurable input signal timestamp

T0Sync = 227

Synchronisation timestamp

TriggerData = 2

Decoded Trigger Data (NB - only distinguishable from pixeldata after processing)

Unknown = -1

Can be used to deal with other cases

class pymepix.processing.logic.datatypes_tpx4.ReadoutMode(*values)[source]

Bases: IntEnum

Event = 2
Frame16bit = 1
Frame8bit = 0
PC24bit = 3

pymepix.processing.logic.packet_processor module

class pymepix.processing.logic.packet_processor.PacketProcessor(handle_events=True, event_window=(0.0, 10000.0), position_offset=(0, 0), orientation=PixelOrientation.Up, start_time=0, timewalk_lut=None, *args, **kwargs)[source]

Bases: ProcessingStep

Class responsible to transform the raw data coming from the timepix directly into an easier processible data format. Takes into account the pixel- and trigger data to calculate toa and tof dimensions.

process(data):

Process data and return the result. To use this class only this method should be used! Use the other methods only for testing or if you are sure about what you are doing

clearBuffers()[source]
correct_global_time(arr, ltime)[source]
property event_window
find_events_fast()[source]
find_events_fast_post()[source]

Call this function at the very end of to also have the last two trigger events processed

getBuffers(val_filter=None)[source]
property handle_events

noindex:

orientPixels(col, row)[source]

Orient the pixels based on Timepix orientation

post_process()[source]
pre_process()[source]
process(data)[source]
process_pixels(pixdata, longtime)[source]
process_trigger1(trig1_data, longtime)[source]
process_trigger2(trig2_data, longtime)[source]
updateBuffers(val_filter)[source]
class pymepix.processing.logic.packet_processor.PixelOrientation(*values)[source]

Bases: IntEnum

Defines how row and col are intepreted in the output

Down = 2

x=-column, y = -row

Left = 1

x=row, y=-column

Right = 3

x=-row, y=column

Up = 0

Up is the default, x=column,y=row

pymepix.processing.logic.packet_processor_factory module

pymepix.processing.logic.packet_processor_tpx4 module

pymepix.processing.logic.processing_step module

class pymepix.processing.logic.processing_step.ProcessingStep(name, parameter_wrapper_class=<class 'pymepix.processing.logic.shared_processing_parameter.SharedProcessingParameter'>)[source]

Bases: ABC

Representation of one processing step in the pipeline for processing timepix raw data. Implementations are provided by PacketProcessor and CentroidCalculator. To combine those (and possibly other) classes into a pipeline they have to implement this interface. Also provides pre- and post-process implementations which are required for integration in the online processing pipeline (see PipelineCentroidCalculator and PipelinePacketProcessor).

Currently the picture is the following:
  • For post processing the CentroidCalculator and the PacketProcessor are used directly

  • PipelineCentroidCalculator and PipelinePacketProcessor build on top of CentroidCalculator and PacketProcessor to provide an integration in the existing online processing pipeline for online analysis.

post_process()[source]
pre_process()[source]
abstractmethod process(data)[source]

pymepix.processing.logic.shared_processing_parameter module

class pymepix.processing.logic.shared_processing_parameter.SharedProcessingParameter(value)[source]

Bases: object

Variang of the ProcessingParameter used for sharing among multiple processes. This class has to be used if running with the multiprocessing pipeline to ensure all instances of the processing classes are updated when parameters are changed.

property value
exception pymepix.processing.logic.shared_processing_parameter.UnknownParameterTypeException[source]

Bases: Exception

Module contents