Tags

Viewscreens

Both the viewscreens for the beam and the cameras to monitor the laser all follow the same strategy.
  1. Viewscreen is inserted via an EPICS command
  2. Camera data taking is enabled via an EPICS record
  3. Camera records images at a given rate and exposure time
  4. The IOC for the camera gets this data, and packages it into a single array and serves it to EPICS
  5. The user gets the camera data via this EPICS record
Once the viewscreen is inserted and the camera is enabled, then the user can view the data via the following methods.
  1. Raw data in the appropriate EPICS record
  2. Matlab script "beamview"
  3. ImageJ plugin "EPICS_areaDetector"
All of those methods are explained in more detail below.

Example: Getting the A1 camera enabled, and the viewscreen inserted.

In more detail, here is an example where the user wants to view the beam on the first A1 viewscreen.
  1. From the main EDM screen, choose "Beam Diagnostics" -> "In/Out Devices"
    ed36395c255f99f55159bd85b8e094d4.png
  2. On this screen you see a list of the various insertable devices-- viewscreens, slits, Faraday cups, etc.
    a0cfefb4ddd38a513bfa48f187b81718.png
  3. Click the "In" button that is next to the letters "A1". After a few seconds, the indicator should light up next to "In".
    25f9568bb2fd88df8b305f2c6693d245.png
  4. If you are using Beamview, then you are done.
    Otherwise, you need to enable to correct camera. Click "Camera Settings" at the top of the window.
    dd5a12b2e5b176b24481083f7d56678c.png
  5. On this screen you can see a list of the cameras and their status and settings. Make sure that all of the cameras are "Done", and then select "Acquire" on the A1 camera. In general, try to limit the number of cameras set to Acquire to a small number, so that the network is not overwhelmed with the traffic from the cameras' data.
    57a5d6fbbe2b342fced01119d8d66e97.png

Raw data access

  • Looking at the above screen that lists the "EPICS Name" of the camera, the raw data is stored in the EPICS record with that string followed by "ArrayData". For example:
    erpopr@erp201:~ $ caget IA1SDR01:image1:ArrayData
     ....   huge amount of data follows here   ...
  • Of course, the data can also be retrieved similarly in Matlab or python from that record

ImageJ

  • From a Windows computer (assuming ERL_ONLINE is mounted as Y:\), run the following visual basic script: Y:\opt\ImageJ\ImageJ_autoepics.vbs
  • From a linux computer logged in as erpopr, run the following script from the erpopr home directory: ./ImageJ.sh &
  • In either system, this will result in the main ImageJ window appearing
    1c54bc3533dbc9a0bba698e216127d7e.png
  • From here, select "Plugins" -> "EPICS_areaDetector" or "EPICS_areaDetector_median" -> "EPICS AD Viewer". The latter script has a 3x3 median filter built in to remove dead pixels. This will open up the camera's main control window and an annoying log window, which you can typically immediately minimize.
    6fff476b4c44012069df847d203560b6.png 97f20e949ceea776dfd0c806186471ac.png
  • Enter the "EPICS name" of the camera in the PVPrefix box. Finding the EDM screen with the EPICS name is described in the above example. When you hit enter, it should turn green. Red indicates a typo or a problem with the camera.
    2fa353ffdd7b5b5b4ba99c4741a763c1.png
  • Click "Start", and a window will appear that initially is all white. In addition, the "Frames/s" should now display a number in the main camera window.
    8ffe86137134d7223f79677a1747c68c.png
  • On the main ImageJ window, choose "Image" -> "Adjust" -> "Brightness/Contrast". The settings should auto set, but if not then click "Auto" on the popup window.
    97e423969e89f86cc9f390819976e035.png
  • Now, you should see a beam, or at least some noise on the camera.
    438000b36a4a1f8f206ad7f5851ba32f.png

Beamview

The primary method that we use to look at the beam is through the Matlab script Beamview.
  • On Windows, there is a batch script (assuming ERL_ONLINE is mounted as Y:\) : Y:\ops\matlab_scripts\beamview\beamview.bat
  • On linux as erpopr, just type "beamview" at the prompt.
4c81d3b0ef9d3f96a8cfeaa1f92e6238.png

Beamview controls
  • Camera Info
    • Name: Use this to choose the camera that you want to view. Selecting the camera does not insert the viewscreen, that needs to be done manually.
    • EPICS: The name in EPICS
    • Size: H x V pixel count
    • Scale: the scale of the screen in "units"/pixel
    • Units: used in above, most often "mm"
    • Exposure: exposure time in seconds
    • Gain: Usually set to zero
  • Data Processing
    • Median filter: a 3x3 median filter to remove bad pixels
    • Threshold: Below this percent of the maximum value, the data is set to zero
    • Frame averaging: averages the last N frames
    • Save Max Value: Each pixel stores the largest value seen since turned on
    • Plot Profiles: Opens two new 1D plots that show the horizontal and vertical sum of the data
  • Region of Interest
    • Enter values in units of millimeters to crop the data
    • Reset: return to the full view of the screen
  • Camera Enable
    • Camera On/Off : When "off", this button stops beamview from Acquiring new data, but leaves the camera itself turned on.
    • Seconds per frame: how long it took to acquire and analyze a single image
  • Background: When the beam is turned off, you can save a BG image for the camera that is subtracted from the data.
  • Intensity Range
    • Set Range: Set the colorbar scale so that the peak data value is at the max of the colorbar
    • Reset: Set the colorbar scale so that the maximum possible data value is at the max of the colorbar
  • Single Frame Analysis: Simple calculations done on the data
    • Centroid / Width / Correlation: Note: these often are meaningless without a non-zero threshold
    • Max data: how close is the camera to saturating, in percent
  • Long Term Analysis
    • Buffer Size: Number of frames to include in the analysis
    • Percent filled: Initially will increase from 0-100% as the buffer fills
    • Threshold: A separate threshold that is only used to analyze the data here, and does not affect what is shown in the image, or the single frame analysis
    • Centroid X/Y: Centroid position and standard deviation, interpreted as the jitter in the beam position
Beamview outputs

The single frame analysis and the long term analysis of the currently enabled viewscreen are output to epics records. For example, for the first S1 viewscreen, the following records are used.

IS1SCR01_x_avg : Single frame x position centroid
IS1SCR01_y_avg : Single frame y position centroid
IS1SCR01_xy_avg : Single frame average value of x*y (the correlation in x and y)
IS1SCR01_x_rms : Single frame x beam size
IS1SCR01_y_rms : Single frame y beam size
IS1SCR01_intensity_sum : Single frame sum over all pixel values
IS1SCR01_intensity_peak : Single frame maximum of all pixel values
IS1SCR01_x_avg_long : Many frame average of x position
IS1SCR01_y_avg_long : Many frame average of y position
IS1SCR01_x_jitter : Many frame std of x position
IS1SCR01_y_jitter : Many frame std of y position
Topic revision: r2 - 13 Sep 2018, AdamBartnik
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CLASSE Wiki? Send feedback