Versions Compared

Key

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

...

pyana -n 200 -c xb_pyana_5299.cfg -m XtcExplorer.pyana_scan -m XtcExplorer.pyana_plotter <xtc files>

Helper functions in utilities.py

'utilities.py' is a python module which currently contains several different classes, some related to pyana and others more general, but all developed to help process and plot data with the explorer. This module may soon be split up into several different ones.

Currently it holds the following classes and functions (just a list for now, will add more explanations):

  • To facilitate parsing and converting the options of pyana:
    Code Block
    none
    none
    
      class PyanaOptions( object )
        def __init__( self ):
        def getOptString(self, options_string) :
        def getOptStrings(self, options_string) :
        def getOptStringsDict(self, options_string) :
        def getOptIntegers(self, options_string):
        def getOptInteger(self, options_string):
        def getOptBoolean(self, options_string):
        def getOptBooleans(self, options_string):
        def getOptFloats(self, options_string):
        def getOptFloat(self, options_string):
      
  • Container class to store and plot event data
    Code Block
    none
    none
    
      class BaseData( object ):
       def __init__(self, name,type="BaseData"):
        def show( self ):
        def get_plottables_base(self):
        def get_plottables(self):
    
      class BldData( BaseData ):
        def __init__(self, name, type="BldData"):
    
      class IpimbData( BaseData ):
        def __init__( self, name, type="IpimbData" ):
    
      class EncoderData( BaseData ):
        def __init__( self, name, type="EncoderData" ):
    
      class WaveformData( BaseData ):
        def __init__( self, name, type="WaveformData" ):
        def get_plottables(self):
    
      class EpicsData( BaseData ):
        def __init__( self, name, type="EpicsData" ):
    
      class ScanData( BaseData ) :
        def __init__(self, name, type="ScanData"):
    
      class ImageData( BaseData ):
        def __init__(self, name, type="ImageData"):
        def get_plottables(self):
    
      class CsPadData( BaseData ):
        def __init__(self, name, type="CsPadData"):
      
  • Container class to keep track of thresholds. Can be passed between modules and from event to event.
    Code Block
    none
    none
    
      class Threshold( object ) :
      
  • Container classes to keep track of matplotlib frames and canvases. This can probably be done with
    matplotlib's own classes, but I couldn't find out to do it easily. For now, I use these ones:
    Code Block
    none
    none
    
      class Frame(object):
        def __init__(self, name="", title=""):
        def myticks(self, x, pos):
        def show(self):
        def update_axes(self):
        #def set_ticks_new(self, nticks, lotick, hitick, axis="X"):
        def set_ticks(self, limits = None ):
     
      class Plotter(object):
        def __init__(self):
        def add_frame(self, name="", title="",contents=None, type=None, aspect='auto'):
        def plot_all_frames(self, fignum=1, ordered=False):
        def settings(self
                     , width = 8 # width of a single plot
                     , height = 7 # height of a single plot
                     , nplots=1  # total number of plots in the figure
                     , maxcol=3  # maximum number of columns
                     ):
        def create_figure(self, fignum, nplots=1):
        def close_figure(self):
        def connect(self,plot=None):
        def onpick(self, event):
        def onclick(self, event) :
        def plot_image(self, image, fignum=1, title="", showProj = False, extent=None):
        def plot_several(self, list_of_arrays, fignum=1, title="" ):
        def draw_figurelist(self, fignum, event_display_images, title="",showProj=False,extent=None ) :
        def draw_figure( self, frameimage, title="", fignum=1,position=1, showProj = False,extent=None):
        def drawframe( self, frameimage, title="", fignum=1,position=1, showProj = False,extent=None):
      

Anchor
IPython
IPython

Interactive plotting with IPython

...