create new tag
view all tags

Data Acquisition System - DAQ

This page assumes you have a terminal on extlw-lxs1. If you are not at this computer - ie in the control room - SSH first.

ssh -X extlw-lxs1 -l atfopr

  • Up and Running? - If not Restart
  • Using The LW GUI
  • Manual Control Using Python Programs
  • How to access specific hardware
  • Data Structure

Up and Running? - If not Restart

cd extlw
source lwprofile
cd run
...wait a bit here...

...wait some more...

screen -r will show you three running screen sessions that the above script should start. These are the EPICS ioc - lwioc, a pulse by pulse simple processing script - lwpyproc and the temperature monitoring software - lwpytemp.

screen -r
...see a list of screens
screen -r 1903.lwpyprocess  (for example - different PID each time..)

If everything is working ok, this should update a counter with each pulse. If it is not or it's crashed seek help!

Ctrl A    Ctrl D

to diconnect from the screen - don't kill the process or the terminal window when viewing or you'll kill it!

Using The LW GUI

Data acquisition is ideally done through the EDM graphical user interface. From opening a terminal:

cd extlw/
source lwprofile
cd run
edm -x extlw

Manual Control Using Python Programs

Comments are shown indicated by '#'. Everything after the '#' is not programming.

cd extlw/
source lwprofile
cd run

All LW python scripts begin with 'lw'. The most common ones you'll need are:

File Purpose
lwAcq.py Acquire data and write to disk
lwAna.py Load a data file and do some analysis and plotting

In each case when pylab is running import the file by name without the .py extension. If you then type the name of the file followed by a '.' then press tab, the contents of it will be shown. The first few starting with capital letters are the classes within the file or 'module'. Typically, the repeat of the file name is the one you want. Create an instance of it to proceed. E.g.

  • import lwAcq
  • lwAcq. # press tab spews out contents here
  • a = lwAcq.Acq()

This returns an error as it requires some information to start with. To get help on all classes, simply type them out followed by a questions mark:

  • lwAcq.Acq? #use up and down arrows to look through help, then press 'q' to exit back to normal
  • a = lwAcq.Acq('log')
  • a. #press tab here to see options - capital ones are methods, small letters are objects
  • a.AcquireN(10) # acquires 10 machine pulses
  • a.AcquireN(3) # acquires 3 machine pulses and appends to same data file - one file per class instance
  • a.CloseAcq() # close file to further writing

To read data in the most basic way us lwData in pylab

  • import lwData
  • c = lwData.Data()
  • c.Read('../dat/raw/filename.dat')
  • c.data.keys() # shows you all the recorded variables
  • c.data['cherenkov']

The last line prints out all the data. Perhaps more usefully, assign it to a variable. E.g.

  • ydata = c.data['cherenkov']
  • ydata = c.data['chaver'] # vertical chamber position
  • plot(xdata,ydata) # plottin is easy!
  • clf() # clears figure - otherwise new graph will be on top of old one
  • plot(xdata,ydata,'.') # plot points only and not line

How to access specific hardware

From extlw-lxs1 use the following predefined shortcuts or use their names using another application (below shortcut minus 'rd'.

rdextlw-win1 Remote desktop to windows 1 Laser Control
rdextlw-win2 Remote desktop to windows 2 Dead frown
rdextlw-win3 Remote desktop to windows 3 Chamber Control ONLY
rdextlw-win4 Remote desktop to windows 4 IP Movers, OTR, Laser energy Meter
rdextlw-win5 Remote desktop to windows 5 General Multipurpose

Each should have compiled labview executables running for the various equipment. This should be in the startup folder in the start menu or at the very least on the desktop.

Data Structure

Data is recorded in ASCII text files with the extension '.dat'. Filenames are of the format YYYYMMDD_HHMM_suf.dat, where 'suf' is a suffix denoting the purpose of the data file.

Suffix Purpose
lws Laser-wire scan of any kind
otr OTR data of any kind
log Data that is not specifically as a scan
pos A single sample of data for positions
tst A file used for testing purposes
tmp Temperature data
ped ADC data for pedestal

eg. 20121201_1106_lws.dat

Data structure consists of

token 1 > s token 2 > s token 3 > s(array) token 1 > s token 2 > s token 3 > s etc

where s is a sample for that token - this can be a single number or array. For each sample, all tokens are recorded on a new line. Values are separated by a single space ' '. eg: 'cbpmamp> 2031' or cbpmx> 123 32 4245 432 ....'.

This data can be cleverly searched in the command line using egrep (extended grep).

egrep somestring filename.dat

where string is typically a variable name:

  • egrep '\<cherenkov\>' 20120406_0026_tst.dat
  • cherenkov> 215.0
  • cherenkov> 218.0
  • cherenkov> 214.0
  • cherenkov> 213.0

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r1 - 15 Feb 2013 - LaurieNevay

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback