You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
################################################################################# classes# scanDim holds all of the data associated with a single execution of a single sscan record.classscanDim:
def__init__(self):
self.rank=0# [1..n] 1 means this is the "innermost" or only scan dimensionself.dim=0# dimensionality of data (numerically same as rank)self.npts=0# number of data points plannedself.curr_pt=0# number of data points actually acquiredself.plower_scans=0# file offsets of next lower rank scansself.name=""# name of sscan record that acquired the dataself.time=""# time at which scan (dimension) startedself.np=0# number of positionersself.p= [] # list of scanPositioner instancesself.nd=0# number of detectorsself.d= [] # list of scanDetector instancesself.nt=0# number of detector triggersself.t= [] # list of scanTrigger instancesdef__str__(self):
ifself.name!='':
s="%dD data from \"%s\" acquired on %s:\n%d/%d pts; %d positioners, %d detectors"% (
self.dim, self.name, self.time, self.curr_pt, self.npts, self.np, self.nd)
else:
s="%dD data (not read in)"% (self.dim)
returns# scanPositioner holds all the information associated with a single positioner, and# all the data written and acquired by that positioner during an entire (possibly# multidimensional) scan.classscanPositioner:
def__init__(self):
self.number=0# positioner number in sscan recordself.fieldName=""# name of sscanRecord PVself.name=""# name of EPICS PV this positioner wrote toself.desc=""# description of 'name' PVself.step_mode=""# 'LINEAR', 'TABLE', or 'FLY'self.unit=""# units of 'name' PVself.readback_name=""# name of EPICS PV this positioner read from, if anyself.readback_desc=""# description of 'readback_name' PVself.readback_unit=""# units of 'readback_name' PVself.data= [] # list of values written to 'name' PV. If rank==2, lists of lists, etc.def__str__(self):
globaluse_numpydata=self.dataifuse_numpy:
n=data.ndimifn==1:
dimString='('+str(data.shape[0]) +')'else:
dimString=str(data.shape)
else:
n=1dimString=str(len(data))
while (len(data)>0) and ((type(data[0]) ==type([])) or (type(data[0]) ==type(()))):
data=data[0]
n=n+1dimString=dimString+"x"+str(len(data))
dimString='('+dimString+')'s="positioner <scanRecord>.%s\nPV name '%s'\nPV desc. '%s'\nPV units '%s'\nstep mode: %s\nRB name '%s'\nRB desc. '%s'\nRB units '%s'\ndata: %dD array %s\n"% (self.fieldName,
self.name, self.desc, self.unit, self.step_mode, self.name, self.desc, self.unit, n, dimString)
returns# scanDetector holds all the information associated with a single detector, and# all the data acquired by that detector during an entire (possibly multidimensional) scan.classscanDetector:
def__init__(self):
self.number=0# detector number in sscan recordself.fieldName=""# name of sscanRecord PVself.name=""# name of EPICS PV this detector read fromself.desc=""# description of 'name' PVself.unit=""# units of 'name' PVself.data= [] # list of values read from 'name' PV. If rank==2, lists of lists, etc.def__str__(self):
globaluse_numpydata=self.dataifuse_numpy:
n=data.ndimifn==1:
dimString='('+str(data.shape[0]) +')'else:
dimString=str(data.shape)
else:
n=1dimString=str(len(data))
while (len(data)>0) and ((type(data[0]) ==type([])) or (type(data[0]) ==type(()))):
data=data[0]
n=n+1dimString=dimString+"x"+str(len(data))
dimString='('+dimString+')'s="detector <scanRecord>.%s\nPV name '%s'\nPV desc. '%s'\nPV units '%s'\ndata: %dD array %s\n"% (self.fieldName,
self.name, self.desc, self.unit, n, dimString)
returns# scanTrigger holds all the information associated with a single detector trigger.classscanTrigger:
def__init__(self):
self.number=0# detector-trigger number in sscan recordself.name=""# name of sscanRecord PVself.command=0.0# value written to 'name' PVdef__str__(self):
s="trigger %d (%s), command=%f\n"% (self.number,
self.name, self.command)
returns
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: