Versions Compared

Key

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

...

  • If a threshold is provided, shots above threshold will be displayed / stored, and shots below
    threshold will be added to sum of darks for averaging.
  • If a dark file is provided, background subtraction is done before filtering. If not, the below-threshold
    average can be used for background subtraction
  • The plot configuration depends on whether threshold and dark subtraction is used. Intensity projections
    are also added to the plot, can be turned off (in the code).
  • In Interactive mode (see pyana_plotter), you can click on the image to
    • change intensity range (color range): Left-click to set low limit, right-click to set high limit, middle-click to reset
    • change threshold value and region of interest: Click on the rectangle, enter new values when prompted in terminal window
    • switch to SlideShow mode when you are content with the display: Middle-click on the canvas and enter new display mode value.
  • You can save the average image(s) or the selected single-shot images to file (numpy binary file)

To run this module by itself with pyana:

pyana -m XtcExplorer.pyana_cspad <xtc files>

Options must be specified in a configuration file. Only the img_sources parameter is required.

...

CsPad image where the region of interest (a red rectangle in the left figure) has intensity above a given threshold. The right image shows the region of interest.

CsPad image where region of interest (red rectangle) has intensity above a given threshold. Additionally, a dark-subtracted image is shown (bottom left), where the dark average is based on below-threshold shots from the same run (shown bottom right.

This image is similar to the one above. The intensity limits have been adjusted interactively.

At the end of the job, the average of good images (left) and rejected / dark images (right) is shown.

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

pyana -n 10 -c xb_pyana_5299.cfg -m XtcExplorer.pyana_cspad -m XtcExplorer.pyana_plotter <xtc files>

pyana_image.py

This module processes generic camera frames, e.g from Pulnix TM6740 device. It allows any number of images, given as a space-separated list of addresses in the configuration file.

  • You can set ranges to define good images and dark images. If both are set, you have the option to display good images background subtracted, where background subtraction is based on the average of background images so far collected.
  • Each image can be separately rotated, shifted and scaled (zoomed in/out).
  • Nicknames can be given to the input images. Defaults are Im1, Im2... etc. These names will be used if you plot differences, or other manipulations of the original images.
  • The images are subtracted and differences displayed as well as fourier transform of differences. Examples of what may be displayed. To display other things, at this stage you have to edit pyana_image.py to change this behaviour.
    Code Block
    none
    none
     sources             # address string of Detector-Id|Device-ID
     good_range          # threshold values selecting images of interest (Format: low,high)
     dark_range          # threshold values selecting dark images (Format: low,high)
     image_rotations     # rotation angle, in degrees, to be applied to image(s)
     image_shifts        # npixel shifts, format (nx,ny), to be applied to image(s)
     image_scales        # scale factor (float) to be applied to images
     image_nicknames     # nicknames for plot titles
     image_manipulations # String containing keywords: Diff, FFT
     output_file         # filename. Valid extensions are .hdf5, .txt (ascii) or .npy (numpy binary)
     n_hdf5              # if output file is hdf5, combine n events in each output file.
    

    Image from two Pulinx cameras, no filtering or background subtraction. Projections in x and y are shown.

    Displays of three different Pulnix TM6740 images of YAG screens, after rotation/translation. Also shown, differences between images and FFT of differences.

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

pyana -n 10 -c xb_pyana_5299.cfg -m XtcExplorer.pyana_image -m XtcExplorer.pyana_plotter <xtc files>

pyana_ipimb

This module extracts and displays data from IPIMB type detectors. There are two types of information: IpimbData (raw data) and IpmFex (feature extracted data). Only the last type of data is currently implemented, but other data can also be added. Currently the display will show a plot of the intensity measured in each of the four channels, the beam spot position estimated from sums and differences of the individual intensity measurements, and the sum of the four measurements as a function of time. The plot included below has these plots for 4 different IPIMB detector sources.

Code Block
none
none
ipimb_addresses     # list of IPIMB addresses

pyana_epics

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

pyana -n 300 -c xb_pyana_5299.cfg -m XtcExplorer.pyana_ipimb -m XtcExplorer.pyana_plotter <xtc files>

pyana_epics

Code Block
none
Code Block
nonenone
pv                  # Name(s) of the EPICS PV(s) to dump
 EPICS PV(s) to dump

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

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

pyana_scan

This module is different from the others. In runs with several calibration cycles and one (or more) control PV (process variable), this module displays scalar values from other detectors as a function of scan step of the control PV. It currently takes two scalar type inputs to evaluate the scan:

...

Note! The XtcExplorer behaviour is different when you check off the ControlPV checkbox! In this case only the pyana_scan module is activated, and all other selected detectors are added as input to this module.

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

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

Anchor
IPython
IPython

Interactive plotting with IPython

...