An Environment for Matlab Analysis of DAQ Data from the 9ma Experiments Ned Arnold October 2009.

Slides:



Advertisements
Similar presentations
User-Defined Functions Like short programs Can operate on their own data Can receive data from callers and return data to callers.
Advertisements

Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
1 CS 106, Winter 2009 Class 4, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,
© The McGraw-Hill Companies, 2006 Chapter 9 Software quality.
CS 104 Introduction to Computer Science and Graphics Problems
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Runtime alignment system SOFTWARE DESIGN IDEAS Wed 4 th May 2005 P Coe.
Topic 4 – Programmer- Defined Functions. CISC 105 – Topic 4 Functions So far, we have only seen programs with one function, main. These programs begin.
Adding Automated Functionality to Office Applications.
Using Ant to build J2EE Applications Kumar
Presented by Brian Griffin On behalf of Manu Goel Mohit Goel Nov 12 th, 2014 Building a dynamic GUI, configurable at runtime by backend tool.
Extending MATLAB Write your own scripts and/or functions Scripts and functions are plain text files with extension.m (m-files) To execute commands contained.
Programmer Defined Functions Matthew Verleger. Windows It’s estimated that Window’s XP contains 45 million lines of code (and it’s over 10 years old).
CLEO’s User Centric Data Access System Christopher D. Jones Cornell University.
1 Programming and Problem Solving — Software Engineering (Read Chap. 2)
Circuits II EE221 Unit 3 Instructor: Kevin D. Donohue Instantaneous, Average, RMS, and Apparent Power, and, Maximum Power Transfer, and Power Factors.
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
1 -Defined Functions 1. Goals of this Chapter 2. General Concept 3. Advantages 4. How it works Programmer.
Nachos Phase 1 Code -Hints and Comments
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
REVIEW 2 Exam History of Computers 1. CPU stands for _______________________. a. Counter productive units b. Central processing unit c. Copper.
Grob Systems, Inc., the customer, requires an industrial computer system that will have a function of acquiring raw data, processing the data, presenting.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
Information systems and management in business Chapter 6 Using Information Systems in Management Decision Making.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Python From the book “Think Python”
SE: CHAPTER 7 Writing The Program
Ned Arnold 13 July, 2009 Convenience Tools … July 13, 2009.
Black Box Testing Techniques Chapter 7. Black Box Testing Techniques Prepared by: Kris C. Calpotura, CoE, MSME, MIT  Introduction Introduction  Equivalence.
Wir schaffen Wissen – heute für morgen Paul Scherrer Institut EPICS V4 Archiver Service and Matlab client Timo Korhonen.
Advanced Topics- Functions Introduction to MATLAB 7 Engineering 161.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
Asking the USER for values to use in a software 1 Input.
ALICE Condition DataBase Magali Gruwé CERN PH/AIP Alice Offline week May 31 st 2005.
Recap Saving Plots Summary of Chapter 5 Introduction of Chapter 6.
Introduction of Geoprocessing Lecture 9. Geoprocessing  Geoprocessing is any GIS operation used to manipulate data. A typical geoprocessing operation.
Pipeline Basics Jared Crossley NRAO NRAO. What is a data pipeline?  One or more programs that perform a task with reduced user interaction.  May be.
Implementing and Using the SIRWEB Interface Setup of the CGI script and web procfile Connecting to your database using HTML Retrieving data using the CGI.
A brief introduction to javadoc and doxygen. What’s in a program file? 1. Comments 2. Code.
NSF Review, 18 Nov 2003 Peter Shawhan (LIGO/Caltech)1 How to Develop a LIGO Search Peter Shawhan (LIGO / Caltech) NSF Review November 18, 2003 LIGO-G E.
PHP Error Handling Section :I Source: 1.
The Online World ONLINE DOCUMENTS. Online documents Online documents (such as text documents, spreadsheets, presentations, graphics and forms) are any.
1 ENGI 2420 Structured Programming (Lab Tutorial 7) Memorial University of Newfoundland.
EE694v - Verification - Lect Lect 12,13,14 – 762 Testbenches Lets look at the EE 762 testbenches Look at stimulus generation techniques Look at response.
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
October Test Beam DAQ. Framework sketch Only DAQs subprograms works during spills Each subprogram produces an output each spill Each dependant subprogram.
Summary of User Requirements for Calibration and Alignment Database Magali Gruwé CERN PH/AIP ALICE Offline Week Alignment and Calibration Workshop February.
Level 1-2 Trigger Data Base development Current status and overview Myron Campbell, Alexei Varganov, Stephen Miller University of Michigan August 17, 2000.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
[A Refresher On …] Tools for Matlab Analysis of DAQ Data [ from the 9ma Experiments] Ned Arnold October 2009.
PROTEIN IDENTIFIER IAN ROBERTS JOSEPH INFANTI NICOLE FERRARO.
Time Calibration System for RF Cavity Breakdown Measurements Juan Takase Northwestern University SIST INTERN Fermi National Lab 08/04/2015.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
AliRoot survey: Calibration P.Hristov 11/06/2013.
Matlab Training Session 4: Control, Flow and Functions
Automated Docketing With the ADI Wizard for Bankruptcy Courts
Automation and Feedbacks
OPSE 301: Lab13 Data Analysis – Fitting Data to Arbitrary Functions
Introduction to javadoc
Chapter 2: System Structures
Use of Mathematics using Technology (Maltlab)
CS005 Introduction to Programming
Coding Concepts (Basics)
Background: Currently CCP4i puts each structure determination into a separate project directory, and automatically keeps a “Project History Database” recording.
CMSC 345 Programming.
Scripts In Matlab.
Lecture Topics: 11/20 HW 7 What happens on a memory reference Traps
Presentation transcript:

An Environment for Matlab Analysis of DAQ Data from the 9ma Experiments Ned Arnold October 2009

Interactive analysis of DAQ Data using Matlab  Learning Curve Questions … –How do you know which DAQ data directory to use? –How do you know what valid timeframes of data are in a particular directory? –How do you know the channel names archived in the DAQ? –What do you do if you get an error from daq_fetch? –Understanding the structure of the data returned for a channel from daq_fetch DAQ_data{n}(1:numPulses, firstSample:lastSample, data_index*) (*1-sample #s, 2-subchannel 1, 3-subchannel 2, etc) –How do you know the sub-channels of a channel … How many and what do they represent (I, Q, Amplitude, Phase, X, Y, Klystron parameters, etc) –Since the number of samples returned varies from channel to channel, how to you align them? Answer: correlate the sample #s … (easily said!) –How do you know which sample #’s are supposed to have beam (i.e. valid diagnostic data) –How do you decipher the TIME array returned by daq_fetch –“I’m sure someone has had to implement this algorithm, where can I find an example?” 2

Interactive analysis of DAQ Data using Matlab  Existing Tools… –daq_fetch.m (Michael Davidsaver) Input arguments: list of channel_names, Tstart, Tend –DAQ directory hard-coded in daq_fetch.m Output arguments: list of channel names (+ time), daq data [dlbl, daq] –daq_fetch.m (enhanced by Ned Arnold) Input arguments: list of channel_names, Tstart, Tend, DAQ directory, retry flag Output arguments: list of channel names (+ time), daq data [dlbl, daq], missing channels –DESY’s DAQ GUI Helps find channel names which exist in DAQ data –DOI Version 1 Matlab GUI to retrieve DAQ data and … –Store in a local file (for interactive analysis) –Pass on to an analysis program On daq_fetch error, searches for channel that is missing data Allows channel names to be stored in “groups” for easier entry Provides introspection of analysis scripts to designate channels to be fetched (i.e. selecting an analysis script puts those channels on the list to be fetched) 3

Ideas to simplify the learning curve … (or “Wouldn’t it be nice if …”)  A consistent naming convention to use in Matlab analysis programs (including sub- channels) so code is easily readable –Current: LLRF/C7.ACC2.PROBE [sub-channels I, Q] LLRF.ML/ACC23_AMPL LLRF.ML/ACC23_PHASE [Vector Sum] –Proposed: rf_acc2c7_probe.phase rf_acc2c7_probe.ampl rf_acc23_vs.phase rf_acc23_vs.ampl  A simplified data structure of returned data –Use nicknames and structures: Current: DAQ_data{7}(1:numPulses, 1:numSamples, 3) Proposed: bpm10TCOL.Y(1:numPulses, 1:numSamples) –Fill in under-sampled waveforms so all waveforms are (when needed)  Frequently needed algorithms written once and shared … –Conversion from I/Q to phase & amplitude –Fill in arrays (see above) –Find sample #’s where beam is present –Find sample #’s where RF is at the flattop 4

Possible Results …  Typical sequence for interactive Matlab analysis … –Fetch and store data using DOI Version 2 Select channel names interactively, via groups, or by selecting an analysis program –In matlab … >> load >> assignNicknames; >> preprocessSubchannels; >> findBeamSamples; >> plot(energyDump(:, samplesWithBeam), bpm10TCOL.X(:, samplesWithBeam)); 5

What’s required?  A local relational database (RDB) to relate … –Channel names to sub-channels –Sub-channels to nicknames –Specify “special processing” for certain sub-channels –Keep track of sample # offsets for each channel  An enhanced daq_fetch.m that … –Allows scripts to use real channel names or nicknames –Interacts with the database to determine nicknames/sub-channels/channels –If data is not returned for a given channel, gives the user an option to fetch all other channel data (eliminates bad channels from the list)  An enhanced DOI –Allows users to view and retrieve channel names, sub-channel names and nicknames from RDB  Commonly used analysis scripts in a centralized location 6

Nicknames to DAQ names 7 DAQ Directory Local Database daq_fetch_nn.m Your_matlab_code.m Chans = {… ‘bpm_5dump.x’,… ‘bpm_5dump.y’,… ‘rf_acc2c1_prb.ampl’,… ‘rf_acc2c2_prb.ampl’,… ‘rf_acc2c3_prb.ampl’,… ‘kly2_1_pfor.ampl’,… ‘’};

Useful Information in a Database DAQ Channel Name DescriptionSysDimensions (returned by daq_fetch) Sub-channel Nicknames (structures) Samples Return’d Processing Req’ts 11BC3BLM1 – Sample #’s 2 – Voltage blm_11bc30:1599None 5DUMPBPM1 – Sample #’s 2 – X 3 – Y bpm_5dump.x bpm_5dump.y 690:1699None LLRF/C3.ACC2.PROBE LLRF/C3.ACC2.PFOR LLRF/C3.ACC2.PREFL ACC2 C3 Probe ACC2 C3 Fwd Pwr ACC2 C3 Refl Pwr ACC2 1 – Sample #’s 2 – I 3 – Q 4 – phase 5 - amplitude rf_acc2c3_prb.ampl rf_acc2c3_prb.ph rf_acc2c3_pfor.ampl rf_acc2c3_pfor.ph rf_acc2c3_prefl.ampl rf_acc2c3_prefl.ph 0:2:2046Type 1 – I/Q KLY.ADC/kly2.1Klystron 2 Parameters KLY1 – Sample #’s 2 – PFOR 3 – PREFL 4 – PFOR Circulator 5 – PREFL Circulator 6 – Klystron Voltage 7 – Klystron Current 8 – PFOR Preamp Out 9 – Power Meter Trigger kly2_1_pfor.ampl kly2_1_prefl.ampl kly2_1_circ_pfor.ampl kly2_1_circ_prefl.ampl kly2_1.voltage kly2_1.current kly2_1_preamp_pfor.a mpl 0:1:2047None 8

Comments on the use of a database  Advantages –With ‘sqlite’ (a “serverless” RDB), the ‘database’ is a single file that can be easily backed up and shared –Provides a central place to store answers to the question “What’s in the DAQ?” (for 9ma experiments) –Provides a consistent naming convention … at least for DAQ retrieval to matlab –Easier to read others’ code –Eases the learning curve!  Disadvantages / Concerns –Yet another name space (DOOCS, DAQ, 9ma-DAQ, …) Stay with channel names and just add an extension for sub-channels? –Can we keep the database accurate? What happens if the sub-channels, # of samples, etc change between ‘runs’? Do we need entries for each run? (it could get ugly! … but better to do it one-time-for-all) –How long will it take to have a useful environment? Do you want “Quick and Ugly” or “Well designed for long term support” 9