Page History
...
Class Event
Construction
Usage: evt = pyana.event.Event(dg)
Creates event object from the corresponding XTC datagram object.
...
Method getOpal1kConfig()
Usage: acqConfig opalConfig = evt.getOpal1kConfig(address)
...
Returns data object of type bld.BldDataEBeam
or bld.BldDataEBeamV0
whichever is present in the event.
...
Class Env
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 should be set to true if running in pyana subprocess
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 subprocess then the file is created somewhere in a temporary location (with unique name). At the end of the job files from all subprocessed 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().
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.
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.
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 one ofxtc.DetInfo.Detector.<Xxx>
values, only returns objects produced by this detectordetId
– accepts number, only returns objects produced by this detector IDdevice
– accepts one ofxtc.DetInfo.Device.<Xxx>
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)
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 subprocess in multi-processing setup. Not to be used by end users.