AreaDetector: A module for EPICS area detector support Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.

Slides:



Advertisements
Similar presentations
EPICS V4/areaDetector Integration
Advertisements

AreaDetector: What’s New? Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.
AreaDetector for ADCs How to deal with 1D data Tom Cobb.
ICS Test Environment Alexander Söderqvist Dec 9, 2014.
areaDetector Developments
AreaDetector Data Processing Pipeline In EPICS V4 Dave Hickin Diamond Light Source EPICS Collaboration Meeting Diamond Light Source 01/05/2013.
McIDAS-V McIDAS-V The 5 th Generation of McIDAS by Tom Whittaker Space Science and Engineering Center University of Wisconsin-Madison USA with contributions.
AreaDetector: A module for EPICS area detector support New developments Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.
Virtual Dart: An Augmented Reality Game on Mobile Device Supervisor: Professor Michael R. Lyu Prepared by: Lai Chung Sum Siu Ho Tung.
EPICS at APS Beamlines Tim Mooney Advanced Photon Source Argonne National Laboratory.
Quicktime Howell Istance School of Computing De Montfort University.
Connecting AreaDetector to GDA John Hammonds Software Services Group Advanced Photon Source The submitted manuscript has been created by UChicago Argonne,
1 QED In Vivo USB Input Output Box configuration This tutorial contains a number of instructions embedded in a great deal of explanation. Procedures that.
GigE Knowledge. BODE, Company Profile Page: 2 Table of contents  GigE Benefits  Network Card and Jumbo Frames  Camera - IP address obtainment  Multi.
AreaDetector and GStreamer Similarities and Differences Tom Cobb.
Digital Video An Introduction to the Digital Signal File Formats Acquisition IEEE 1394.
Development of EPICS Embedded Image Processing System Takashi Obina, Jun-ichi Odagiri, Ryota Takai KEK, Accelerator Laboratory.
A Streaming Video Server for areaDetector Tom Cobb Presented by Nick Rees.
AreaDetector: Recent Additions and Future Plans Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.
[1] Reference: QCam API reference manual document version Charge Coupled Device (CCD)
Topics Introduction Hardware and Software How Computers Store Data
History Server & API Christopher Larrieu Jefferson Laboratory.
4,000 Spectra or 4,000,000 ROIs per Second: EPICS Support for High-Speed Digital X-ray Spectroscopy with the XIA xMap Mark Rivers GeoSoilEnviroCARS, Advanced.
Module 7: Fundamentals of Administering Windows Server 2008.
CBASS for Beamline Control Software Development: John Skinner Matt Cowan Rick Buono Chris Dropp Leon Flaks Scientific Support: Annie Heroux Howard Robinson.
Cthru Technical Brief Gary Morris Center of Higher Learning Stennis Space Center.
AreaDetector: A module for EPICS area detector support Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.
EPICS Developments at the Australian Synchrotron DSP EPICS driver for the General Standards 16AIO analog card EPICS driver for the Galil range of motor.
On-the-fly scanning: Improvements in the EPICS motor and mca modules Mark Rivers University of Chicago.
Conversion to EPICS R3.14 Mark Rivers. New capabilities Progress in converting synApps/GSECARS Outstanding issues Work to be done Outline.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
A Comparative Study of the Linux and Windows Device Driver Architectures with a focus on IEEE1394 (high speed serial bus) drivers Melekam Tsegaye
By Abhishek Singh Rajhesh Babu, Bangalore Revanna And Joel Solomon, Bula.
Materials Science and Protein Crystallography Using the MX Beamline Control Toolkit William M. Lavender
AreaDetector: A new module for EPICS area detector support Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.
1/15 G. Manduchi EPICS Collaboration Meeting, Aix-en-Provence, Spring 2010 INTEGRATION OF EPICS AND MDSplus G. Manduchi, A. Luchetta, C. Taliercio, R.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
Detectors for Light Sources Contribution to the eXtreme Data Workshop of Nicola Tartoni Diamond Light Source.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
An introduction to areaDetector Tom Cobb. What is areaDetector?  C++ framework for detectors in EPICS  Drivers produces NDArrays of data  Plugins consume.
Petra III Status Teresa Núñez Hasylab-DESY Tango Meeting DESY,
AreaDetector workshop Summary and notes…. Overview iocBuilder File Writer Changes areaDetector driver pattern shared vector Asyn client without an IOC.
High Speed Detectors at Diamond Nick Rees. A few words about HDF5 PSI and Dectris held a workshop in May 2012 which identified issues with HDF5: –HDF5.
Motor drivers for asyn motor device support Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.
Motion Detection and Processing Performance Analysis Thomas Eggers, Mark Rosenberg Department of Electrical and Systems Engineering Abstract Histograms.
B. Dalesio, N. Arnold, M. Kraimer, E. Norum, A. Johnson EPICS Collaboration Meeting December 8-10, 2004 Roadmap for IOC.
EPICS and LabVIEW Tony Vento, National Instruments
E. Matias Canadian Light Source CLS Beamline Controls.
Motion Control at the Advanced Photon Source Argonne National Laboratory Mark Rivers University of Chicago 7 GeV synchrotron x-ray light source, the largest.
Office of Science U.S. Department of Energy “Traditional” Tools for Beamline Applications Mark Rivers University of Chicago October 16, 2008.
Diamond Light Source Data Acquisition System Paul Gibbons.
January 2010 – GEO-ISC KickOff meeting Christian Gräf, AEI 10 m Prototype Team State-of-the-art digital control: Introducing LIGO CDS.
Software tools for digital LLRF system integration at CERN 04/11/2015 LLRF15, Software tools2 Andy Butterworth Tom Levens, Andrey Pashnin, Anthony Rey.
OPERATING SYSTEMS DO YOU REQUIRE AN OPERATING SYSTEM IN YOUR SYSTEM?
1 BROOKHAVEN SCIENCE ASSOCIATES EPICS Version 4 – Normative V4 Team – presented by Bob Dalesio EPICS Meeting October 7, 2011.
AreaDetector: What’s New? Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.
ORNL is managed by UT-Battelle for the US Department of Energy ADnED Handling V4 Neutron Event Data Matt Pearson SNS ORNL 18 th -22 nd May 2015.
AsynMotor: Support For Coordinated Multi-Axis Motion In EPICS Mark Rivers University of Chicago.
Topics Introduction Hardware and Software How Computers Store Data
areaDetector: Recent Developments and Future Ideas
Mark Rivers University of Chicago
EPICS MCA and Canberra Support
EPICS areaDetector Architecture
Advanced Photon Source
areaDetector: A module for EPICS area detector support
Advanced Photon Source
What’s New and What’s Next
areaDetector: What’s New? Mark Rivers, Univ. of Chicago
quadEM: New Beam Position Monitor & Electrometer Hardware and Software
GeoSoilEnviroCARS The University of Chicago
Presentation transcript:

areaDetector: A module for EPICS area detector support Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago

Motivation & goals for areaDetector module Overview of architecture Drivers for detectors & cameras Plugins for real-time processing Viewers and other clients areaDetector Talk Outline

areaDetector - Motivation 2-D detectors are essential components of synchrotron beamlines –Sample viewing cameras, x-ray diffraction and scattering detectors, x-ray imaging, optical spectroscopy, etc. EPICS is a very commonly used control system on beamlines, (APS, DLS, SLS, Shanghai, NSLS, NSLS-II, etc.) Need to control the detectors from EPICS (useful even on non-EPICS beamlines, since other control systems like SPEC etc. can talk to EPICS) Previously several packages available, each typically restricted to a small set of detectors (Flea, Pilatus, marCCD, etc.) Clear advantages to an architecture that can be used on any detector, re-using many software components Providing EPICS control allows any higher-level client to control the detector and access the data (SPEC, medm, IDL programs, Python scripts, etc)

areaDetector - Goals Drivers for many detectors popular at synchrotron beamlines –Handle detectors ranging from >500 frames/second to <1 frame/second Basic parameters for all detectors –E.g. exposure time, start acquisition, etc. –Allows generic clients to be used for many applications Easy to implement new detector –Single device-driver C++ file to write. EPICS independent. Easy to implement detector-specific features –Driver understands additional parameters beyond those in the basic set EPICS-independent at lower layers. Middle-level plug-ins to add capability like regions-of-interest calculation, file saving, etc. –Device independent, work with all drivers –Below the EPICS layer for highest performance

NDArray –N-Dimensional array. Everything is done in N-dimensions (up to 10), rather than 2. This is needed even for 2-D detectors to support color. –This is what plug-ins callbacks receive from device drivers. NDAttribute –Each NDArray has a list of associated attributes (metadata) that travel with the array through the processing pileline. Attributes can come from driver parameters or any EPICS PV; e.g. can store motor positions, temperature, ring current, etc. with each frame. NDArrayPool –Allocates NDArray objects from a freelist –Plugins access in readonly mode, increment reference count –Eliminates need to copy data when sending it to callbacks. areaDetector – Data structures

ADBase.template Standard asyn device support (device-independent) Vendor API Driver Channel Access Clients (medm, IDL, ImageJ, SPEC, etc.) EPICS areaDetector Architecture xxxDriver.template Hardware C++ Base classes (NDArray, asynPortDriver, asynNDArrayDriver, ADDriver, NDPluginDriver) Layer 5 Standard EPICS records Layer 4 EPICS device support Layer 3 Plug-ins Layer 1 Hardware API Layer 2 Device drivers Layer 6 EPICS CA clients StdArrays File ( netCDF, TIFF, JPEG, HDF) NDPluginXXX. template Channel access Record/device support asynInt32, Float64, Octet asynGenericPointer (NDArray) asynXXXArray C library calls NDPluginBase.template ROI ColorConvert

Detector drivers ADDriver –Base C++ class from which detector drivers derive. Handles details of EPICS interfaces, and other common functions. Simulation driver –Produces calculated images up to very high rates. Implements nearly all basic parameters, including color. Useful as a model for real detector drivers, and to test plugins and clients. Prosilica driver –Gigabit Ethernet cameras, mono and color –High resolution, high speed, e.g. 1360x1024 at 30 frames/second = 40MB/second. Firewire (IEEE-1396 DCAM) –Vendor-independent Firewire camera drivers for Linux and Windows Roper driver –Princeton Instruments and Photometrics cameras controlled via WinView

Detector drivers (continued) PVCAM driver –Princeton Instruments and Photometrics cameras controlled via PVCAM library Pilatus driver –Pilatus pixel-array detectors. marCCD driver –Rayonix (MAR-USA) CCD x-ray detectors ADSC driver –ADSC CCD detectors mar345 driver –marResearch mar345 online image plate Perkin-Elmer driver –Perkin-Elmer amorphous silicon detectors

Drivers new in R1-7 Bruker driver –Bruker detectors controlled via their Bruker Instrument Server (BIS) PSL driver –Photonic Sciences Limited detectors – not quite finished URL driver –Driver to display images from any URL. Works with Web cameras, Axis video servers, static images, etc. Generic GigE driver –Should work with any GigEVision compliant camera. From Tom Cobb at Diamond

ADBase.adl – Generic control screen Works with any detector Normally write custom control for each detector type to hide unimplemented features and expose driver-specific features

Pilatus and MAR-345 specific control screens

Plugins Designed to perform real-time processing of data, running in the EPICS IOC (not over EPICS Channel Access) Receive NDArray data over callbacks from drivers or other plugins Plug-ins can execute in their own threads (non-blocking) or in callback thread (blocking) –If non-blocking then NDArray data is queued Can drop images if queue is full –If executing in callback thread, no queuing, but slows device driver Allows –Enabling/disabling –Throttling rate (no more than 0.5 seconds, etc) –Changing data source for NDArray callbacks to another driver or plugin Some plugins are also sources of NDArray callbacks, as well as consumers. –Allows creating a data processing pipeline running at very high speed, each in a difference thread, and hence in multiple cores on modern CPUs.

Plugins (continued) NDPlugInStdArrays –Receives arrays (images) from device drivers, converts to standard arrays, e.g. waveform records. –This plugin is what EPICS channel access viewers normally talk to. NDPluginROI –Performs region-of-interest calculations –Select a subregion. Optionally bin, reverse in either direction, convert data type. –Divide the array by a scale factor, which is useful for avoiding overflow when binning. NDPluginColorConvert –Convert from one color model to another (Bayer, Mono, RGB1 (pixel), RGB2 (row) or RGB3 (planar) interleave) –Bayer conversion is restricted to Linux and WIN32. NDPluginMJPEG –MJPEG server that allows viewing images in a Web browser.

NDPluginStats –Calculates basic statistics on an array (min, max, sigma) –Optionally computes centroid centroid position, width and tilt. –Optionally Computes X and Y profiles, including average profiles, profiles at the centroid position, and profiles at a user-defined cursor position. –Optionally computes the image histogram and entropy NDPluginProcess –Does arithmetic processing on arrays –Background subtraction. –Flat field normalization. –Offset and scale. –Low and high clipping. –Recursive filtering in the time domain. –Conversion to a different output data type. NDPluginOverlay –Adds graphic overlays to an image. –Can be used to display ROIs, multiple cursors, user-defined boxes, etc. Plugins (continued)

ROI plugin

Statistics plugin

Overlay plugin Centroid of laser pointer calculated by statistics plugin Cursor overlay X, Y position linked to centroid

Overlay plugin – 8 overlays on 1 screen

Processing plugin

Processing plugin 30 microsec exposure time No filteringN=100 recursive average filter

Plugins: NDPluginFile Saves NDArrays to disk 3 modes: –Single array per disk file –Capture N arrays in memory, write to disk either multiple files or as a single large file (for file formats that support this.) –Stream arrays to a single large disk file File formats currently supported –TIFF –JPEG (with compression control) –netCDF (popular self-describing binary format, supported by Unidata at UCAR) –NeXus (standard file format for neutron and x-ray communities, based on HDF, which is another popular self-describing binary format, richer than netCDF). In addition to file saving plugins, many vendor libraries also support saving files (e.g. marCCD, mar345, Pilatus, etc.) and this is supported at the driver level. File saving plugin can be used instead of or in addition to vendor file saving –Can add additional metadata vendor does not support –Could write JPEGS for Web display every minute, etc.

NDPluginFile display Example: streaming 80 frames/second of 640x480 video to netCDF file, no dropped frames.

Viewers areaDetector allows generic viewers to be written that receive images as EPICS waveform records over Channel Access Current viewers include: –ImageJ plugin EPICS_AD_Display. ImageJ is a very popular image analysis program, written in Java, derived from NIH Image. –IDL EPICS_AD_Display. –IDL areaVision (Stephen Mudie from AS) –MJPEG server allows image display in any Web browser

ImageJ Viewer

Performance Example with Pilatus driver SPEC used to collect 1000 points using trajectory scanning mode with the Newport XPS motor controller. Hardware trigger of Pilatus from XPS. Relative scan of the chi axis from -2 degrees to +2 degrees with 1000 points at.02 seconds/point Coordinated motion of the phi, kappa and omega axes. Theoretical time 20.0 second, actual time 20.8 seconds Includes time to save all 1000 images to disk (366 MB), Pilatus driver to read each file, correct bad pixels and flat field, compute ROIs, and post the ROIs and 1000 images to EPICS.

Internals – class hierarchy

Look at Doxygen generated documentation for asynNDArrayDriver, ADDriver, pluginDriver, simDetector Look at source code for ADDriver, simDetector, marCDD

Architecture works well, easily extended to new detector drivers, new plugins and new clients Base classes, asynPortDriver, asynNDArrayDriver, asynPluginDriver actually are generic, nothing “areaDetector” specific about them. They can be used to implement any N-dimension detector, e.g. the XIA xMAP (16 detectors x 2048 channels x 512 points in a scan line) Can get source code and pre-built binaries (Linux, Windows, Cygwin) from our Web site: – Can also get code on SourceForge – Conclusions

Brian Tieman (APS) Roper PVCAM driver John Hammonds (APS) Perkin-Elmer driver and NeXus file saving plugin Tim Madden (APS) initial version of ImageJ viewer Stephen Mudie (Australian Synchrotron) areaViewer IDL- based viewer Ulrik Pedersen and Tom Cobb (Diamond) MJPEG plugin, Linux Firewire driver Lewis Muir (U Chicago) ADSC CCD driver NSF-EAR and DOE-Geosciences for support of GSECARS where most of this work was done Thanks for your attention!!! Acknowledgments