Versions Compared

Key

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

...

Dan Damiani has been adding support for LCLS1 data in ami2.  The "-b 0" option sets the heartbeat period to 0 ms and currently (3 May 2024) is required for operation.

It  It's still a work in progress but this example demonstrates this functionality:

Code Block
# S3DF
source /sdf/group/lcls/ds/ana/sw/conda1/rel/ami_current/setup_env_lcls1.sh
# old psana system
source /cds/group/pcds/dist/pds/ami2-devel/setup_env_lcls1.sh

ami-local psana://exp=mecly4720,run=30,repeat=true -b 0

XPP Example


Code Block
 ami-local hdf5:///reg/g/psdm/tutorials/ami2/xpp/xpp.json

...

Often an analysis wants to treat events differently based upon something in the data.  A common example is the presence of an eventcode, which may indicate the firing of a pump laser or some other condition.   If the  The selection logic is can be put into a PythonEditor box, then the editor box should return python's None object to indicate the event flow is to be terminated here; returning a value (even 0) causes the flow to continue with that value and possibly weighting your statistics in unexpected waysyields unexpected/incorrect results.  An example flowchart and with a PythonEditor box doing eventcode filtering is shown below.   Other boxes can also handle filtering with their "conditional" attributes.Image RemovedImage Removed This particular example "ping pongs" an image output between two displays depending on whether an eventcode is present or not.

This example should be run like this:

Code Block
ami-local -b 1 -f interval=1 -l /sdf/group/lcls/ds/ana/tutorials/ami2/eventcode_filter.fc psana://exp=tmoc00118,run=222,dir=/sdf/data/lcls/ds/prj/public01/xtc/


Image Added

The code inside the Python editor box that performs user-specified logic based on the eventcodes is:

Code Block
languagepy
class EventProcessor():

    def __init__(self):
        pass

    def begin_run(self):
        pass

    def end_run(self):
        pass

    def begin_step(self, step):
        pass

    def end_step(self, step):
        pass

    def on_event(self, image, codes, *args, **kwargs):
        # an eventcode that alternates for this data
        if codes[14]:
            return (image, None)
        else:
            return (None, image)

Configuring Plots

Many features of plots can be controlled from the "wrench" icon in the upper-left of AMI plots.  This menu allows you to do things like:

...