40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  PSL  Not logged in ELOG logo
Entry  Thu Jan 11 11:35:36 2018, Craig, HowTo, Computers, Getting data from our frame builder from anywhere 
    Reply  Wed Feb 28 18:58:01 2018, Craig, HowTo, Computers, Getting CTN lab data from framebuilder using python nds2 SCAV_SLOWOUT_examplePlot.png
Message ID: 2112     Entry time: Wed Feb 28 18:58:01 2018     In reply to: 2040
Author: Craig 
Type: HowTo 
Category: Computers 
Subject: Getting CTN lab data from framebuilder using python nds2 

Jaime and John R have done some work enabling NDS on our framebuilder in the subbasement, fb4.  I have figured out how to get data from fb4 to our CTN lab computer ws3, using python nds2.

1) Log into ws3 from your local machine: $ ssh -Y controls@ -p 2022

2) Run ipython on ws3: $ ipython

3) Enter the following code into the ipython session:

In [1]: import nds2
In [2]: c = nds2.connection('', 8088)  # is the fb4 local ip address.  8088 is the fb4 NDS broadcast port number.
In [3]: gpstime = 1201902464  # using old data from Feb 5th, because our lab has been out of commission for a couple of days.
In [4]: chanName = 'C3:PSL-SCAV_FSS_SLOWOUT'  # retrieve the SCAV slow laser control
In [5]: from pylab import *
In [6]: ion()
In [7]: data = c.fetch(gpstime, gpstime+50000, [chanName])
In [8]: plot(data[0].data)

A plot should appear on your computer.  It should be the same as the plot posted below.  It should take about 10 seconds to appear.


Steps to getting data from our framebuilder, since many of the steps are pretty hard to remember.  These steps were performed on a Macbook running OSX Sierra 10.12.5.  Dataviewer was opened locally using XQuartz.

1) SSH into PSL Lab computer ws3 through the public port 2022:

$ ssh -Y controls@ -p 2022   (I often alias this on my PC .bashrc as some command: $ alias ws3="ssh -Y controls@ -p 2022")

2) SSH into framebuilder4 fb4:

$ fb4 ("fb4" is already aliased on ws3 to be the command $ ssh -Y controls@

3) Launch dataviewer:

$ dvlaunch ("dvlaunch" is an alias to $ LIGONDSIP=localhost dataviewer.  This tells dataviewer to look locally for frames.)

4) Dataviewer will launch.  Click the "Signal" tab.  Click the "Slow" button.  Channel options "C3" and "C4" should appear.  The PSL Lab is "C3".  Choose what channels you want to plot.

5) Click the "Playback" tab.  Click "Second Trend" because other modes don't work.  Unclick "Min" and "Max".  Select X Axis Time as "GPS".  Choose your start and stop times you want plotted. Finally select your signals.  Click "Start".

Wait a while.  The terminal you ran dvlaunch from should give a progress report.  After all data is retreived a plots page should automatically appear with the channels and plot start/stop times you requested.

If you want to save the data from your plot:

6) Click on the plot you want to save data from.  It will have little black boxes in the corners of the plot when selected.

7) Click the "Data -> Export -> ASCII" tab.  A window called "Grace: Write sets" should open.

8) Click on the option under "Write set(s)", and change the Format from "%.8g" to "%.10g" to get all the digits of the GPS time.  Change Selection to whatever you want to name your datafile.  Click "OK". 

Your data should be saved.  Make sure it is formatted well.


Attachment 1: SCAV_SLOWOUT_examplePlot.png  86 kB  | Hide | Hide all
ELOG V3.1.3-