pymepix package¶
Subpackages¶
- pymepix.SPIDR package
- Submodules
- pymepix.SPIDR.error module
PymePixExceptionSPIDRErrorDefsSPIDRErrorDefs.ERR_ADC_HARDWSPIDRErrorDefs.ERR_DAC_HARDWSPIDRErrorDefs.ERR_FLASH_STORAGESPIDRErrorDefs.ERR_ILLEGAL_PARSPIDRErrorDefs.ERR_MONITORSPIDRErrorDefs.ERR_MON_HARDWSPIDRErrorDefs.ERR_MSG_LENGTHSPIDRErrorDefs.ERR_NONESPIDRErrorDefs.ERR_NOT_IMPLEMENTEDSPIDRErrorDefs.ERR_SEQUENCESPIDRErrorDefs.ERR_TPX3_HARDWSPIDRErrorDefs.ERR_UNKNOWN_CMD
- pymepix.SPIDR.spidrcmds module
SpidrCmdsSpidrCmds.CMD_AUTOTRIG_STARTSpidrCmds.CMD_AUTOTRIG_STOPSpidrCmds.CMD_BIAS_SUPPLY_ENASpidrCmds.CMD_BURN_EFUSESpidrCmds.CMD_CLEAR_BUSYSpidrCmds.CMD_CONFIG_CTPRSpidrCmds.CMD_DDRIVEN_READOUTSpidrCmds.CMD_DECODERS_ENASpidrCmds.CMD_DISPLAY_INFOSpidrCmds.CMD_ERASE_ADDRPORTSSpidrCmds.CMD_ERASE_DACSSpidrCmds.CMD_ERASE_PIXCONFSpidrCmds.CMD_ERASE_REGISTERSSpidrCmds.CMD_GET_ADCSpidrCmds.CMD_GET_AVDDSpidrCmds.CMD_GET_AVDD_NOWSpidrCmds.CMD_GET_BOARDIDSpidrCmds.CMD_GET_CHIPBOARDIDSpidrCmds.CMD_GET_CTPRSpidrCmds.CMD_GET_DACSpidrCmds.CMD_GET_DEVICECOUNTSpidrCmds.CMD_GET_DEVICEIDSpidrCmds.CMD_GET_DEVICEIDSSpidrCmds.CMD_GET_DEVICEPORTSpidrCmds.CMD_GET_DVDDSpidrCmds.CMD_GET_DVDD_NOWSpidrCmds.CMD_GET_EFUSESSpidrCmds.CMD_GET_EXTSHUTTERCNTRSpidrCmds.CMD_GET_FANSPEEDSpidrCmds.CMD_GET_FIRMWVERSIONSpidrCmds.CMD_GET_FPGATEMPSpidrCmds.CMD_GET_GENCONFIGSpidrCmds.CMD_GET_GPIOSpidrCmds.CMD_GET_HEADERFILTERSpidrCmds.CMD_GET_HUMIDITYSpidrCmds.CMD_GET_IPADDR_DESTSpidrCmds.CMD_GET_IPADDR_SRCSpidrCmds.CMD_GET_LOCALTEMPSpidrCmds.CMD_GET_OUTBLOCKCONFIGSpidrCmds.CMD_GET_PIXCONFSpidrCmds.CMD_GET_PLLCONFIGSpidrCmds.CMD_GET_PRESSURESpidrCmds.CMD_GET_PWRPULSECONFIGSpidrCmds.CMD_GET_READOUTSPEEDSpidrCmds.CMD_GET_REMOTETEMPSpidrCmds.CMD_GET_SERVERPORTSpidrCmds.CMD_GET_SHUTTERCNTRSpidrCmds.CMD_GET_SHUTTERENDSpidrCmds.CMD_GET_SHUTTERSTARTSpidrCmds.CMD_GET_SLVSCONFIGSpidrCmds.CMD_GET_SOFTWVERSIONSpidrCmds.CMD_GET_SPIDRREGSpidrCmds.CMD_GET_SPIDR_ADCSpidrCmds.CMD_GET_STARTOPTSSpidrCmds.CMD_GET_TIMERSpidrCmds.CMD_GET_TPNUMBERSpidrCmds.CMD_GET_TPPERIODPHASESpidrCmds.CMD_GET_TRIGCONFIGSpidrCmds.CMD_GET_VDDSpidrCmds.CMD_GET_VDD_NOWSpidrCmds.CMD_MASKSpidrCmds.CMD_NOPSpidrCmds.CMD_NOREPLYSpidrCmds.CMD_PAUSE_READOUTSpidrCmds.CMD_PWRPULSE_ENASpidrCmds.CMD_READ_FLASHSpidrCmds.CMD_REINIT_DEVICESpidrCmds.CMD_REINIT_DEVICESSpidrCmds.CMD_REPLYSpidrCmds.CMD_RESET_COUNTERSSpidrCmds.CMD_RESET_DEVICESpidrCmds.CMD_RESET_DEVICESSpidrCmds.CMD_RESET_MODULESpidrCmds.CMD_RESET_PIXELSSpidrCmds.CMD_RESET_TIMERSpidrCmds.CMD_RESTART_TIMERSSpidrCmds.CMD_SELECT_CHIPBOARDSpidrCmds.CMD_SEQ_READOUTSpidrCmds.CMD_SET_BIAS_ADJUSTSpidrCmds.CMD_SET_BOARDIDSpidrCmds.CMD_SET_BUSYSpidrCmds.CMD_SET_CHIPBOARDIDSpidrCmds.CMD_SET_CTPRSpidrCmds.CMD_SET_CTPR_LEONSpidrCmds.CMD_SET_DACSpidrCmds.CMD_SET_DACS_DFLTSpidrCmds.CMD_SET_EXTDACSpidrCmds.CMD_SET_FANSPEEDSpidrCmds.CMD_SET_GENCONFIGSpidrCmds.CMD_SET_GPIOSpidrCmds.CMD_SET_GPIO_PINSpidrCmds.CMD_SET_HEADERFILTERSpidrCmds.CMD_SET_IPADDR_DESTSpidrCmds.CMD_SET_IPADDR_SRCSpidrCmds.CMD_SET_LOGLEVELSpidrCmds.CMD_SET_OUTBLOCKCONFIGSpidrCmds.CMD_SET_OUTPUTMASKSpidrCmds.CMD_SET_PIXCONFSpidrCmds.CMD_SET_PLLCONFIGSpidrCmds.CMD_SET_PWRPULSECONFIGSpidrCmds.CMD_SET_READOUTSPEEDSpidrCmds.CMD_SET_SENSEDACSpidrCmds.CMD_SET_SERVERPORTSpidrCmds.CMD_SET_SLVSCONFIGSpidrCmds.CMD_SET_SPIDRREGSpidrCmds.CMD_SET_TIMEOFDAYSpidrCmds.CMD_SET_TIMERSpidrCmds.CMD_SET_TPNUMBERSpidrCmds.CMD_SET_TPPERIODPHASESpidrCmds.CMD_SET_TRIGCONFIGSpidrCmds.CMD_STORE_ADDRPORTSSpidrCmds.CMD_STORE_DACSSpidrCmds.CMD_STORE_PIXCONFSpidrCmds.CMD_STORE_REGISTERSSpidrCmds.CMD_STORE_STARTOPTSSpidrCmds.CMD_T0_SYNCSpidrCmds.CMD_TPX_POWER_ENASpidrCmds.CMD_UPLOAD_PACKETSpidrCmds.CMD_VALID_ADDRPORTSSpidrCmds.CMD_VALID_DACSSpidrCmds.CMD_VALID_PIXCONFSpidrCmds.CMD_VALID_REGISTERSSpidrCmds.CMD_WRITE_FLASH
- pymepix.SPIDR.spidrcontroller module
SPIDRControllerSPIDRController.CpuToTpxSPIDRController.DeviceAndPortsSPIDRController.ShutterTriggerCountSPIDRController.ShutterTriggerCtrlSPIDRController.ShutterTriggerDelaySPIDRController.ShutterTriggerFreqSPIDRController.ShutterTriggerLengthSPIDRController.ShutterTriggerModeSPIDRController.TdcTriggerCounterSPIDRController.UdpMonPacketCounterSPIDRController.UdpPacketCounterSPIDRController.UdpPausePacketCounterSPIDRController.avddSPIDRController.avddNowSPIDRController.biasVoltageSPIDRController.boardFanSpeedSPIDRController.chipboardFanSpeedSPIDRController.chipboardIdSPIDRController.clearBusy()SPIDRController.closeShutter()SPIDRController.convertHtonl()SPIDRController.convertNtohl()SPIDRController.datadrivenReadout()SPIDRController.deviceCountSPIDRController.deviceIdsSPIDRController.disableExternalRefClock()SPIDRController.disablePeriphClk80Mhz()SPIDRController.dvddSPIDRController.dvddNowSPIDRController.enableDecoders()SPIDRController.enableExternalRefClock()SPIDRController.enablePeriphClk80Mhz()SPIDRController.externalShutterCounterSPIDRController.firmwareVersionSPIDRController.fpgaTemperatureSPIDRController.getAdc()SPIDRController.getSpidrReg()SPIDRController.humiditySPIDRController.linkCountsSPIDRController.localTemperatureSPIDRController.openShutter()SPIDRController.pauseReadout()SPIDRController.prepare()SPIDRController.pressureSPIDRController.reinitDevices()SPIDRController.remoteTemperatureSPIDRController.request()SPIDRController.requestGetBytes()SPIDRController.requestGetInt()SPIDRController.requestGetIntBytes()SPIDRController.requestGetInts()SPIDRController.requestSetInt()SPIDRController.requestSetIntBytes()SPIDRController.requestSetInts()SPIDRController.resetCounters()SPIDRController.resetDevices()SPIDRController.resetModule()SPIDRController.resetPacketCounters()SPIDRController.resetTimers()SPIDRController.restartTimers()SPIDRController.sequentialReadout()SPIDRController.setBiasSupplyEnable()SPIDRController.setBusy()SPIDRController.setPowerPulseEnable()SPIDRController.setShutterTriggerConfig()SPIDRController.setSpidrReg()SPIDRController.setTpxPowerPulseEnable()SPIDRController.shutterCounterSPIDRController.shutterTriggerConfigSPIDRController.softwareVersionSPIDRController.startAutoTrigger()SPIDRController.stopAutoTrigger()SPIDRController.vddSPIDRController.vddNow
main()
- pymepix.SPIDR.spidrdefs module
SpidrReadoutSpeedSpidrRegsSpidrRegs.SPIDR_CPU2TPX_WR_ISpidrRegs.SPIDR_DEVICES_AND_PORTS_ISpidrRegs.SPIDR_FE_GTX_CTRL_STAT_ISpidrRegs.SPIDR_IPMUX_CONFIG_ISpidrRegs.SPIDR_PIXEL_FILTER_ISpidrRegs.SPIDR_PIXEL_PKTCOUNTER_ISpidrRegs.SPIDR_PIXEL_PKTCOUNTER_OLD_ISpidrRegs.SPIDR_SHUTTERTRIG_CNT_ISpidrRegs.SPIDR_SHUTTERTRIG_CTRL_ISpidrRegs.SPIDR_SHUTTERTRIG_DELAY_ISpidrRegs.SPIDR_SHUTTERTRIG_FREQ_ISpidrRegs.SPIDR_SHUTTERTRIG_LENGTH_ISpidrRegs.SPIDR_TDC_TRIGGERCOUNTER_ISpidrRegs.SPIDR_UDPMON_PKTCOUNTER_ISpidrRegs.SPIDR_UDPPAUSE_PKTCOUNTER_ISpidrRegs.SPIDR_UDP_PKTCOUNTER_I
SpidrShutterMode
- pymepix.SPIDR.spidrdevice module
SpidrDeviceSpidrDevice.TpPeriodPhaseSpidrDevice.clearPixelConfig()SpidrDevice.columnTestPulseRegisterSpidrDevice.deviceIdSpidrDevice.devicePortSpidrDevice.genConfigSpidrDevice.getDac()SpidrDevice.getDacOut()SpidrDevice.getPixelConfig()SpidrDevice.headerFilterSpidrDevice.ipAddrDestSpidrDevice.ipAddrSrcSpidrDevice.linkStatusSpidrDevice.outBlockConfigSpidrDevice.pixelPacketCounterSpidrDevice.pllConfigSpidrDevice.powerPulseConfigSpidrDevice.readoutSpeedSpidrDevice.reinitDevice()SpidrDevice.reset()SpidrDevice.resetPixelConfig()SpidrDevice.resetPixels()SpidrDevice.serverPortSpidrDevice.setDac()SpidrDevice.setDacDefault()SpidrDevice.setExternalDac()SpidrDevice.setHeaderFilter()SpidrDevice.setOutputMask()SpidrDevice.setPixelMask()SpidrDevice.setPixelTestBit()SpidrDevice.setPixelThreshold()SpidrDevice.setSenseDac()SpidrDevice.setSinglePixelMask()SpidrDevice.setSinglePixelTestBit()SpidrDevice.setSinglePixelThreshold()SpidrDevice.setTpPeriodPhase()SpidrDevice.shutterEndSpidrDevice.shutterStartSpidrDevice.slaveConfigSpidrDevice.t0Sync()SpidrDevice.timerSpidrDevice.tpNumberSpidrDevice.uploadPacket()SpidrDevice.uploadPixelConfig()
- Module contents
- pymepix.TPX4 package
- Submodules
- pymepix.TPX4.tpx4chipdevice module
- pymepix.TPX4.tpx4controller module
Timepix4ControllerTimepix4Controller.boardFanSpeedTimepix4Controller.chipboardFanSpeedTimepix4Controller.closeShutter()Timepix4Controller.deviceCountTimepix4Controller.fpgaTemperatureTimepix4Controller.humidityTimepix4Controller.localTemperatureTimepix4Controller.openShutter()Timepix4Controller.prepare()Timepix4Controller.pressureTimepix4Controller.remoteTemperatureTimepix4Controller.resetTimers()Timepix4Controller.restartTimers()Timepix4Controller.setBiasSupplyEnable()Timepix4Controller.setShutterTriggerConfig()
- Module contents
- pymepix.channel package
- pymepix.clustering package
- pymepix.config package
- pymepix.core package
- pymepix.processing package
- Subpackages
- pymepix.processing.logic package
- Submodules
- pymepix.processing.logic.centroid_calculator module
- pymepix.processing.logic.datatypes_tpx4 module
- pymepix.processing.logic.packet_processor module
- pymepix.processing.logic.packet_processor_factory module
- pymepix.processing.logic.packet_processor_tpx4 module
- pymepix.processing.logic.processing_step module
- pymepix.processing.logic.shared_processing_parameter module
- Module contents
- pymepix.processing.logic package
- Submodules
- pymepix.processing.acquisition module
- pymepix.processing.baseacquisition module
AcquisitionPipelineAcquisitionPipeline.TAcquisitionPipeline.addStage()AcquisitionPipeline.confStages()AcquisitionPipeline.getConfigFromYaml()AcquisitionPipeline.getStage()AcquisitionPipeline.getStageByPipelineObject()AcquisitionPipeline.isRunningAcquisitionPipeline.numBlobProcessesAcquisitionPipeline.pipelineFactory()AcquisitionPipeline.reconfigure()AcquisitionPipeline.stagesAcquisitionPipeline.start()AcquisitionPipeline.stop()
AcquisitionStageAcquisitionStage.build()AcquisitionStage.configureStage()AcquisitionStage.kill_process()AcquisitionStage.numProcessAcquisitionStage.outputQueueAcquisitionStage.processesAcquisitionStage.setArgs()AcquisitionStage.stageAcquisitionStage.start()AcquisitionStage.startTrainID()AcquisitionStage.stop()AcquisitionStage.stopTrainID()
main()
- pymepix.processing.basepipeline module
- pymepix.processing.datatypes module
- pymepix.processing.pipeline_centroid_calculator module
- pymepix.processing.pipeline_packet_processor module
- pymepix.processing.rawfilesampler module
- pymepix.processing.rawtodisk module
- pymepix.processing.udpsampler3 module
- pymepix.processing.udpsampler4 module
- pymepix.processing.usbtrainid module
- Module contents
- Subpackages
- pymepix.util package
Submodules¶
pymepix.main module¶
pymepix.post_processing module¶
pymepix.pymepix_connection module¶
- class pymepix.pymepix_connection.PymepixConnection(pipeline_config)[source]¶
Bases:
objectHigh level class to work with timepix and perform acquistion
This class performs connection to SPIDR, initilization of timepix and handling of acquisition. Each individual timepix device can be accessed using the square bracket operator.
- Parameters:
spidr_address (
tupleofstrandint) – socket style tuple of SPIDR ip address and portsrc_ip_port (
tupleofstrandint, optional) – socket style tuple of the IP address and port of the interface that is connecting to SPIDR
Examples
Startup device
>>> timepix = PymepixConnection(('192.168.1.10',50000))
Find how many Timepix are connected
>>> len(timepix) 1
Set the Bias voltage >>> timepix.biasVoltage = 50
Access a specific Timepix device:
>>> timepix[0].deviceName W0026_K06
Load a config file into timepix
>>> timepix[0].loadSophyConfig('W0026_K06_50V.spx')
- property biasVoltage¶
Bias voltage in volts
- property chanAddress¶
- property dataCallback¶
Function to call when data is received from a timepix device
This has the effect of disabling polling.
- enablePolling(maxlen=100)[source]¶
Enables polling mode
This clears any user defined callbacks and the polling buffer
- getDevice(num) TimepixDevice[source]¶
- property isAcquiring¶
- property numDevices¶
- poll(block=False)[source]¶
If polling is used, returns data stored in data buffer.
the buffer is in the form of a ring and will overwrite older values if it becomes full
- Return type:
MessageType, data
- property pollBufferLength¶
Get/Set polling buffer length
Clears buffer on set
pymepix.timepix4def module¶
pymepix.timepix4device module¶
- class pymepix.timepix4device.Timepix4Device(tpx4_device, data_queue, pipeline_config)[source]¶
Bases:
objectProvides a control of a timepix4 object
- property Vthreshold_coarse¶
- property Vthreshold_fine¶
- property acquisition¶
Returns the acquisition object
Can be used to set parameters in the acqusition directly for example, to setup TOF calculation when using a
PixelPipeline>>> tpx.acqusition.enableEvents False >>> tpx.acquistion.enableEvents = True
- property config¶
- devIdToString()[source]¶
Converts device ID into readable string
- Returns:
Device string identifier
- Return type:
str
- property deviceName¶
- property pixelMask¶
Pixel mask set for timepix device
- Parameters:
value (
numpy.arrayofint) – 256x256 uint8 threshold mask to set locally- Returns:
Locally stored pixel mask matrix
- Return type:
numpy.arrayofintorNone
- property pixelTest¶
Pixel test set for timepix device
- Parameters:
value (
numpy.arrayofint) – 256x256 uint8 pixel test to set locally- Returns:
Locally stored pixel test matrix
- Return type:
numpy.arrayofintorNone
- property pixelThreshold¶
Threshold set for timepix device
- Parameters:
value (
numpy.arrayofint) – 256x256 uint8 threshold to set locally- Returns:
Locally stored threshold matrix
- Return type:
numpy.arrayofintorNone
- setConfigClass(klass: TimepixConfig)[source]¶
- setEthernetFilter(eth_filter)[source]¶
Sets the packet filter, usually set to 0xFFFF to all all packets
pymepix.timepixdef module¶
- class pymepix.timepixdef.DacRegisterCodes(*values)[source]¶
Bases:
IntEnum- Ibias_CP_PLL = 17¶
- Ibias_DiscS1_OFF = 9¶
- Ibias_DiscS1_ON = 8¶
- Ibias_DiscS2_OFF = 11¶
- Ibias_DiscS2_ON = 10¶
- Ibias_Ikrum = 4¶
- Ibias_PixelDAC = 12¶
- Ibias_Preamp_OFF = 2¶
- Ibias_Preamp_ON = 1¶
- Ibias_TPbufferIn = 13¶
- Ibias_TPbufferOut = 14¶
- PLL_Vcntrl = 18¶
- VPreamp_NCAS = 3¶
- VTP_coarse = 15¶
- VTP_fine = 16¶
- Vfbk = 5¶
- Vthreshold_coarse = 7¶
- Vthreshold_fine = 6¶
- class pymepix.timepixdef.GrayCounter(*values)[source]¶
Bases:
IntEnum- Disable = 0¶
- Enable = 8¶
- Mask = 8¶
- class pymepix.timepixdef.OperationMode(*values)[source]¶
Bases:
IntEnum- EventiTot = 4¶
- Mask = 6¶
- ToA = 2¶
- ToAandToT = 0¶
- class pymepix.timepixdef.SuperPixel(*values)[source]¶
Bases:
IntEnum- Disable = 0¶
- Enable = 64¶
- Mask = 64¶
- class pymepix.timepixdef.TestPulse(*values)[source]¶
Bases:
IntEnum- Disable = 0¶
- Enable = 32¶
- Mask = 32¶
- class pymepix.timepixdef.TestPulseDigAnalog(*values)[source]¶
Bases:
IntEnum- DiscriminatorDigital = 512¶
- FrontEndAnalog = 0¶
- Mask = 512¶
- class pymepix.timepixdef.TestPulseGenerator(*values)[source]¶
Bases:
IntEnum- External = 1024¶
- Internal = 0¶
- Mask = 1024¶
pymepix.timepixdevice module¶
- class pymepix.timepixdevice.TimepixDevice(spidr_device, data_queue, pipeline_config)[source]¶
Bases:
objectProvides high level control of a timepix/medipix object
- property Ibias_DiscS1_OFF¶
[0, 15]
- property Ibias_DiscS1_ON¶
[0, 255]
- property Ibias_DiscS2_OFF¶
[0, 15]
- property Ibias_DiscS2_ON¶
[0, 255]
- property Ibias_Ikrum¶
[0, 255]
- property Ibias_PixelDAC¶
[0, 255]
- property Ibias_Preamp_OFF¶
[0, 15]
- property Ibias_Preamp_ON¶
[0, 255]
- property Ibias_TPbufferIn¶
[0, 255]
- property Ibias_TPbufferOut¶
[0, 255]
- property VPreamp_NCAS¶
[0, 255]
- property VTP_coarse¶
[0, 255]
- property VTP_fine¶
[0, 511]
- property Vfbk¶
[0, 255]
- property Vthreshold_coarse¶
[0, 15]
- property Vthreshold_fine¶
[0, 511]
- property acquisition¶
Returns the acquisition object
Can be used to set parameters in the acqusition directly for example, to setup TOF calculation when using a
PixelPipeline>>> tpx.acqusition.enableEvents False >>> tpx.acquistion.enableEvents = True
- property config¶
- devIdToString()[source]¶
Converts device ID into readable string
- Returns:
Device string identifier
- Return type:
str
- property deviceName¶
- property grayCounter¶
- property maskPixelsJsonable¶
- property operationMode¶
- property pixelMask¶
Pixel mask set for timepix device
- Parameters:
value (
numpy.arrayofint) – 256x256 uint8 threshold mask to set locally- Returns:
Locally stored pixel mask matrix
- Return type:
numpy.arrayofintorNone
- property pixelTest¶
Pixel test set for timepix device
- Parameters:
value (
numpy.arrayofint) – 256x256 uint8 pixel test to set locally- Returns:
Locally stored pixel test matrix
- Return type:
numpy.arrayofintorNone
- property pixelThreshold¶
Threshold set for timepix device
- Parameters:
value (
numpy.arrayofint) – 256x256 uint8 threshold to set locally- Returns:
Locally stored threshold matrix
- Return type:
numpy.arrayofintorNone
- property polarity¶
- setDac(code, value)[source]¶
Sets the DAC parameter using codes
- Parameters:
code (
int) – DAC code to setvalue (
int) – value to set
- setupDevice()[source]¶
Sets up valid paramters for acquisition
This will be manual when other acqusition parameters are working
- property superPixel¶
- property testPulse¶
- property testPulseDigitalAnalog¶
- property testPulseGeneratorSource¶
- property timeOfArrivalClock¶
- property timerOverflowControl¶