Python Applications for Beamline Control Mark Rivers.

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

Computer Science 112 Fundamentals of Programming II User Interfaces
1 1999/Ph 514: Channel Access Concepts EPICS Channel Access Concepts Bob Dalesio LANL.
 Prof. Dr. M. H. Assal Introduction to Computer AS 26/10/2014.
Operating System Structure
Discovering Computers Fundamentals, Third Edition CGS 1000 Introduction to Computers and Technology Fall 2006.
MATLAB’s extensive, device-independent plotting capabilities are one of its most powerful features. They make it very easy to plot any data at any time.
Unit 1: Getting Started. What is a network?? A group of two or more computers that are linked together. Network Interface Card (NIC), basic network software.
Operating System - Overview Lecture 2. OPERATING SYSTEM STRUCTURES Main componants of an O/S Process Management Main Memory Management File Management.
Chapter Nine NetWare-Based Networking. Objectives Identify the advantages of using the NetWare network operating system Describe NetWare’s server hardware.
INFORMATION TECHNOLOGY, THE INTERNET, AND YOU
Chapter 5 System Software.
V4 – Executive Summary 1.Provide online add/delete of I/O to support continuous operation. 2.Provide redundant control of remote I/O to support improved.
Chapter 6: An Introduction to System Software and Virtual Machines
DEMONSTRATION FOR SIGMA DATA ACQUISITION MODULES Tempatron Ltd Data Measurements Division Darwin Close Reading RG2 0TB UK T : +44 (0) F :
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.
Operating System.
8/21/2015J-PARC1 Data Management Machine / Application State Data.
Computer Science 111 Fundamentals of Programming I User Interfaces Introduction to GUI programming.
AreaDetector: Recent Additions and Future Plans Mark Rivers GeoSoilEnviroCARS, Advanced Photon Source University of Chicago.
SunGuide SM Software Development Project Ramp Meter Firmware Discussions August 8, 2006.
UNIX SVR4 COSC513 Zhaohui Chen Jiefei Huang. UNIX SVR4 UNIX system V release 4 is a major new release of the UNIX operating system, developed by AT&T.
Forms - An Overview of Oracle Form Builder v.6.0 Abhishek Parag Prashant Arun.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
1 Distributed Systems: an Introduction G53ACC Chris Greenhalgh.
Steps in simulation study 1. - Clearly understand problem - Reformulation of the problem 2. - Which questions should be answered? - Is simulation appropriate?
Module 9: Preparing to Administer a Server. Overview Introduction to Administering a Server Configuring Remote Desktop to Administer a Server Managing.
Software Project Planning Defining the Project Writing the Software Specification Planning the Development Stages Testing the Software.
INVITATION TO COMPUTER SCIENCE, JAVA VERSION, THIRD EDITION Chapter 6: An Introduction to System Software and Virtual Machines.
© Paradigm Publishing Inc. 4-1 OPERATING SYSTEMS.
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
The System on a Chip Company ® LSI LOGIC LSI LOGIC 2/11/ Experiences and Progress with OpenAccess at LSI OpenAccess Interoperability Workshop March.
EPICS Access from Python Geoff Savage DØ Workshop Thursday June 22, 2000.
© ABB University - 1 Revision C E x t e n d e d A u t o m a t i o n S y s t e m x A Chapter 4 Engineering Workplace Course T314.
System Software Chapter Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved.
X-WindowsP.K.K.Thambi The X Window System Module 5.
Online Software 8-July-98 Commissioning Working Group DØ Workshop S. Fuess Objective: Define for you, the customers of the Online system, the products.
Managed by UT-Battelle for the Department of Energy CSS Update Matthias Clausen, Helge Rickens, Jan Hatje and DESY Delphy Armstrong, Xihui Chen,
EPICS EPICS Limitations Bob Dalesio Marty Kraimer.
CSCI 1101 INTRODUCTION TO COMPUTERS 5. Basic Computer Architecture.
COMPUTER FUNDAMENTALS David Samuel Bhatti
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Lab 3 + Using the Terminal 1. "Under Linux there are GUIs (graphical user interfaces). where you can point and click and drag, and hopefully get work.
Writing EPICS Channel Access Clients in Python Geoff Savage March 2003.
CPSC 171 Introduction to Computer Science System Software and Virtual Machines.
© Paradigm Publishing, Inc. 4-1 Chapter 4 System Software Chapter 4 System Software.
Controls & Monitoring Overview J. Leaver 03/06/2009.
Chapter 8 Operating Systems. Objectives Identify the types of system software Summarize the startup process on a personal computer Describe the functions.
Postgraduate Computing Lectures PAW 1 PAW: Physicist Analysis Workstation What is PAW? –A tool to display and manipulate data. Learning PAW –See ref. in.
BMTS 242: Computer and Systems Lecture 5: Yousef Alharbi Website
1 Channel Access Concepts – IHEP EPICS Training – K.F – Aug EPICS Channel Access Concepts Kazuro Furukawa, KEK (Bob Dalesio, LANL)
Project Planning Defining the project Software specification Development stages Software testing.
F Fermilab Python Channel Access Interface (CaChannel) Geoff Savage EPICS Collaboration Meeting 16 November 2000.
Graphical User Interfaces (GUI’s ). & Command-Line Interfaces.
Motion Control at the Advanced Photon Source Argonne National Laboratory Mark Rivers University of Chicago 7 GeV synchrotron x-ray light source, the largest.
9NL Ayomi Hasenclever.  You cant touch a software  It is stored in a computer or laptop  Allows the hardware to do something useful, without the software.
An operating system (OS) is a collection of system programs that together control the operation of a computer system.
Updates to CaPython/CaChannel John Hammonds Beamline Controls and Data Acquisition Group APS Engineering Support Division EPICS Collaboration Meeting INFN.
CHAPTER 2 COMPUTER SOFTWARE. LEARNING OUTCOMES At the end of this class, students should be able to:  Explain the significance of software  Define and.
System Software Chapter Handles technical details Works with end users, application software, and computer hardware Four types of programs –Operating.
Operating System Basics. Outline The User Interface Running Programs Managing Files Managing Hardware Utility Software.
Module 9: Preparing to Administer a Server
Forms Concepts Triggers Fired when Internal/External events occur
Topics Graphical User Interfaces Using the tkinter Module
Mark Rivers University of Chicago
Chapter 2: System Structures
Fundamentals of Python: From First Programs Through Data Structures
Topics Graphical User Interfaces Using the tkinter Module
Module 9: Preparing to Administer a Server
Windows Operating System
Presentation transcript:

Python Applications for Beamline Control Mark Rivers

Replace IDL applications (e.g. MCA GUI) with Python so that other beamlines don’t need to buy IDL Send users home with data and display/analysis programs that are free. – They don’t want to buy IDL. Motivation

Building Blocks CaChannel from Geoff Savage for EPICS interface Tkinter and Pmw for GUIs Pmw.Blt for plots Numeric for arrays

BltPlot: Enhancements to the Pmw.Blt.Graph widget A standalone plotting widget, BltPlot.BltPlot. This widget has menus to: –Configure all of the plot characteristics –Save and restore the plot settings and data –Print the plot to a file or printer Methods (BltPlot.plot and BltPlot.oplot) to create a new plot, to overplot more data, etc. Designed to provide a rough emulation of the command line plotting capabilities of IDL.

BltPlot

BltPlot: Enhancements to the Pmw.Blt.Graph widget GUI routines to configure all of the plot characteris tics, such as axes, markers, legends, etc. –These routines work with any Pmw.Blt.Graph instance so they can be used from the standalone plotting widget in this package (BltPlot.BltPlot) or from any application that uses the Pmw.Blt.Graph widget Routines to save and restore plot settings and data. Used in the mcaDisplay described later.

BltPlot Dialogs

epicsPV: Subclasses Geoff Savage's CaChannel class If a PV name is given then the class constructor will do a searchw() by default. setMonitor() sets a generic callback routine for value change events. Subsequent getw(), getValue() or array_get() calls will return the value from the most recent callback, and hence do not result in any network activity or latency. This can greatly improve performance. checkMonitor() returns a flag to indicate if a callback has occurred since the last call to checkMonitor(), getw(), getValue() or array_get(). It can be used to increase efficiency in polling applications.

epicsPV getControl() reads the "control“ and other information from an EPICS PV without having to use callbacks. In addition to the PV value, this will return the graphic, control and alarm limits, etc. putWait() calls array_put_callback() and waits for the callback to occur before it returns. This allows programs to use array_put_callback() synchronously and without user-written callbacks.

epicsMotor Class library for EPICS motor record Methods: –move(), stop(), wait(), get_position(), set_position() Virtual attributes: –slew_speed, base_speed, high_limit, low_limit, done_moving, backlash, resolution, etc. Example use: from epicsMotor import * m = epicsMotor(’13LAB:m5’) m.move(10.) m.wait() m.get_position(dial=1, readback=1)

epicsScaler Class library for EPICS scaler record Methods: –start(), stop(), read(), wait(), get_label(), set_label() Example use: >>> from epicsScaler import * >>> s = epicsScaler('13LAB:scaler1') >>> s.get_counts() >>> s.read() [0, 0, 0, 0, 0, 0, 0, 0] >>> s.start(1.) >>> s.wait() >>> s.read() [ , 0, 0, 0, 0, 0, 0, 0]

epicsLogger GUI appplication for logging EPICS PVs to the screen and to a disk file

mcaDisplay

mcaDisplay() Replacement for my IDL MCA display program Much nicer in many respects, since the Blt plot widget has many more east-to-use features than IDL’s direct graphics Python object with callable methods, so it can be remotely controlled Device independent. It reads files and controls the “hardware_mca” class. “hardware_mca” can be subclassed for any hardware. Presently the EPICS MCA record is supported

Mca: Device-independent MCA class Support classes: mcaROI, mcaCalibration, mcaElapsed, mcaPresets, mcaPeak, etc. Many methods: add_roi(), fit_background(), fit_peaks(), get_calibration(), set_calibration(), write_file(), read_file(), etc. Used as base class of epicsMca.

epicsMca: Subclass of hardwareMca, which is subclass of Mca All methods of Mca, plus start(), stop(), erase(), wait(), etc. Re-implements base class routines for set_calibration(), set_rois(), etc. to communicate with fields in the EPICS MCA record Example use: from epicsMca import * mca = epicsMca(’13BMD:aim_adc1’) mca.erase() mca.start() mca.wait() mca.write_file(‘test.001’)

mcaPeakFit

mcaPeakFit Parameters

mcaPeakFit Output

Mpfit Generalized non-linear least squares data fitting Based on LMFIT from Minpack Originally translated to IDL by Craig Markwardt, I translated to Python Much faster and more accurate than the version provided in the Scientific Python package in Scientific.Functions.LeastSquares. Contraints, fixed parameters, analytic or numerical derivatives, etc. Used in mcaPeakFit

Med: Device-independent multi- element detector class Collection of Mca objects. Methods operate on all contained Mca objects. Example: –add_roi(), set_presets(), get_calibration(), etc. Used as base class of epicsMed.

epicsMed Subclass of Mca and Med All methods of Mca and Med, plus start(), stop(), erase(), wait(), etc. Re-implements base class routines for set_calibration(), set_rois(), etc. to communicate with fields in the EPICS MCA record Example use: from epicsMed import * med = epicsMed(’13GE1:med:’, 16) med.erase() med.start() med.wait() med.write_file(‘test.001’)

medDisplay