pymepix.util package

Submodules

pymepix.util.spidrDummyTCP module

class pymepix.util.spidrDummyTCP.TPX3Handler(request, client_address, server)[source]

Bases: socketserver.BaseRequestHandler, pymepix.core.log.Logger

handle()[source]
pymepix.util.spidrDummyTCP.main()[source]

pymepix.util.spidrDummyUDP module

pymepix.util.spidrDummyUDP.main()[source]

pymepix.util.storage module

Useful functions to store data

pymepix.util.storage.open_output_file(filename, ext, index=0)[source]
pymepix.util.storage.store_centroid(f, data)[source]
pymepix.util.storage.store_raw(f, data)[source]
pymepix.util.storage.store_toa(f, data)[source]
pymepix.util.storage.store_tof(f, data)[source]

pymepix.util.tcpsampler module

class pymepix.util.tcpsampler.TcpSampler(address, longtime, chunk_size=10000, flush_timeout=0.3, input_queue=None, create_output=True, num_outputs=1, shared_output=None)[source]

Bases: multiprocessing.context.Process, pymepix.core.log.ProcessLogger

Recieves tcp packets

The same as UdpSampler just with TCP

close_file
createConnection(address)[source]

Establishes a TCP connection

enable

Enables processing

Determines whether the class will perform processing, this has the result of signalling the process to terminate. If there are objects ahead of it then they will stop receiving data if an input queue is required then it will get from the queue before checking processing This is done to prevent the queue from growing when a process behind it is still working

Parameters:value (bool) – Enable value
Returns:Whether the process is enabled or not
Return type:bool
get_useful_packets(packet)[source]
init_new_process()[source]
outfile_name
post_run()[source]
pre_run()[source]
record

Enables saving data to disk

Determines whether the class will perform processing, this has the result of signalling the process to terminate. If there are objects ahead of it then they will stop recieving data if an input queue is required then it will get from the queue before checking processing This is done to prevent the queue from growing when a process behind it is still working

Parameters:value (bool) – Enable value
Returns:Whether the process should record and write to disk or not
Return type:bool
run()[source]

Method to be run in sub-process; can be overridden in sub-class

stopRaw2Disk()[source]

self.debug(‘Stopping Raw2Disk’) self.write2disk.close() self.write2disk.my_sock.send_string(‘SHUTDOWN’) # print(write2disk.my_sock.recv()) self.write2disk.write_thr.join() self.debug(‘Raw2Disk stopped’)

pymepix.util.tcpsampler.main()[source]

pymepix.util.timewalk module

pymepix.util.timewalk.compute_timewalk(tof, tot, region)[source]
pymepix.util.timewalk.compute_timewalk_lookup(tof, tot, region)[source]

Module contents