Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

Anchor
pyana
pyana

Package pyana

This package collects code which deals with various aspects of the analysis tasks.

...

Anchor
pyana.event
pyana.event

Module event

This module is a collection of classes and methods to deal with the event data and everything related to it.

...

Panel

Anchor
pyana.event.Event
pyana.event.Event

Class 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:


Method seq()

Usage: s = evt.seq()

Returns _pdsdata.xtc.Sequence object, equivalent to dg.seq


Method getTime()

Usage: t = evt.getTime()

Returns _pdsdata.xtc.ClockTime object, equivalent to dg.seq.clock()


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 enum xtc.TypeId.Type, only return objects which have that TypeId
  • version – accepts number, only return objects whose type version number is equal to number
  • level – accepts one of xtc.Level values, only returns objects originated at that level
  • detector – accepts enum xtc.DetInfo.Detector values, only returns objects produced by this detector
  • detId – accepts number, only returns objects produced by this detector ID
  • device – accepts enum xtc.DetInfo.Device values, only returns objects produced by this device
  • devId – accepts number, only returns objects produced by this device ID
  • addressxtc.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:

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 getOpal1kConfig()

Usage: opalConfig = evt.getOpal1kConfig(address)

Returns Opal1k configuration data of type opal1k.ConfigV* for specific device. If address given is not very specific then the first matching object is returned.

Parameters:

  • addressxtc.DetInfo object or an address string (see User Manual)

Same caveats apply as for getAcqConfig() method.


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:

  • addressxtc.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 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:

  • addressxtc.DetInfo object or an address string (see User Manual)
  • env – environment object containing pnCCD configuration object

Method getFeeGasDet()

Usage: array = evt.getFeeGasDet()

Wiki Markup
Returns the list of 4 numbers {{\[f_11_ENRC, f_12_ENRC, f_21_ENRC, f_22_ENRC\]}} obtained from [{{bld.BldDataFEEGasDetEnergy}}|#_pdsdata.bld.BldDataFEEGasDetEnergy] object.


Method getPhaseCavity()

Usage: obj = evt.getPhaseCavity()

Returns data object of type bld.BldDataPhaseCavity.


Method getEBeam()

Usage: obj = evt.getEBeam()

Returns data object of type bld.BldDataEBeam or bld.BldDataEBeamV0 whichever is present in the event.

...

Panel

Anchor
pyana.event.Env
pyana.event.Env

Class 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 jobName()

Usage: jobName = env.jobName()

Returns analysis job name string.


Method hmgr()

Usage: hmgr = env.hmgr()

Returns histogram manager object of type pyana.histo.HistoManager*.


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 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 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:

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.


Method getAcqConfig()

Usage: acqConfig = env.getAcqConfig(...)

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.

Keyword arguments:

  • detector – accepts enum xtc.DetInfo.Detector values, only returns objects produced by this detector
  • detId – accepts number, only returns objects produced by this detector ID
  • device – accepts enum xtc.DetInfo.Device values, only returns objects produced by this device
  • devId – accepts number, only returns objects produced by this device ID
  • addressxtc.DetInfo object or an address string (see User Manual)

Method getPnCCDConfig()

Usage: pnccdConfig = env.getPnCCDConfig(...)

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.

Accepts the same keyword arguments as the getAcqConfig() method.


Method getOpal1kConfig()

Usage: opalConfig = env.getOpal1kConfig(...)

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.

Accepts the same keyword arguments as the getAcqConfig() method.


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.

...

Panel

Anchor
pyana.event.EpicsStore
pyana.event.EpicsStore

Class 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:

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.

...

Anchor
pyana.histo
pyana.histo

Module histo

This module is a collection classes and methods to create and manage histograms from user analysis modules.

...

Panel

Anchor
pyana.histo.HistoMgrRoot
pyana.histo.HistoMgrRoot

Class 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.

...

Panel

Anchor
pyana.histo.function.HistoMgr
pyana.histo.function.HistoMgr

Function HistoMgr()

Usage: hmgr = HistoMgr(...)

Do not call it, it's for pyana internal use.

...

Anchor
_pdsdata
_pdsdata

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++:

...

Panel

Anchor
_pdsdata.Error
_pdsdata.Error

Class 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

Anchor
_pdsdata.xtc
_pdsdata.xtc

Module _pdsdata.xtc

This module contains classes corresponding to those in C++ pdsdata/xtc package.

...

Panel

Anchor
_pdsdata.xtc.Damage
_pdsdata.xtc.Damage

Class Damage

Python wrapper for pdsdata/xtc/Damage class.


Anchor
_pdsdata.xtc.Damage.Value
_pdsdata.xtc.Damage.Value

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.


Anchor
_pdsdata.xtc.Damage.Mask
_pdsdata.xtc.Damage.Mask

Enum Mask

Note
titlePython 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

Wiki Markup
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

...

Panel

Anchor
_pdsdata.xtc.DetInfo
_pdsdata.xtc.DetInfo

Panel

Class 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.


Anchor
_pdsdata.xtc.DetInfo.Detector
_pdsdata.xtc.DetInfo.Detector

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

Anchor
_pdsdata.xtc.DetInfo.Device
_pdsdata.xtc.DetInfo.Device

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.

...

Panel

Anchor
_pdsdata.xtc.XtcIterator
_pdsdata.xtc.XtcIterator

Class 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:

Code Block
none
none
    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 is Id_Xtc, otherwise an exception will be thrown.

...

Anchor
_pdsdata.acqiris
_pdsdata.acqiris

Module _pdsdata.acqiris

This module contains classes corresponding to those in C++ pdsdata/acqiris package.

...

Panel

Anchor
_pdsdata.acqiris.TrigV1
_pdsdata.acqiris.TrigV1

Class TrigV1

Python wrapper for pdsdata/acqiris/TrigV1 class.


Construction

This class cannot be instantiated directly, methods of other classes return instances of this type.


Anchor
_pdsdata.acqiris.TrigV1.Coupling
_pdsdata.acqiris.TrigV1.Coupling

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

Anchor
_pdsdata.acqiris.TrigV1.Slope
_pdsdata.acqiris.TrigV1.Slope

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

Anchor
_pdsdata.acqiris.TrigV1.Source
_pdsdata.acqiris.TrigV1.Source

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.

...

Anchor
_pdsdata.bld
_pdsdata.bld

Module _pdsdata.bld

This module contains classes corresponding to those in C++ pdsdata/bld package.

...

Panel

Anchor
_pdsdata.bld.BldDataPhaseCavity
_pdsdata.bld.BldDataPhaseCavity

Class 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.

...

Anchor
_pdsdata.camera
_pdsdata.camera

Module _pdsdata.camera

This module contains classes corresponding to those in C++ pdsdata/camera package.

...

Panel

Anchor
_pdsdata.camera.TwoDGaussianV1
_pdsdata.camera.TwoDGaussianV1

Class 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.

...

Anchor
_pdsdata.control
_pdsdata.control

Module _pdsdata.control

This module contains classes corresponding to those in C++ pdsdata/control package.

...

Panel

Anchor
_pdsdata.control.PVMonitor
_pdsdata.control.PVMonitor

Class 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.

...

Anchor
_pdsdata.epics
_pdsdata.epics

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.

...

Panel

Anchor
_pdsdata.epics.epicsTimeStamp
_pdsdata.epics.epicsTimeStamp

Class 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

Wiki Markup
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.

...

Anchor
_pdsdata.evr
_pdsdata.evr

Module _pdsdata.evr

This module contains classes corresponding to those in C++ pdsdata/evr package.

...

Panel

Anchor
_pdsdata.evr.PulseConfig
_pdsdata.evr.PulseConfig

Class 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.

...

Anchor
_pdsdata.opal1k
_pdsdata.opal1k

Module _pdsdata.opal1k

This module contains classes corresponding to those in C++ pdsdata/opal1k package.

Panel

Anchor
_pdsdata.opal1k.ConfigV1
_pdsdata.opal1k.ConfigV1

Class 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()

Wiki Markup
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.

...

Anchor
_pdsdata.pnccd
_pdsdata.pnccd

Module _pdsdata.pnccd

This module contains classes corresponding to those in C++ pdsdata/pnCCD package.

...

Panel

Anchor
_pdsdata.pnccd.FrameV1
_pdsdata.pnccd.FrameV1

Class 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:


Method data()

Usage: val = frame.data(config)

Returns frame data as NumPy 2-dimensional array of integers of size 512x512.

Arguments:


Method sizeofData()

Usage: val = frame.sizeofData(config)

Returns integer number.

Arguments:

...

Anchor
_pdsdata.pulnix
_pdsdata.pulnix

Module _pdsdata.pulnix

This module contains classes corresponding to those in C++ pdsdata/pulnix package.

Panel

Anchor
_pdsdata.pulnix.TM6740ConfigV1
_pdsdata.pulnix.TM6740ConfigV1

Class 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.

...

Anchor
acqiris
acqiris

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.

Anchor
pypdsdata.acqiris
pypdsdata.acqiris

Module pypdsdata.acqiris

Panel

Anchor
pypdsdata.acqiris.DataDescV1
pypdsdata.acqiris.DataDescV1

Class 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:


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.

--------------

Anchor
pypdsdata.pnccd
pypdsdata.pnccd

Module pypdsdata.pnccd

Panel

Anchor
pypdsdata.pnccd.FrameV1
pypdsdata.pnccd.FrameV1

Class 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:


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.