# Presentation: 036189

## Using SDDS for Accelerator Commissioning and Operation

- Michael Borland
- Operations Analysis Group
- Advanced Photon Source
- www.aps.anl.gov/asd/oag/oaghome.shtml

## Introduction

- High-level applications at APS are based on
- A common self-describing file protocol.
- A toolkit of commandline programs that manipulate such files.
- Tcl/Tk scripts to manage these programs and create GUIs.
- The protocol and programs are called "SDDS", for *Self-Describing Data Sets*

## Outline of Presentation

- Concept and implementation
- What is self-describing data?
- SDDS file protocol and applications
- SDDS toolkit programs
- Advantages and problems
- Who uses SDDS?
- Applications
- Demos

## Concept

- A generic data processing algorithm:*Output* = On ... O2 O1 *Input*
- Write programs that act as operators.
- Define a generic data-containing object for the operand.
- Applying sequences of programs creates arbitrarily complex transformations.
- Programs are re-used in many unrelated applications.

## Examples of the Concept

- Simple lifetime measurement:acquireData | compute(Log) | fitPolynomial | display
- Robust lifetime measurement:acquireData | compute(Log) | fitPolynomial | removeOutliers | fitPolynomial | display
- Beam history analysis:acquireData | FFT | smooth | peakfind | collect(ByBPM) | display
- Find the noisiest power supply:acquireData | compute(Stats) | collect(BySupply) | sort | display

## Implementation

- Consistently used a simple, common self-describing file protocol for data.
- Wrote generic, commandline programs using these files
- Data collection
- Data analysis
- Graphics
- Process control
- Used Tcl/Tk script language to
- Record/create sequences
- Create GUIs

## What is Self-Describing Data?

- Identified and accessed by name only
- Units, data type, and other meta-data are included.
- Advantages:
- Truly generic programs possible
- Programs can verify and adapt to file contents
- Augment file contents without breaking applications
- Self-documenting
- Integrates simulation, control system, and other data sources

## SDDS File Protocol

## Examples of Uses of SDDS Files

- Back-up and restore files (BURT)
- Archival data from machine monitoring
- Alarm history data
- Magnet conditioning instructions
- Waveforms from scopes and network analyzers
- Beam profile and images
- Feedback matrices
- Orbit correction configuration data
- Beam position monitor status database

## SDDS Toolkit Programs

- SDDS is used by a group of about 70 generic programs
- Most of these "SDDS Toolkit" programs both read and write SDDS files, so
- They can be used sequentially
- Even simple tools become useful and productive
- About 20 EPICS-specific programs use SDDS
- Programs are commandline driven and hence scriptable

## SDDS Toolkit Capabilities

- Device-independent graphics
- Equation evaluation
- Data filtering, sorting, collection, and cross-referencing
- Statistics, correlation analysis, and histograms
- Polynomial, exponential, and gaussian fitting
- Outlier analysis and removal
- Matrix operations
- FFT and digital filtering
- Derivatives and integrals
- Conversion to/from text and other formats

## SDDS/EPICS Toolkit Capabilities

- Time-series data collection and statistics collection*
- Glitch/trigger initiated data collection*
- Synchronized data collection
- Alarm data collection*
- Experiment execution**
- Snapshot save, restore, and ramp**
- Feedforward, feedback**, and optimization***Used at APS for continuous archiving.**Used at APS for routine operations.

## Advantages of SDDS

- Tools for on-the-fly experiments, data analysis, etc.
- Permits very rapid testing, implementation of ideas
- Gives "muscle" to Tcl/Tk scripts
- Simplifies the development of new applications
- New programs have an amplified and often unexpected payoff
- Analysis capabilities comparable to MATLAB or IDL, but SDDS is free
- Open source

## Problems/Complaints

- SDDS commandline tools are hard to use for newcomers and occassional users.
- SDDS files are not random-access files.  A page is read into memory, following which the application requests copies of needed data.
- Does not provide cross-platform reading of binary files.  (Solved in next release.)
- Slower execution than custom code.

## Who Uses SDDS?

- APS depends on SDDS for accelerator operation, archiving, data analysis, and simulation.
- IPNS uses SDDS for archiving, analysis, and display.
- RHIC uses SDDS files throughout the control system but doesn't use SDDS tools at present.
- BESSY II uses SDDS files and tools for data archiving, automated processing, and some applications.
- DESY is adopting SDDS files for their data archives.
- SNS has some limited experimental use of SDDS.
- Accelerator simulators (ANL, DESY, LBL, SLAC, ...)

## Selected Accelerator Physics ActivitiesPerformed with SDDS

- Magnetic measurement data analysis
- Magnet conditioning and configuration*
- Model-independent steering*
- Obit/trajectory response matrix measurement*
- Orbit correction*
- Insertion device beamline steering*
- Tune and chromaticity measurement*
- Beta-function and dispersion measurement and correction**GUI application

## Selected Accelerator Physics ActivitiesPerformed with SDDS

- Dynamic aperture measurement*
- Energy aperture measurement*
- Physical aperture search
- BPM-to-quadrupole offset measurements with beam*
- BPM intensity dependence measurement and compensation*
- Automated BPM timing scans and timing setup.*

## Selected Accelerator Physics ActivitiesPerformed with SDDS

- Transport line emittance measurement and beta-function matching*
- Bunch length measurement using rf zero-phasing*
- Automated processing of beam spot images from SASE FEL experiments*