This reference manual describes various modules available to Python code in Pyana jobs and their complete API. It contains complete technical description, but has very few examples. For more user-oriented description with examples and detailed explanations consult Pyana User Manual.
Package pyana
This package collects code which deals with various aspects of the analysis tasks.
Module pyana.event
This module is a collection of classes and methods to deal with the event data and everything related to it.
Class pyana.event.Event
Instance of this class contains all event data.
Construction
Usage: evt = pyana.event.Event(dg)
Creates event object from the corresponding XTC datagram object.
Parameters:
dg
– datagram object of type_pdsdata.xtc.Dgram
Method find()
Usage: objects = evt.find(...)
Returns possibly empty list of data objects contained in the event. This method accepts a number of arguments, but all arguments are optional. If no arguments are given then a list of all data objects is returned. If some arguments are given then only those objects that satisfy a particular criteria are returned. The list of possible keyword arguments:
typeId
– accepts enumxtc.TypeId.Type
, only return objects which have that TypeIdversion
– accepts number, only return objects whose type version number is equal to numberlevel
– accepts one ofxtc.Level
values, only returns objects originated at that leveldetector
– accepts enumxtc.DetInfo.Detector
values, only returns objects produced by this detectordetId
– accepts number, only returns objects produced by this detector IDdevice
– accepts enumxtc.DetInfo.Device
values, only returns objects produced by this devicedevId
– accepts number, only returns objects produced by this device IDaddress
–xtc.DetInfo
object or an address string (see User Manual)
The parameters address
and any of the detector
, detId
, device
, devId
are incompatible, specify only one or another.
Method findFirst()
Usage: object = evt.findFirst(...)
Accepts the same set of arguments as find()
methods but instead of list of objects returns fist object found. If no object is satisfying all selection criteria then None
is returned.
Method getAcqConfig()
Usage: acqConfig = evt.getAcqConfig(address)
Returns Acqiris configuration data of type acqiris.ConfigV*
for specific device. If address given is not very specific then the first matching object is returned.
Parameters:
- address –
xtc.DetInfo
object or an address string (see User Manual)
Ordinary configuration objects are contained in a Configure
type datagrams only. For client code that means that this method can be used in beginjob()
or beginrun()
methods only. Note also that configuration objects are stored in the Pyana environment and preferred way to access configuration information is through the environment. This makes this method of little utility to end users.
Method getAcqValue()
Usage: acqData = evt.getAcqValue(address, channel, env)
Returns Acqiris data object of type pypdsdata.acqiris.DataDescV*
for specific device and channel. If address given is not very specific then the first matching object is returned.
Parameters:
- address –
xtc.DetInfo
object or an address string (see User Manual) - channel – channel number from 0 to max number of channels
- env – environment object containing Acqiris configuration object
Channel number is an integer number, total number of channels can be extracted from the Acqiris configuration object.
Method getEBeam()
Usage: obj = evt.getEBeam()
Returns data object of type bld.BldDataEBeam
or bld.BldDataEBeamV0
whichever is present in the event.
Method getFeeGasDet()
Usage: array = evt.getFeeGasDet()
Returns the list of 4 numbers [f_11_ENRC, f_12_ENRC, f_21_ENRC, f_22_ENRC]
obtained from bld.BldDataFEEGasDetEnergy
object.
Method getPrincetonValue()
Usage: frame = evt.getPrincetonValue(address, env)
Returns Princeton frame object of type pypdsdata.princeton.Frame*
for specific device. If address given is not very specific then the first matching object is returned.
Parameters:
- address –
xtc.DetInfo
object or an address string (see User Manual) - env – environment object containing Acqiris configuration object
Method getPhaseCavity()
Usage: obj = evt.getPhaseCavity()
Returns data object of type bld.BldDataPhaseCavity
.
Method getPnCcdValue()
Usage: frame = evt.getPnCcdValue(address, env)
returns pnCCD data object of type pypdsdata.pnccd.FrameV*
for specific device. If address given is not very specific then the first matching object is returned.
Parameters:
- address –
xtc.DetInfo
object or an address string (see User Manual) - env – environment object containing pnCCD configuration object
Method getTime()
Usage: t = evt.getTime()
Returns _pdsdata.xtc.ClockTime
object, equivalent to dg.seq.clock()
Method seq()
Usage: s = evt.seq()
Returns _pdsdata.xtc.Sequence
object, equivalent to dg.seq
Class pyana.event.Env
Instance of this class is a container for all sorts of environment data.
Construction
Usage: env = pyana.event.Env(jobName="pyana", hmgr=None, subproc=False)
Creates environment object.
Parameters:
- jobName – analysis job name, arbitrary string
- hmgr – histogram manager object
- subproc – flag which must be set to true when running in pyana sub-process
Objects of this type are created by pyana itself and end users do not need to create new instances.
Method epicsStore()
Usage: store = env.epicsStore()
This is the primary method for user code to access EPICS data. It returns event.EpicsStore
object which can be used to retrieve the state of the individual EPICS channels.
Method getAcqConfig()
Usage: acqConfig = env.getAcqConfig(address)
Returns Acqiris configuration object for a given device address. If more than one object is matched by the parameters then first arbitrary object is returned. None
is returned if no object is found.
Parameters:
address
–xtc.DetInfo
object or an address string (see User Manual)
Method getControlConfig()
Usage: opalConfig = env.getControlConfig()
Returns control.Config configuration object or None
.
Method getOpal1kConfig()
Usage: opalConfig = env.getOpal1kConfig(address)
Returns Opal1k configuration object for a given device address. If more than one object is matched by the parameters then first arbitrary object is returned. None
is returned if no object is found.
Parameters:
address
–xtc.DetInfo
object or an address string (see User Manual)
Method getPnCCDConfig()
Usage: pnccdConfig = env.getPnCCDConfig(address)
Returns pnCCD configuration object for a given device address. If more than one object is matched by the parameters then first arbitrary object is returned. None
is returned if no object is found.
Parameters:
address
–xtc.DetInfo
object or an address string (see User Manual)
Method hmgr()
Usage: hmgr = env.hmgr()
Returns histogram manager object of type pyana.histo.HistoManager*
.
Method jobName()
Usage: jobName = env.jobName()
Returns analysis job name string.
Method jobNameSub()
Usage: jobName = env.jobNameSub()
Returns process-specific analysis job name string. In case of multi-processing job it will a string in format "jobName-procNum" where procNum is a number returned by subprocess()
. In case of single-process job it will return the same string as jobName()
.
Method mkfile()
Usage: file = env.mkfile(filename, mode='w', bufsize=-1)
Opens file for writing output data. This is pyana's alternative for Python open() function which supports multi-processing. If user needs the data in this file to be merged with the files produced by other processes then mkfile() has to be used in place of open().
Parameters:
- filename – output file name
- mode – open mode, currently any "w*" modes are supported
- bufsize – output buffer size, default is to use Python's default
In case of single-process job this method is equivalent to a regular Python open() method. In case of multi-processing when this method is called from a sub-process then the file is created somewhere in a temporary location (with unique name). At the end of the job files from all sub-processes are merged into one file with name filename and the temporary files are deleted.
Method subprocess()
Usage: num = env.subprocess()
Returns sub-process number. In case of multi-processing job it will be a non-negative number ranging from 0 to a total number of sub-processes. In case of single-process job it will return -1.
Method result()
Usage: data = env.result()
Method used by pyana to extract the data produced by a single sub-process in multi-processing setup. Not to be used by end users.
Method update()
Usage: env.update(evt)
This method updates environment contents with selected data from event object. This is equivalent to calling env.updateEpics() and env.updateConfig().
Parameters:
- evt – event object of type
event.Event
This method is not supposed to be called from user code, pyana takes care of all updates itself.
Method updateEpics()
Usage: env.updateEpics(evt)
This method updates environment EPICS data from event object.
Parameters:
- evt – event object of type
event.Event
This method is not supposed to be called from user code, pyana takes care of all updates itself.
Method updateConfig()
Usage: env.updateConfig(evt)
This method copies configuration objects from event object into environment.
Parameters:
- evt – event object of type
event.Event
This method is not supposed to be called from user code, pyana takes care of all updates itself.
Class pyana.event.EpicsStore
Instance of this class contains current status of all EPICS channels. It is updated from event data on every new event.
Construction
Usage: store = pyana.event.EpicsStore()
Creates EPICS store object.
Objects of this type are created by pyana itself and end users do not need to create new instances.
Method update()
Usage: store.update(evt)
This method updates environment EPICS data from event object.
Parameters:
- evt – event object of type
event.Event
This method is not supposed to be called from user code, pyana takes care of all updates itself.
Method value()
Usage epics = store.value(name)
Returns current value of the EPICS channel with the given name. The type of returned data is either epics.EpicsPvCtrl
or epics.EpicsPvTime
.
Parameters:
- name – name of the EPICS channel
This is the primary method to access EPICS information in pyana jobs.
Module pyana.histo
This module is a collection classes and methods to create and manage histograms from user analysis modules.
Class pyana.histo.HistoMgrRoot
This class represents histogram manager implementation based on ROOT library. Histograms that are created by this manager reside either in memory or in a ROOT file.
Construction
Usage: hmgr = pyana.histo.HistoMgrRoot(...)
Creates new histogram manager object. Users should not instantiate new objects, instead the environment method hmgr()
should be used to obtain existing manager object.
Keyword arguments:
- file – name of the ROOT file to store histograms, if missing then histograms will be memory-resident
Method h1d()
Usage: hist = hmgr.h1d(...)
Creates 1-dimensional histogram with bin contents stored as double precision numbers.
Method accepts the same arguments as the constructors of the corresponding C++ ROOT class TH1D. The returned object also inherits most of the methods of the C++ class.
Method h1f()
Usage: hist = hmgr.h1f(...)
Creates 1-dimensional histogram with bin contents stored as single precision numbers.
Method accepts the same arguments as the constructors of the corresponding C++ ROOT class TH1F. The returned object also inherits most of the methods of the C++ class.
Method h1i()
Usage: hist = hmgr.h1i(...)
Creates 1-dimensional histogram with bin contents stored as integer numbers.
Method accepts the same arguments as the constructors of the corresponding C++ ROOT class TH1I. The returned object also inherits most of the methods of the C++ class.
Method h2d()
Usage: hist = hmgr.h2d(...)
Creates 2-dimensional histogram with bin contents stored as double precision numbers.
Method accepts the same arguments as the constructors of the corresponding C++ ROOT class TH2D. The returned object also inherits most of the methods of the C++ class.
Method h2f()
Usage: hist = hmgr.h2f(...)
Creates 2-dimensional histogram with bin contents stored as single precision numbers.
Method accepts the same arguments as the constructors of the corresponding C++ ROOT class TH2F. The returned object also inherits most of the methods of the C++ class.
Method h2i()
Usage: hist = hmgr.h2i(...)
Creates 2-dimensional histogram with bin contents stored as integer numbers.
Method accepts the same arguments as the constructors of the corresponding C++ ROOT class TH2F. The returned object also inherits most of the methods of the C++ class.
Method prof()
Usage: hist = hmgr.prof(...)
Creates 1-dimensional profile histogram with bin contents stored as double precision numbers.
Method accepts the same arguments as the constructors of the corresponding C++ ROOT class TProfile. The returned object also inherits most of the methods of the C++ class.
Method prof2d()
Usage: hist = hmgr.prof2d(...)
Creates 2-dimensional profile histogram with bin contents stored as double precision numbers.
Method accepts the same arguments as the constructors of the corresponding C++ ROOT class TProfile2D. The returned object also inherits most of the methods of the C++ class.
Function pyana.histo.HistoMgr()
Usage: hmgr = HistoMgr(...)
Do not call it, it's for pyana internal use.
Module _pdsdata
This is a Python extension module which provides Python interface for all pdsdata classes and functions. It is implemented in C++ and exists as a loadable module (library). The Python classes in this module try to mimic the interfaces and behavior of their corresponding C++ classes as closely as possible. In many cases this is trivial to achieve, but there may be few differences which are noted explicitly in every case. One notable difference is C++ enums which define symbolic names for integral constants. Python emulation of enums is complicated for a number of reasons such as absence of true enum type in Python and dynamic nature of language. The implementation of the enums in Python in this case is done through the introduction of special new type with the static members whose names and values correspond to C++ enums. It is better explained with example. Suppose there is a class in C++:
class DetInfo { enum Detector{ NoDetector, AmoIms, AmoGasdet, ... }; };
Then the corresponding construct in Python can be expressed approximately like this:
class DetInfo : class Detector (int): NoDetector = Detector(0) AmoIms = Detector(1) AmoGasdet = Detector(2)
The main difference in use is that in C++ to get enum value one needs to write DetInfo.AmoIms
when in Python it needs to be DetInfo.Detector.AmoIms
.
Class _pdsdata.Error
This is the type for the exception generated by few methods in _pdsdata package.
Construction
Usage: raise Error(message)
Arguments:
- message – string describing the error
Module _pdsdata.xtc
This module contains classes corresponding to those in C++ pdsdata/xtc package.
Class _pdsdata.xtc.BldInfo
Python wrapper for pdsdata/xtc/BldInfo class. Unlike C++ this class does not inherit from Src class (Src class does not exist in this module) but uses dynamic Python features to implement the same interface as in Src class. In addition to methods described here the class also defines __hash__
and __cmp__
methods based on the content of the object and can be used as a key in the dictionaries.
Enum Type
This enum is an embedded type of BldInfo
class. Following enum members are defined currently:
BldInfo.Type.EBeam
BldInfo.Type.PhaseCavity
BldInfo.Type.FEEGasDetEnergy
BldInfo.Type.NumberOf
Construction
Usage: bld = xtc.BldInfo(processId, type)
Arguments:
- processId – integer number
- type – one of the
BldInfo.Type
enum values
Method level()
Usage: lvl = bld.level()
Returns enum value of type xtc.Level
which defines source level.
Method log()
Usage: log = bld.log()
Returns logical address of data source as integer number.
Method phy()
Usage: phy = bld.phy()
Returns physical address of data source as integer number.
Method processId()
Usage: processId = bld.processId()
Returns process ID as integer number.
Method type()
Usage: type = bld.type()
Returns BldInfo type which is a value of BldInfo.Type
.
Class _pdsdata.xtc.ClockTime
Python wrapper for pdsdata/xtc/ClockTime class. In addition to methods described here the class also defines __hash__
and __cmp__
methods based on the content of the object and can be used as a key in the dictionaries.
Construction
Usage: clock = xtc.ClockTime([seconds, [nanoseconds]])
Creates new instance of type.
Arguments:
- seconds – seconds since UNIX epoch
- nanosecods – nanoseconds within second
If any argument is missing it is assumed to be 0.
Method seconds()
Usage: sec = clock.seconds()
Returns the number of seconds as integer number.
Method nanoseconds()
Usage: nsec = clock.nanoseconds()
Returns the number of nanoseconds as integer number.
Class _pdsdata.xtc.Damage
Python wrapper for pdsdata/xtc/Damage class.
Enum Value
This enum is an internal type of Damage
class. Following enum members are defined currently:
Damage.Value.DroppedContribution
Damage.Value.OutOfOrder
Damage.Value.OutOfSynch
Damage.Value.UserDefined
Damage.Value.IncompleteContribution
Damage.Value.ContainsIncomplete
The values of enum constants define the bit number in the damage mask.
Enum Mask
Python Only
This enum does not exist in C++ class, has been added to Python for convenience
This enum is an internal type of Damage
class. Following enum members are defined currently:
Damage.Mask.DroppedContribution
Damage.Mask.OutOfOrder
Damage.Mask.OutOfSynch
Damage.Mask.UserDefined
Damage.Mask.IncompleteContribution
Damage.Mask.ContainsIncomplete
The values of enum constants define the bit mask in the damage mask. Mask enum is equivalent to 1<<Value enum.
Construction
Usage: dmg = xtc.Damage([value])
Arguments:
- value – complete damage mask as an integer number, if missing then assumed 0
Method value()
Usage: mask = dmg.value()
Returns complete damage mask as integer number.
Method hasDamage()
Usage: result = dmg.hasDamage(value)
Returns true if the corresponding damage bit is set.
Arguments:
- value – bit number of the damage mask, one of the
Damage.Value
enums
Class _pdsdata.xtc.DetInfo
Python wrapper for pdsdata/xtc/DetInfo class. Unlike C++ this class does not inherit from Src class (Src class does not exist in this module) but uses dynamic Python features to implement the same interface as in Src class. In addition to methods described here the class also defines __hash__
and __cmp__
methods based on the content of the object and can be used as a key in the dictionaries.
Enum Detector
This enum is an embedded type of DetInfo
class. Following enum members are defined currently:
DetInfo.Detector.NoDetector
DetInfo.Detector.AmoIms
DetInfo.Detector.AmoGasdet
DetInfo.Detector.AmoETof
DetInfo.Detector.AmoITof
DetInfo.Detector.AmoMbes
DetInfo.Detector.AmoVmi
DetInfo.Detector.AmoBps
DetInfo.Detector.Camp
DetInfo.Detector.EpicsArch
DetInfo.Detector.BldEb
DetInfo.Detector.NumDetector
Enum Device
This enum is an embedded type of DetInfo
class. Following enum members are defined currently:
DetInfo.Device.NoDevice
DetInfo.Device.Evr
DetInfo.Device.Acqiris
DetInfo.Device.Opal1000
DetInfo.Device.TM6740
DetInfo.Device.pnCCD
DetInfo.Device.NumDevice
Construction
Usage: det = xtc.DetInfo(processId, detector, detId, device, devId)
Arguments:
- processId – integer number
- detector – one of the
DetInfo.Detector
enum values - detId – detector ID as integer number
- device – one of the
DetInfo.Device
enum values - devId – device ID as integer number
Method level()
Usage: lvl = det.level()
Returns enum value of type xtc.Level
which defines source level.
Method log()
Usage: log = det.log()
Returns logical address of data source as integer number.
Method phy()
Usage: phy = det.phy()
Returns physical address of data source as integer number.
Method processId()
Usage: processId = det.processId()
Returns process ID as integer number.
Method detector()
Usage: detector = det.detector()
Returns detector enum which is a value of DetInfo.Detector
.
Method device()
Usage: device = det.device()
Returns device enum which is a value of DetInfo.Device
.
Method detId()
Usage: detId = det.detId()
Returns detector ID as integer number.
Method devId()
Usage: devId = det.devId()
Returns device ID as integer number.
Class _pdsdata.xtc.Dgram
Python wrapper for pdsdata/xtc/Dgram class.
Construction
Usage: dg = xtc.Dgram(buffer)
One of the ways to create Dgram objects is from a Python buffer objects.
Arguments:
- buffer – any object that implements buffer interface
Property env
Usage: env = dg.env
Returns the env field as an integer number.
Property seq
Usage: seq = dg.seq
Returns the seq field as an object of type xtc.Seq
.
Property xtc
Usage: x = dg.xtc
Returns top-level Xtc as object of type xtc.Xtc
.
Class _pdsdata.xtc.Level
Python wrapper for pdsdata/xtc/Level class. C++ class does not define any data members or methods, it only defines single enum type. C++ cannot be instantiated in any meaningful way. Python class in addition to defining corresponding enum constants can also be instantiated, the instances are regular integer numbers with additional printing enhancements.
Enum Type
Unlike other enum types which create separate new type inside original Python type, the enums in Level class are defined directly in the class. Known enums:
Level.Control
Level.Source
Level.Segment
Level.Event
Level.Recorder
Level.Observer
Level.Reporter
Level.NumberOfLevels
Construction
Usage: lvl = xtc.Level(number)
Arguments:
- number – any of the above enums can be used
Method __str__
Usage: s = str(lvl)
Returns a name of the corresponding enum.
Method __repr__
Usage: s = repr(lvl)
Returns a string in the form "<Level(num):name>" where num and name are the value and the name of the corresponding enum.
Class _pdsdata.xtc.ProcInfo
Python wrapper for pdsdata/xtc/ProcInfo class. Unlike C++ this class does not inherit from Src class (Src class does not exist in this module) but uses dynamic Python features to implement the same interface as in Src class. In addition to methods described here the class also defines __hash__
and __cmp__
methods based on the content of the object and can be used as a key in the dictionaries.
Construction
Usage: proc = xtc.ProcInfo(level, processId, ipAddr)
Arguments:
- level – instance of
xtc.Level
type - processId – integer number
- ipAddr – IP address of the host as integer number
Method level()
Usage: lvl = proc.level()
Returns enum value of type xtc.Level
which defines source level.
Method log()
Usage: log = proc.log()
Returns logical address of data source as integer number.
Method phy()
Usage: phy = proc.phy()
Returns physical address of data source as integer number.
Method processId()
Usage: processId = proc.processId()
Returns process ID as integer number.
Method ipAddr()
Usage: ipAddr = proc.ipAddr()
Returns host IP address as an integer number.
Class _pdsdata.xtc.Sequence
Python wrapper for pdsdata/xtc/Sequence class.
Enum Type
This enum is an embedded type of Sequence
class. Following enum members are defined currently:
Sequence.Type.Event
Sequence.Type.Occurrence
Sequence.Type.Marker
Construction
This class cannot be instantiated directly, it is instantiated by some other classes, e.g. by Dgram.seq property.
Method type()
Usage: type = seq.type()
Returns the type of this sequence, one of Sequence.Type
values.
Method service()
Usage: svc = seq.service()
Returns the transition type as object of xtc.TransitionId
type.
Method isExtended()
Usage: val = seq.isExtended()
Returns True for extended sequence.
Method isEvent()
Usage: val = seq.isEvent()
Returns True for event sequence.
Method clock()
Usage: clock = seq.clock()
Returns clock value for sequence as an object of xtc.ClockTime
type.
Method stamp()
Usage: stamp = seq.stamp()
Returns timestamp value for sequence as an object of xtc.TimeStamp
type.
Class _pdsdata.xtc.TimeStamp
Python wrapper for pdsdata/xtc/TimeStamp class. In addition to methods described here the class also defines __hash__
and __cmp__
methods based on the content of the object and can be used as a key in the dictionaries.
Construction
Usage: ts = xtc.TimeStamp(ticks, fiducials, vector, [control])
Creates new instance of this type. All arguments are of integer type and have the same meaning as in corresponding C++ constructor.
Method ticks()
Usage: ticks = ts.ticks()
Returns the ticks value as integer number.
Method fiducials()
Usage: fiducials = ts.fiducials()
Returns the fiducials value as integer number.
Method control()
Usage: control = ts.control()
Returns the control value as integer number.
Method vector()
Usage: vector = ts.vector()
Returns the vector value as integer number.
Class _pdsdata.xtc.TransitionId
Python wrapper for pdsdata/xtc/TransitionId class. C++ class does not define any data members or methods, it only defines single enum type. C++ cannot be instantiated in any meaningful way. Python class in addition to defining corresponding enum constants can also be instantiated, the instances are regular integer numbers with additional printing enhancements.
Enum Value
Unlike other enum types which create separate new type inside original Python type, the enums in TransitionId class are defined directly in the class. Known enums:
TransitionId.
TransitionId.Unknown
TransitionId.Reset
TransitionId.Map
TransitionId.Unmap
TransitionId.Configure
TransitionId.Unconfigure
TransitionId.BeginRun
TransitionId.EndRun
TransitionId.BeginCalibCycle
TransitionId.EndCalibCycle
TransitionId.Enable
TransitionId.Disable
TransitionId.L1Accept
TransitionId.NumberOf
Construction
Usage: transId = xtc.TransitionId(number)
Arguments:
- number – any of the above enums can be used
Method __str__
Usage: s = str(transId)
Returns a name of the corresponding enum.
Method __repr__
Usage: s = repr(transId)
Returns a string in the form "<TransitionId(num):name>" where num and name are the value and the name of the corresponding enum.
Class _pdsdata.xtc.TypeId
Python wrapper for pdsdata/xtc/TypeId class. In addition to methods described here the class also defines __hash__
and __cmp__
methods based on the content of the object and can be used as a key in the dictionaries.
Enum Type
This enum is an embedded type of TypeId
class. Following enum members are defined currently:
TypeId.Type.Any
TypeId.Type.Id_Xtc
TypeId.Type.Id_Frame
TypeId.Type.Id_AcqWaveform
TypeId.Type.Id_AcqConfig
TypeId.Type.Id_TwoDGaussian
TypeId.Type.Id_Opal1kConfig
TypeId.Type.Id_FrameFexConfig
TypeId.Type.Id_EvrConfig
TypeId.Type.Id_TM6740Config
TypeId.Type.Id_ControlConfig
TypeId.Type.Id_pnCCDframe
TypeId.Type.Id_pnCCDconfig
TypeId.Type.Id_Epics
TypeId.Type.Id_FEEGasDetEnergy
TypeId.Type.Id_EBeam
TypeId.Type.Id_PhaseCavity
TypeId.Type.NumberOf
Construction
Usage: typeId = xtc.TypeId([type, [version]])
Arguments:
- type – one of the ebove enum values, if missing then
Any
assumed - version – version number, if missing then assumed to be 0
Method value()
Usage: val = typeId.value()
Returns the whole type ID number including version as integer number.
Method id()
Usage: id = typeId.id()
Returns the type ID number without version as enum object of TypeId.Type
type.
Method version()
Usage: vers = typeId.version()
Returns the type ID version number as integer number.
Class _pdsdata.xtc.Xtc
Python wrapper for pdsdata/xtc/Xtc class. In addition to methods described below this class implements Python iterator interface. Instance can be used as iterator only when its contains
type is TypeId.Type.Id_Xtc
.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property damage
Usage: dmg = xtcObj.damage
Returns damage bitmask as an object of xtc.Damage
type.
Property src
Usage: src = xtcObj.src
Returns data source object. Depending on the source level the type of the returned object will be one of xtc.BldInfo
, xtc.DetInfo
, or xtc.ProcInfo
.
Property contains
Usage: typeId = xtcObj.contains
Returns the type of the object contained in XTC as object od xtc.TypeId
type.
Property extent
Usage: size = xtcObj.extent
Returns the extent (total size) of the XTC.
Method sizeofPayload()
Usage: size = xtcObj.sizeofPayload()
Returns the size of payload object.
Method payload()
Usage: obj = xtcObj.payload()
Returns data object. If contains
is TypeId.Type.Any
it returns None. If contains
is TypeId.Type.Id_Xtc
it returns xtc.XtcIterator
object. For other values it returns one of the specific types such as acqiris.ConfigV1
.
Class _pdsdata.xtc.XtcFileIterator
Unlike its C++ counterpart class pdsdata/xtc/XtcFileIterator this Python class implements true Python iterator interface. Like the C++ class it also returns objects of type xtc.Dgram
. It does not have any special methods besides what is need for iterator. Typical use of this class is like this:
# iterate over all datagrams in a file for dg in xtc.XtcFileIterator(file): # do something with datagram xtcObj = dg.xtc
Construction
Usage: iter = XtcFileIterator(file)
Arguments:
- file – regular Python file object, for example created with
open()
function
Class _pdsdata.xtc.XtcIterator
This class is not like its C++ counterpart pdsdata/xtc/XtcIterator. It implements true Python iterator interface, the return type for the iterator is xtc.Xtc
. Typical use of this class is like this:
if xtcObj.contains == xtc.TypeId.Type.Id_Xtc: for subXtc in xtc.XtcIterator(xtcObj): .................. # which is identical to this if xtcObj.contains == xtc.TypeId.Type.Id_Xtc: for subXtc in xtcObj.payload(): .................. # and also identical to this if xtcObj.contains == xtc.TypeId.Type.Id_Xtc: for subXtc in xtcObj: ..................
Construction
Usage: iter = xtc.XtcIterator(xtcObj)
Arguments:
- xtcObj – XTC object whose
contains
type isId_Xtc
, otherwise an exception will be thrown.
Module _pdsdata.acqiris
This module contains classes corresponding to those in C++ pdsdata/acqiris package.
Class _pdsdata.acqiris.ConfigV1
Python wrapper for pdsdata/acqiris/ConfigV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method nbrConvertersPerChannel()
Usage: num = cfg.nbrConvertersPerChannel()
Returns integer number.
Method channelMask()
Usage: mask = cfg.channelMask()
Returns integer number.
Method nbrChannels()
Usage: num = cfg.nbrChannels()
Returns integer number.
Method nbrBanks()
Usage: num = cfg.nbrBanks()
Returns integer number.
Method horiz()
Usage: hconfig = cfg.horiz()
Returns object of acqiris.HorizV1
type.
Method trig()
Usage: trig = cfg.trig()
Returns object of acqiris.TrigV1
type.
Method vert()
Usage: vconfig = cfg.vert(channel)
Returns object of acqiris.VertV1
type.
Arguments:
- channel – channel number
Class _pdsdata.acqiris.DataDescV1
Python wrapper for pdsdata/acqiris/DataDescV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method nbrSamplesInSeg()
Usage: nsampl = dd.nbrSamplesInSeg()
Returns integer number.
Method nbrSegments()
Usage: nseg = dd.nbrSegments()
Returns integer number.
Method indexFirstPoint()
Usage: idx = dd.indexFirstPoint()
Returns integer number.
Method timestamp()
Usage: ts = dd.timestamp(segment)
Returns object of acqiris.TimestampV1
type.
Arguments:
- segment - segment number
Method waveform()
Usage: wf = dd.waveform(hconfig)
Returns waveform array of numpy.ndarray
type.
Arguments:
- hconfig - object of
acqiris.HorizV1
type
Method nextChannel()
Usage: nextdd = dd.nextChannel(hconfig)
Returns data object of acqiris.DataDescV1
type for next channel or None after the last channel.
Arguments:
- hconfig - object of
acqiris.HorizV1
type
Class _pdsdata.acqiris.HorizV1
Python wrapper for pdsdata/acqiris/HorizV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method sampInterval()
Usage: interval = hconfig.sampInterval()
Returns floating number.
Method delayTime()
Usage: delay = hconfig.delayTime()
Returns floating number.
Method nbrSamples()
Usage: nsampl = hconfig.nbrSamples()
Returns integer number.
Method nbrSegments()
Usage: nseg = hconfig.nbrSegments()
Returns integer number.
Class _pdsdata.acqiris.TimestampV1
Python wrapper for pdsdata/acqiris/TimestampV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method pos()
Usage: pos= ts.pos()
Returns floating number.
Method value()
Usage: value = ts.value()
Returns integer number.
Class _pdsdata.acqiris.TrigV1
Python wrapper for pdsdata/acqiris/TrigV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Enum Coupling
This enum is an embedded type of TrigV1
class. Following enum members are defined currently:
TrigV1.Coupling.DC
TrigV1.Coupling.AC
TrigV1.Coupling.HFreject
TrigV1.Coupling.DC50ohm
TrigV1.Coupling.AC50ohm
Enum Slope
This enum is an embedded type of TrigV1
class. Following enum members are defined currently:
TrigV1.Slope.Positive
TrigV1.Slope.Negative
TrigV1.Slope.OutOfWindow
TrigV1.Slope.IntoWindow
TrigV1.Slope.HFDivide
TrigV1.Slope.SpikeStretcher
Enum Source
This enum is an embedded type of TrigV1
class. Following enum members are defined currently:
TrigV1.Source.Internal
TrigV1.Source.External
Method coupling()
Usage: coupling = trig.coupling()
Returns enum of TrigV1.Coupling
type.
Method input()
Usage: input = trig.input()
Returns enum of TrigV1.Source
type.
Method slope()
Usage: slope = trig.slope()
Returns enum of TrigV1.Slope
type.
Method level()
Usage: level = trig.level()
Returns floating number.
Module _pdsdata.bld
This module contains classes corresponding to those in C++ pdsdata/bld package.
Class _pdsdata.bld.BldDataEBeam
Python wrapper for pdsdata/bld/BldDataEBeam class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property uDamageMask
Usage: mask = ebeam.uDamageMask
Returns integer number.
Property fEbeamCharge
Usage: val = ebeam.fEbeamCharge
Returns floating number.
Property fEbeamL3Energy
Usage: val = ebeam.fEbeamL3Energy
Returns floating number.
Property fEbeamLTUPosX
Usage: val = ebeam.fEbeamLTUPosX
Returns floating number.
Property fEbeamLTUPosY
Usage: val = ebeam.fEbeamLTUPosY
Returns floating number.
Property fEbeamLTUAngX
Usage: val = ebeam.fEbeamLTUAngX
Returns floating number.
Property fEbeamLTUAngY
Usage: val = ebeam.fEbeamLTUAngY
Returns floating number.
Property fEbeamPkCurrBC2
Usage: val = ebeam.fEbeamPkCurrBC2
Returns floating number.
Class _pdsdata.bld.BldDataEBeamV0
Python wrapper for pdsdata/bld/BldDataEBeamV0 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property uDamageMask
Usage: mask = ebeam.uDamageMask
Returns integer number.
Property fEbeamCharge
Usage: val = ebeam.fEbeamCharge
Returns floating number.
Property fEbeamL3Energy
Usage: val = ebeam.fEbeamL3Energy
Returns floating number.
Property fEbeamLTUPosX
Usage: val = ebeam.fEbeamLTUPosX
Returns floating number.
Property fEbeamLTUPosY
Usage: val = ebeam.fEbeamLTUPosY
Returns floating number.
Property fEbeamLTUAngX
Usage: val = ebeam.fEbeamLTUAngX
Returns floating number.
Property fEbeamLTUAngY
Usage: val = ebeam.fEbeamLTUAngY
Returns floating number.
Class _pdsdata.bld.BldDataFEEGasDetEnergy
Python wrapper for pdsdata/bld/BldDataFEEGasDetEnergy class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property f_11_ENRC
Usage: val = fee.f_11_ENRC
Returns floating number.
Property f_12_ENRC
Usage: val = fee.f_12_ENRC
Returns floating number.
Property f_21_ENRC
Usage: val = fee.f_21_ENRC
Returns floating number.
Property f_22_ENRC
Usage: val = fee.f_22_ENRC
Returns floating number.
Class _pdsdata.bld.BldDataPhaseCavity
Python wrapper for pdsdata/bld/BldDataPhaseCavity class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property fFitTime1
Usage: val = phase.fFitTime1
Returns floating number.
Property fFitTime2
Usage: val = phase.fFitTime2
Returns floating number.
Property fCharge1
Usage: val = phase.fCharge1
Returns floating number.
Property fCharge2
Usage: val = phase.fCharge2
Returns floating number.
Module _pdsdata.camera
This module contains classes corresponding to those in C++ pdsdata/camera package.
Class _pdsdata.camera.FrameCoord
Python wrapper for pdsdata/camera/FrameCoord class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property column
Usage: x = coord.column
Returns integer number.
Property column
Usage: y = coord.row
Returns integer number.
Property x
Usage: x = coord.x
Returns integer number, this is equivalent to column
property.
Property y
Usage: y = coord.y
Returns integer number, this is equivalent to row
property.
Class _pdsdata.camera.FrameFexConfigV1
Python wrapper for pdsdata/camera/FrameFexConfigV1 class.
Enum Forwarding
This enum is an embedded type of FrameFexConfigV1
class. Following enum members are defined currently:
FrameFexConfigV1.Forwarding.NoFrame
FrameFexConfigV1.Forwarding.FullFrame
FrameFexConfigV1.Forwarding.RegionOfInterest
Enum Processing
This enum is an embedded type of FrameFexConfigV1
class. Following enum members are defined currently:
FrameFexConfigV1.Processing.NoProcessing
FrameFexConfigV1.Forwarding.GssFullFrame
- {{FrameFexConfigV1.Forwarding.GssRegionOfInterest
FrameFexConfigV1.Forwarding.GssThreshold
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method forwarding()
Usage: val = config.forwarding()
Returns forwarding policy for frame data as enum FrameFexConfigV1.Forwarding
.
Method forward_prescale()
Usage: val = config.forward_prescale()
Returns prescale of events with forwarded frames as integer number.
Method processing()
Usage: val = config.processing()
Returns algorithm to apply to frames to produce processed output as enum FrameFexConfigV1.Processing
.
Method roiBegin()
Usage: coord = config.roiBegin()
Returns coordinates of start of rectangular region of interest (inclusive) as camera.FrameCoord
.
Method roiEnd()
Usage: coord = config.roiEnd()
Returns coordinates of finish of rectangular region of interest (exclusive) as camera.FrameCoord
.
Method threshold()
Usage: val = config.threshold()
Returns pixel data threshold value to apply in processing as integer number.
Method number_of_masked_pixels()
Usage: val = config.number_of_masked_pixels()
Returns count of masked pixels to exclude from processing as integer number.
Method masked_pixel_coordinates()
Usage: list = config.masked_pixel_coordinates()
Returns Python list of masked pixel coordinates, items in the list have type camera.FrameCoord
.
Method size()
Usage: size = config.size()
Returns size of this structure (including appended masked pixel coordinates).
Class _pdsdata.camera.FrameV1
Python wrapper for pdsdata/camera/FrameV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method width()
Usage: val = frame.width()
Returns number of pixels in a row.
Method height()
Usage: val = frame.height()
Returns number of pixels in a column.
Method depth()
Usage: val = frame.depth()
Returns number of bits per pixel.
Method depth_bytes()
Usage: val = frame.depth_bytes()
Returns number of bytes per pixel.
Method offset()
Usage: val = frame.offset()
Returns fixed offset/pedestal value of pixel data.
Method data_size()
Usage: val = frame.data_size()
Returns fixed offset/pedestal value of pixel data.
Method data()
Usage: val = frame.data([writable=False])
Returns pixel data as NumPy array, if optional argument is True then array is writable.
Arguments:
- writable - if True then returned data can be updated in-place
Method pixel()
Usage: val = frame.pixel(x, y)
Returns individual pixel datum given coordinates (x, y).
Class _pdsdata.camera.TwoDGaussianV1
Python wrapper for pdsdata/camera/TwoDGaussianV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method integral()
Usage: val = gauss.integral()
Returns integral statistics as integer number.
Method xmean()
Usage: val = gauss.xmean()
Returns mean X value as floating number.
Method ymean()
Usage: val = gauss.ymean()
Returns mean Y value as floating number.
Method major_axis_width()
Usage: val = gauss.major_axis_width()
Returns width of major axis as floating number.
Method minor_axis_width()
Usage: val = gauss.minor_axis_width()
Returns width of minor axis as floating number.
Method major_axis_tilt()
Usage: val = gauss.major_axis_tilt()
Returns tilt of major axis as floating number.
Module _pdsdata.control
This module contains classes corresponding to those in C++ pdsdata/control package.
Class _pdsdata.control.ConfigV1
Python wrapper for pdsdata/control/ConfigV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method uses_duration()
Usage: val = config.uses_duration()
Returns Boolean value.
Method uses_events()
Usage: val = config.uses_events()
Returns Boolean value.
Method duration()
Usage: clock = config.duration()
Returns value of xtc.ClockTime
type.
Method events()
Usage: val = config.events()
Returns number of events.
Method npvControls()
Usage: val = config.npvControls()
Returns number of PVControls.
Method npvMonitors()
Usage: val = config.npvMonitors()
Returns number of PVMonitors.
Method size()
Usage: val = config.size()
Returns total data size.
Method pvControl()
Usage: val = config.pvControl(index)
Returns PVControl
for a given index.
Method pvMonitor()
Usage: val = config.pvMonitor(index)
Returns PVMonitor
for a given index.
Class _pdsdata.control.PVControl
Python wrapper for pdsdata/control/PVControl class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method name()
Usage: val = control.name()
Returns name of the monitoring channel.
Method array()
Usage: val = control.array()
Returns true if the channel is an array.
Method index()
Usage: val = control.index()
Returns index in the array.
Method value()
Usage: val = control.value()
Returns value as floating number.
Class _pdsdata.control.PVMonitor
Python wrapper for pdsdata/control/PVMonitor class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method name()
Usage: val = control.name()
Returns name of the monitoring channel.
Method array()
Usage: val = control.array()
Returns true for array.
Method index()
Usage: val = control.index()
Returns index in the array.
Method loValue()
Usage: val = control.loValue()
Returns low value as floating number.
Method hiValue()
Usage: val = control.hiValue()
Returns high value as floating number.
Module _pdsdata.encoder
This module contains classes corresponding to those in C++ pdsdata/encoder package.
Class _pdsdata.encoder.ConfigV1
Python wrapper for pdsdata/encoder/ConfigV1 class.
Enum count_mode
This enum is an embedded type of ConfigV1
class. Following enum members are defined currently:
ConfigV1.count_mode.WRAP_FULL
ConfigV1.count_mode.LIMIT
ConfigV1.count_mode.HALT
ConfigV1.count_mode.WRAP_PRESET
ConfigV1.count_mode.END
Enum quad_mode
This enum is an embedded type of ConfigV1
class. Following enum members are defined currently:
ConfigV1.quad_mode.CLOCK_DIR
ConfigV1.quad_mode.X1
ConfigV1.quad_mode.X2
ConfigV1.quad_mode.X4
ConfigV1.quad_mode.END
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property _chan_num
Usage: val = config._chan_num
Returns integer value.
Property _count_mode
Usage: val = config._count_mode
Returns value of enum type ConfigV1.count_mode.
Property _quadrature_mode
Usage: val = config._quadrature_mode
Returns value of enum type ConfigV1.quad_mode.
Property _input_num
Usage: val = config._input_num
Returns integer value.
Property _input_rising
Usage: val = config._input_rising
Returns boolean value.
Property _ticks_per_sec
Usage: val = config._ticks_per_sec
Returns integer value.
Class _pdsdata.encoder.DataV1
Python wrapper for pdsdata/encoder/DataV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property _33mhz_timestamp
Usage: val = data._33mhz_timestamp
Returns integer value.
Property _encoder_count
Usage: val = data._encoder_count
Returns integer value.
Module _pdsdata.epics
This module contains classes corresponding to those in C++ pdsdata/epics package. The module reuses different bits and pieces, such as data type constants, from the underlying EPICS library. Complete EPICS documentation is available at main EPICS site.
_pdsdata.epics Constants
Module defines a number of constants which determine the type of the EPICS data. This constants are:
DBR_<TYPE>
DBR_CTRL_<TYPE>
DBR_GR_<TYPE>
DBR_STS_<TYPE>
DBR_TIME_<TYPE>
where the <TYPE>>
is one of the basic data types:
CHAR
DOUBLE
ENUM
FLOAT
LONG
SHORT
STRING
Currently the data EPICS stored in XTC files is either of DBR_CTRL_<TYPE>
or DBR_TIME_<TYPE>
. DBR_CTRL_<TYPE>
type is usually used in Configure transition, L1Accept transitions store DBR_TIME_<TYPE>
type.
Function _pdsdata.epics.dbr_type_is_CTRL()
Usage: val = epics.dbr_type_is_CTRL(data)
Returns true if the EPICS type constant of the data object is one of DBR_CTRL_<TYPE>
constants. It also means that the data object itself has epics.EpicsPvCtrl
type.
Function _pdsdata.epics.dbr_type_is_TIME()
Usage: val = epics.dbr_type_is_TIME(data)
Returns true if the EPICS type constant of the data object is one of DBR_TIME_<TYPE>
constants. It also means that the data object itself has epics.EpicsPvTime
type.
Array _pdsdata.epics.epicsAlarmConditionStrings
Usage: str = epics.epicsAlarmConditionStrings[status]
Stores string representation of the EPICS status codes.
Array _pdsdata.epics.epicsAlarmSeverityStrings
Usage: str = epics.epicsAlarmSeverityStrings[severity]
Stores string representation of the EPICS severity codes.
Class _pdsdata.epics.EpicsPvCtrl
Python wrapper for pdsdata/epics/EpicsPvCtrl<T> classes.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property iPvId
Usage: val = data.iPvId
Returns PV ID as integer number.
Property iDbrType
Usage: val = data.iDbrType
Returns one of the DBR_CTRL_<TYPE>
constants.
Property iNumElements
Usage: val = data.iNumElements
Returns size of PV array.
Property sPvName
Usage: val = data.sPvName
Returns PV name.
Property status
Usage: val = data.status
Returns status as integer number. Value can be used as an index into epics.epicsAlarmConditionStrings
list. Status 0 means success.
Property severity
Usage: val = data.severity
Returns severity as integer number. Value can be used as an index into epics.epicsAlarmSeverityStrings
list. Severity 0 means success.
Property precision
Usage: val = data.precision
Returns precision of the floating point data as number of decimal digits. For non-floating types precision is None.
Property units
Usage: val = data.units
String describing physical units, None for ENUM
and STRING
PV types.
Property upper_disp_limit
Usage: val = data.upper_disp_limit
One of the EPICS data data limits, type is determined by PV type, None returned for ENUM
and STRING
PV types.
Property lower_disp_limit
Usage: val = data.lower_disp_limit
One of the EPICS data data limits, type is determined by PV type, None returned for ENUM
and STRING
PV types.
Property upper_alarm_limit
Usage: val = data.upper_alarm_limit
One of the EPICS data data limits, type is determined by PV type, None returned for ENUM
and STRING
PV types.
Property upper_warning_limit
Usage: val = data.upper_warning_limit
One of the EPICS data data limits, type is determined by PV type, None returned for ENUM
and STRING
PV types.
Property lower_warning_limit
Usage: val = data.lower_warning_limit
One of the EPICS data data limits, type is determined by PV type, None returned for ENUM
and STRING
PV types.
Property lower_alarm_limit
Usage: val = data.lower_alarm_limit
One of the EPICS data data limits, type is determined by PV type, None returned for ENUM
and STRING
PV types.
Property upper_ctrl_limit
Usage: val = data.upper_ctrl_limit
One of the EPICS data data limits, type is determined by PV type, None returned for ENUM
and STRING
PV types.
Property lower_ctrl_limit
Usage: val = data.lower_ctrl_limit
One of the EPICS data data limits, type is determined by PV type, None returned for ENUM
and STRING
PV types.
Property no_str
Usage: val = data.no_str
Number of ENUM states, None for non-enum PV types.
Property strs
Usage: val = data.strs
List of ENUM states, None for non-enum PV types.
Property value
Usage: val = data.value
PV value, always a single value, for arrays it is first element. Type of the value is determined by PV type.
Property values
Usage: val = data.values
List of PV values of size data.iNumElements
. Type of the values is determined by PV type.
Class _pdsdata.epics.EpicsPvTime
Python wrapper for pdsdata/epics/EpicsPvTime<T> classes.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property iPvId
Usage: val = data.iPvId
Returns PV ID as integer number.
Property iDbrType
Usage: val = data.iDbrType
Returns one of the DBR_CTRL_<TYPE>
constants.
Property iNumElements
Usage: val = data.iNumElements
Returns size of PV array.
Property status
Usage: val = data.status
Returns status as integer number. Value can be used as an index into epics.epicsAlarmConditionStrings
list. Status 0 means success.
Property severity
Usage: val = data.severity
Returns severity as integer number. Value can be used as an index into epics.epicsAlarmSeverityStrings
list. Severity 0 means success.
Property stamp
Usage: val = data.stamp
EPICS timestamp value of type epics.epicsTimeStamp
.
Property value
Usage: val = data.value
PV value, always a single value, for arrays it is first element. Type of the value is determined by PV type.
Property values
Usage: val = data.values
List of PV values of size data.iNumElements
. Type of the values is determined by PV type.
Class _pdsdata.epics.epicsTimeStamp
Python wrapper for pdsdata/epics/epicsTimeStamp class. In addition to methods described here the class also defines __hash__
and __cmp__
methods based on the content of the object and can be used as a key in the dictionaries.
Construction
Usage: ts = epics.epicsTimeStamp([sec, [nsec]])
Arguments:
- sec – number of seconds since Jan 1, 1990 00:00
- nsec – nanoseconds within second
Property secPastEpoch
Usage: val = ts.secPastEpoch
Returns number of seconds since Jan 1, 1990 00:00.
Property nsec
Usage: val = ts.nsec
Returns nanoseconds within second.
Module _pdsdata.evr
This module contains classes corresponding to those in C++ pdsdata/evr package.
Class _pdsdata.evr.ConfigV1
Python wrapper for pdsdata/evr/ConfigV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method npulses()
Usage: val = config.npulses()
Returns integer number.
Method pulse()
Usage: val = config.pulse(index)
Returns object of evr.PulseConfig
type.
Method noutputs()
Usage: val = config.noutputs()
Returns integer number.
Method output_map()
Usage: val = config.output_map(index)
Returns object of evr.OutputMap
type.
Method size()
Usage: val = config.size()
Returns total size of the object.
Class _pdsdata.evr.ConfigV2
Python wrapper for pdsdata/evr/ConfigV2 class.
Enum RateCode
This enum is an embedded type of ConfigV2
class. Following enum members are defined currently:
ConfigV2.RateCode.r120Hz
ConfigV2.RateCode.r60Hz
ConfigV2.RateCode.r30Hz
ConfigV2.RateCode.r10Hz
ConfigV2.RateCode.r5Hz
ConfigV2.RateCode.r1Hz
ConfigV2.RateCode.r0_5Hz
ConfigV2.RateCode.Single
ConfigV2.RateCode.NumberOfRates
Enum BeamCode
This enum is an embedded type of ConfigV2
class. Following enum members are defined currently:
ConfigV2.BeamCode.Off
ConfigV2.BeamCode.On
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method beam()
Usage: val = config.beam()
Returns value of enum ConfigV2.BeamCode
.
Method rate()
Usage: val = config.rate()
Returns value of enum ConfigV2.RateCode
.
Method opcode()
Usage: val = config.opcode()
Returns integer number.
Method npulses()
Usage: val = config.npulses()
Returns integer number.
Method pulse()
Usage: val = config.pulse(index)
Returns object of evr.PulseConfig
type.
Method noutputs()
Usage: val = config.noutputs()
Returns integer number.
Method output_map()
Usage: val = config.output_map(index)
Returns object of evr.OutputMap
type.
Method size()
Usage: val = config.size()
Returns total size of the object.
Class _pdsdata.evr.ConfigV3
Python wrapper for pdsdata/evr/ConfigV3 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method neventcodes()
Usage: val = config.neventcodes()
Returns integer number.
Method eventcode()
Usage: val = config.eventcode(index)
Returns object of evr.EventCodeV3
type.
Method npulses()
Usage: val = config.npulses()
Returns integer number.
Method pulse()
Usage: val = config.pulse(index)
Returns object of evr.PulseConfigV3
type.
Method noutputs()
Usage: val = config.noutputs()
Returns integer number.
Method output_map()
Usage: val = config.output_map(index)
Returns object of evr.OutputMap
type.
Method size()
Usage: val = config.size()
Returns total size of the object.
Class _pdsdata.evr.DataV3
Python wrapper for pdsdata/evr/DataV3 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method numFifoEvents()
Usage: val = config.numFifoEvents()
Returns integer number.
Method fifoEvent()
Usage: val = config.fifoEvent(index)
Returns object of evr.DataV3_FIFOEvent
type.
Class _pdsdata.evr.DataV3_FIFOEvent
Python wrapper for pdsdata/evr/DataV3::FIFOEvent class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Property TimestampHigh
Usage: val = config.TimestampHigh
Returns integer number.
Property TimestampLow
Usage: val = config.TimestampLow
Returns integer number.
Property EventCode
Usage: val = config.EventCode
Returns integer number.
Class _pdsdata.evr.OutputMap
Python wrapper for pdsdata/evr/OutputMap class.
Enum Source
This enum is an embedded type of OutputMap
class. Following enum members are defined currently:
OutputMap.Source.Pulse
OutputMap.Source.DBus
OutputMap.Source.Prescaler
OutputMap.Source.Force_High
OutputMap.Source.Force_Low
Enum Conn
This enum is an embedded type of OutputMap
class. Following enum members are defined currently:
OutputMap.Conn.FrontPanel
OutputMap.Conn.UnivIO
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method source()
Usage: val = map.source()
Returns value of enum OutputMap.Source
.
Method source_id()
Usage: val = map.source_id()
Returns integer number.
Method conn()
Usage: val = map.conn()
Returns value of enum OutputMap.Conn
.
Method conn_id()
Usage: val = map.conn_id()
Returns integer number.
Method map()
Usage: val = map.map()
Returns encoded source value as integer number.
Class _pdsdata.evr.PulseConfig
Python wrapper for pdsdata/evr/PulseConfig class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method pulse()
Usage: val = config.pulse()
Returns internal pulse generation channel as integer number.
Method trigger()
Usage: val = config.trigger()
Returns integer number.
Method set()
Usage: val = config.set()
Returns integer number.
Method clear()
Usage: val = config.clear()
Returns integer number.
Method polarity()
Usage: val = config.polarity()
Returns Boolean value.
Method map_set_enable()
Usage: val = config.map_set_enable()
Returns Boolean value.
Method map_reset_enable()
Usage: val = config.map_reset_enable()
Returns Boolean value.
Method map_trigger_enable()
Usage: val = config.map_trigger_enable()
Returns Boolean value.
Method prescale()
Usage: val = config.prescale()
Returns integer number.
Method delay()
Usage: val = config.delay()
Returns integer number.
Method width()
Usage: val = config.width()
Returns integer number.
Class _pdsdata.evr.PulseConfigV3
Python wrapper for pdsdata/evr/PulseConfigV3 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method pulseId()
Usage: val = config.pulseId()
Returns integer number.
Method polarity()
Usage: val = config.polarity()
Returns Boolean value.
Method prescale()
Usage: val = config.prescale()
Returns integer number.
Method delay()
Usage: val = config.delay()
Returns integer number.
Method width()
Usage: val = config.width()
Returns integer number.
Module _pdsdata.fccd
This module contains classes corresponding to those in C++ pdsdata/fccd package.
Class _pdsdata.fccd.FccdConfigV1
Python wrapper for pdsdata/fccd/FccdConfigV1 class.
Enum Depth
This enum is an embedded type of FccdConfigV1
class. Following enum members are defined currently:
ConfigV1.Depth.Sixteen_bit
Enum Output_Source
This enum is an embedded type of FccdConfigV1
class. Following enum members are defined currently:
ConfigV1.Output_Source.Output_FIFO
ConfigV1.Output_Source.Output_Pattern4
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method width()
Usage: val = config.width()
Returns integer number.
Method height()
Usage: val = config.height()
Returns integer number.
Method trimmedWidth()
Usage: val = config.trimmedWidth()
Returns integer number.
Method trimmedHeight()
Usage: val = config.trimmedHeight()
Returns integer number.
Method outputMode()
Usage: val = config.outputMode()
Returns integer number.
Method size()
Usage: val = config.size()
Returns integer number.
Module _pdsdata.ipimb
This module contains classes corresponding to those in C++ pdsdata/ipimb package.
Class _pdsdata.ipimb.ConfigV1
Python wrapper for pdsdata/ipimb/ConfigV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method triggerCounter()
Usage: val = config.triggerCounter()
Returns integer number.
Method serialID()
Usage: val = config.serialID()
Returns integer number.
Method chargeAmpRange()
Usage: val = config.chargeAmpRange()
Returns integer number.
Method calibrationRange()
Usage: val = config.calibrationRange()
Returns integer number.
Method resetLength()
Usage: val = config.resetLength()
Returns integer number.
Method resetDelay()
Usage: val = config.resetDelay()
Returns integer number.
Method chargeAmpRefVoltage()
Usage: val = config.chargeAmpRefVoltage()
Returns floating number.
Method calibrationVoltage()
Usage: val = config.calibrationVoltage()
Returns floating number.
Method diodeBias()
Usage: val = config.diodeBias()
Returns floating number.
Method status()
Usage: val = config.status()
Returns integer number.
Method errors()
Usage: val = config.errors()
Returns integer number.
Method calStrobeLength()
Usage: val = config.calStrobeLength()
Returns integer number.
Method trigDelay()
Usage: val = config.trigDelay()
Returns integer number.
Class _pdsdata.ipimb.DataV1
Python wrapper for pdsdata/ipimb/DataV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method triggerCounter()
Usage: val = config.triggerCounter()
Returns integer number.
Method config0()
Usage: val = config.config0()
Returns integer number.
Method config1()
Usage: val = config.config1()
Returns integer number.
Method config2()
Usage: val = config.config2()
Returns integer number.
Method channel0()
Usage: val = config.channel0()
Returns integer number.
Method channel1()
Usage: val = config.channel1()
Returns integer number.
Method channel2()
Usage: val = config.channel2()
Returns integer number.
Method channel3()
Usage: val = config.channel3()
Returns integer number.
Method checksum()
Usage: val = config.checksum()
Returns integer number.
Module _pdsdata.opal1k
This module contains classes corresponding to those in C++ pdsdata/opal1k package.
Class _pdsdata.opal1k.ConfigV1
Python wrapper for pdsdata/opal1k/ConfigV1 class.
Constants
LUT_Size
Row_Pixels
Column_Pixels
Enum Depth
This enum is an embedded type of ConfigV1
class. Following enum members are defined currently:
ConfigV1.Depth.Eight_bit
ConfigV1.Depth.Ten_bit
ConfigV1.Depth.Twelve_bit
Enum Binning
This enum is an embedded type of ConfigV1
class. Following enum members are defined currently:
ConfigV1.Binning.x1
ConfigV1.Binning.x2
ConfigV1.Binning.x4
ConfigV1.Binning.x8
Enum Mirroring
This enum is an embedded type of ConfigV1
class. Following enum members are defined currently:
ConfigV1.Mirroring.None
ConfigV1.Mirroring.HFlip
ConfigV1.Mirroring.VFlip
ConfigV1.Mirroring.HVFlip
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method black_level()
Usage: val = config.black_level()
Returns offset/pedestal setting for camera (before gain) as integer number.
Method gain_percent()
Usage: val = config.gain_percent()
Returns camera gain setting in percentile ([100-3200] = [1x-32x]) as integer number.
Method output_offset()
Usage: val = config.output_offset()
Returns offset/pedestal value in pixel counts as integer number.
Method output_resolution()
Usage: val = config.output_resolution()
Returns bit-depth of pixel counts as enum ConfigV1.Depth
.
Method output_resolution_bits()
Usage: val = config.output_resolution_bits()
Returns bit-depth of pixel counts (in actual bits).
Method vertical_binning()
Usage: val = config.vertical_binning()
Returns vertical re-binning of output (consecutive rows summed) as enum ConfigV1.Binning
.
Method output_mirroring()
Usage: val = config.output_mirroring()
Returns geometric transformation of the image as enum ConfigV1.Mirroring
.
Method vertical_remapping()
Usage: val = config.vertical_remapping()
Returns Boolean, true: remap the pixels to appear in natural geometric order (left->right, top->bottom), false: pixels appear on dual taps from different rows (left->right, top->bottom) alternated with (left->right, bottom->top) pixel by pixel.
Method defect_pixel_correction_enabled()
Usage: val = config.defect_pixel_correction_enabled()
Returns Boolean value.
Method output_lookup_table_enabled()
Usage: val = config.output_lookup_table_enabled()
Returns Boolean value.
Method output_lookup_table()
Usage: val = config.output_lookup_table()
Returns output lookup table as NumPy array, elements of array are unsigned numbers.
Method number_of_defect_pixels()
Usage: val = config.number_of_defect_pixels()
Returns defective pixel count.
Method defect_pixel_coordinates()
Usage: val = config.defect_pixel_coordinates()
Returns list of defective pixel coordinates, elements of the list have type camera.FrameCoord
.
Method size()
Usage: val = config.size()
Returns total size of this structure.
Module _pdsdata.pnccd
This module contains classes corresponding to those in C++ pdsdata/pnCCD package.
Class _pdsdata.pnccd.ConfigV1
Python wrapper for pdsdata/pnCCD/ConfigV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method numLinks()
Usage: val = config.numLinks()
Returns number of links.
Method payloadSizePerLink()
Usage: val = config.payloadSizePerLink()
Returns data size per link.
Class _pdsdata.pnccd.ConfigV2
Python wrapper for pdsdata/pnCCD/ConfigV2 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method numLinks()
Usage: val = config.numLinks()
Returns number of links.
Method payloadSizePerLink()
Usage: val = config.payloadSizePerLink()
Returns data size per link.
Method numChannels()
Usage: val = config.numChannels()
Returns number of channels.
Method numRows()
Usage: val = config.numRows()
Returns number of rows.
Method numSubmoduleChannels()
Usage: val = config.numSubmoduleChannels()
Returns integer number.
Method numSubmoduleRows()
Usage: val = config.numSubmoduleRows()
Returns integer number.
Method numSubmodules()
Usage: val = config.numSubmodules()
Returns integer number.
Method camexMagic()
Usage: val = config.camexMagic()
Returns integer number.
Method info()
Usage: val = config.info()
Returns string.
Method timingFName()
Usage: val = config.timingFName()
Returns string.
Method size()
Usage: val = config.size()
Returns size of the object.
Class _pdsdata.pnccd.FrameV1
Python wrapper for pdsdata/pnCCD/FrameV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method specialWord()
Usage: val = frame.specialWord()
Returns integer number.
Method frameNumber()
Usage: val = frame.frameNumber()
Returns integer number.
Method timeStampHi()
Usage: val = frame.timeStampHi()
Returns integer number.
Method timeStampLo()
Usage: val = frame.timeStampLo()
Returns integer number.
Method next()
Usage: val = frame.next(config)
Returns next frame object or None.
Arguments:
- config - object of type
pnccd.ConfigV1
orpnccd.ConfigV2
.
Method data()
Usage: val = frame.data(config)
Returns frame data as NumPy 2-dimensional array of integers of size 512x512.
Arguments:
- config - object of type
pnccd.ConfigV1
orpnccd.ConfigV2
.
Method sizeofData()
Usage: val = frame.sizeofData(config)
Returns integer number.
Arguments:
- config - object of type
pnccd.ConfigV1
orpnccd.ConfigV2
.
Module _pdsdata.princeton
This module contains classes corresponding to those in C++ pdsdata/princeton package.
Class _pdsdata.princeton.ConfigV1
Python wrapper for pdsdata/princeton/ConfigV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method width()
Usage: val = config.width()
Returns integer number.
Method height()
Usage: val = config.height()
Returns integer number.
Method orgX()
Usage: val = config.orgX()
Returns integer number.
Method orgY()
Usage: val = config.orgY()
Returns integer number.
Method binX()
Usage: val = config.binX()
Returns integer number.
Method binY()
Usage: val = config.binY()
Returns integer number.
Method exposureTime()
Usage: val = config.exposureTime()
Returns floating number.
Method coolingTemp()
Usage: val = config.coolingTemp()
Returns floating number.
Method readoutSpeedIndex()
Usage: val = config.readoutSpeedIndex()
Returns integer number.
Method readoutEventCode()
Usage: val = config.readoutEventCode()
Returns integer number.
Method delayMode()
Usage: val = config.delayMode()
Returns integer number.
Method size()
Usage: val = config.size()
Returns integer number.
Method frameSize()
Usage: val = config.frameSize()
Returns calculated frame size based on the current ROI and binning settings.
Class _pdsdata.princeton.FrameV1
Python wrapper for pdsdata/princeton/FrameV1 class.
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method shotIdStart()
Usage: val = config.shotIdStart()
Returns integer number.
Method readoutTime()
Usage: val = config.readoutTime()
Returns floating number.
Method data()
Usage: val = config.data(config)
Returns frame data as NumPy 2-dimensional array of integers, size is determined by the configuration object.
Arguments:
- config - object of type
princeton.ConfigV1
.
Module _pdsdata.pulnix
This module contains classes corresponding to those in C++ pdsdata/pulnix package.
Class _pdsdata.pulnix.TM6740ConfigV1
Python wrapper for pdsdata/pulnix/TM6740ConfigV1 class.
Constants
Row_Pixels
Column_Pixels
Enum Depth
This enum is an embedded type of TM6740ConfigV1
class. Following enum members are defined currently:
TM6740ConfigV1.Depth.Eight_bit
TM6740ConfigV1.Depth.Ten_bit
Enum Binning
This enum is an embedded type of TM6740ConfigV1
class. Following enum members are defined currently:
TM6740ConfigV1.Binning.x1
TM6740ConfigV1.Binning.x2
TM6740ConfigV1.Binning.x4
Enum LookupTable
This enum is an embedded type of TM6740ConfigV1
class. Following enum members are defined currently:
TM6740ConfigV1.LookupTable.Gamma
TM6740ConfigV1.LookupTable.Linear
Construction
This class cannot be instantiated directly, methods of other classes return instances of this type.
Method vref()
Usage: val = config.vref()
Returns integer number.
Method gain_a()
Usage: val = config.gain_a()
Returns integer number.
Method gain_b()
Usage: val = config.gain_b()
Returns integer number.
Method gain_balance()
Usage: val = config.gain_balance()
Returns Boolean value.
Method shutter_width()
Usage: val = config.shutter_width()
Returns integer number.
Method output_resolution()
Usage: val = config.output_resolution()
Returns bit-depth of pixel counts as enum TM6740ConfigV1.Depth
.
Method output_resolution_bits()
Usage: val = config.output_resolution_bits()
Returns bit-depth of pixel counts (in actual bits).
Method horizontal_binning()
Usage: val = config.horizontal_binning()
Returns horizontal re-binning of output (consecutive columns summed) as enum TM6740ConfigV1.Binning
.
Method vertical_binning()
Usage: val = config.vertical_binning()
Returns vertical re-binning of output (consecutive rows summed) as enum TM6740ConfigV1.Binning
.
Method lookuptable_mode()
Usage: val = config.lookuptable_mode()
Returns output lookup table corrections as enum TM6740ConfigV1.LookupTable
.
Package pypdsdata
This package is a user-level interface to lower-level _pdsdata
package. It repeats the module structure of _pdsdata
and defines the same classes but shields user from unnecessary details present in _pdsdata
. In many cases pypdsdata
imports the class from _pdsdata
without any changes. Documentation below only describes cases when pypdsdata
changes or extends the corresponding _pdsdata
types, for unchanged types consult corresponding _pdsdata
documentation.
Module pypdsdata.acqiris
Class pypdsdata.acqiris.DataDescV1
This class overrides several methods in the corresponding _pdsdata.acqiris.DataDescV1
class to simplify user API.
Construction
Usage: dd = DataDescV1(orig, hcfg, vcfg)
Arguments:
- orig – original
_pdsdata.acqiris.DataDescV1
object - hcfg – configuration object of
acqiris.HorizV1
type - vcfg – configuration object of
acqiris.VertV1
type
Method nbrSamplesInSeg()
Usage: nsampl = dd.nbrSamplesInSeg()
Returns integer number.
Method nbrSegments()
Usage: nseg = dd.nbrSegments()
Returns integer number.
Method timestamp()
Usage: ts = dd.timestamp(segment)
Returns object of acqiris.TimestampV1
type.
Arguments:
- segment - segment number
Method waveform()
Usage: wf = dd.waveform()
Returns waveform array of numpy.ndarray
type.
Method timestamps()
Usage: ts = dd.timestamps()
Returns NumPy array of timestamps (floating numbers). First element of array is always 0, other elements are equidistant with the distance and number of intervals determined by acqiris.HorizV1
object.
Module pypdsdata.pnccd
Class pypdsdata.pnccd.FrameV1
This class overrides several methods in the corresponding _pdsdata.pnccd.FrameV1
class to simplify user API. In particular it merges four images from PnCCD into one larger image.
Construction
Usage: frame = FrameV1(frames, config)
Arguments:
- frames – list of four
_pdsdata.pnccd.FrameV1
object - config – configuration object of
pnccd.ConfigV1
type
Method specialWord()
Usage: val = frame.specialWord()
Returns integer number.
Method frameNumber()
Usage: val = frame.frameNumber()
Returns integer number.
Method timeStampHi()
Usage: val = frame.timeStampHi()
Returns integer number.
Method timeStampLo()
Usage: val = frame.timeStampLo()
Returns integer number.
Method data()
Usage: val = frame.data()
Returns frame data as NumPy 2-dimensional array of integers of size 1024x1024.
Method sizeofData()
Usage: val = frame.sizeofData()
Returns integer number.
Module pypdsdata.princeton
Class pypdsdata.princeton.FrameV1
This class overrides several methods in the corresponding _pdsdata.princeton.FrameV1
class to simplify user API.
Construction
Usage: frame = FrameV1(frames, config)
Arguments:
- frames – original
_pdsdata.princeton.FrameV1
object - config – configuration object of
_pdsdata.princeton.ConfigV1
type
Method shotIdStart()
Usage: val = frame.shotIdStart()
Returns integer number.
Method readoutTime()
Usage: val = frame.readoutTime()
Returns floating number.
Method data()
Usage: val = frame.data()
Returns frame data as NumPy 2-dimensional array of integers.