Versions Compared

Key

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

...

Main window after the file scan. Displays the number of events and calibration cycles (scan steps)

Another window, the Pyana Control Center, pops up after the file scan.

In the pyana control center, select general run options and plot options from the panel to the right, and detectors/devices from the list to the left. Once you checkmark the detectors, a new "Pyana Configuration" tab pops up over the run/plot option panel. You can always go back to the "General Settings" tab.

"General Settings" have two components: run options (number of events to run, to skip, and multiprocessing), and plot options (frequency of plotting, display mode, ipython at end job).

A note on multiprocessing: You are allowed to select how many CPUs to use, mostly to advertise this possibility when running pyana. It is not possible to interact with all subprocesses, so the XtcExplorer will only be able to make plots from one of the subprocesses.

Some more information is printed to the terminal window from which the xtcbrowser was launched

Once you checkmark the detectors you want to display information from, another tab will pop up showing pyana configuration text. "Current pyana configuration": as you select devices from the list, a tentative configuration file for running pyana is written and shown in this field.

If a ControlPV is present and checked off, only a pyana_scan module will be used. All the other devices you check will be added to the input of the scan.
If no ControlPV is used, other pyana modules will be configured as appropriate to display a variety of information from the events.
If "Epics Process Variables" are checked off, another Gui appears that lists all the epics variables. Select the ones you want to display.

Press the "Write configuration to file" button once you're done. Once a file is written, a "Run pyana" button will appear.

You can further edit the configuration file by hand. If you click on "Edit configuration", the file will open in the default editor. Note! The default editor is defined in your EDITOR environment variable. Make sure it is set to your editor of choice (e.g. setenv EDITOR emacs).

"Run pyana" lauches an input GUI that shows you the runstring. You can use the same runstring from the command line. Or hit "OK" and it'll run.

After launching pyana, another button "Quit pyana" appears... If you see you need to change parameters, you can stop pyana, edit the configuration file, and start over again.

...

Code Block
none
none
  sources      =        # string, Address of Detector-Id|Device-ID
  inputdark    =        # filename of a binary numpy (.npy) with dark image for subtraction
  threshold    =        # Threshold information, specify the keywords that apply: lower=value, upper=value, type=maximum (default) or average, roi=(xmin:xmax,ymin:ymax)'
  algorithms   =        # algorithms to be applied to the image, e.g.: 'rotate:30' to rotate 30 degrees, or shift:(300,200) to shift by (nrows,ncols). 
  quantities   =        # quantities to plot or save, e.g. 'image dark average maximum'
  plot_vrange  =        # range (format vmin:vmax) of values for plotting (pixel intensity)
  show_projections =    # bool, include projections onto x,y axes, or not.   
  outputfile   =        # base name for output file. 
  max_save     = 0      # if larger than zero, will save event images in separate files, up to maximum. 
  calib_path   = None   # path to calib directory (Currently only needed for CSPad)

...

Code Block
none
none
sources     # list of IPIMB addresses
quantities  # keywords defining what gets stored. Currently the module stores "everything", so this can be ignored. 

Image AddedImage Removed
Example of how to run this pyana module by itself, i.e. no GUI, processing 300 events and using an xtcexplorer-generated config file:

...

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

...