It is a well known issue that our framebuilder is running slowly relative to our "real" time. However, we are physicists, so this is not entirely unprecedented. I have calculated that for every second we experience, the framebuilder experinces 0.89285 seconds, which means that fb4 must be travelling at 45% the speed of light.
However, despite the inevitable logistical issues associated with fb4 being used as a high energy experiment, it still stores valuable data for us in the CTN Lab. We would like to be able to access this data via python robustly, even if our times do not sync up. We can just get the time that fb4 thinks it is directly off of it.
First, we need direct access between ws1 and fb4 with no password. I followed the instructions from this site, and it worked. V easy.
Next, we need to use python to run an ssh command "caget -t -f10 C4:DAQ-DC0_GPS", where C4:DAQ-DC0_GPS is the channel representing the gpstime fb4 thinks it is. Followed the directions from this stackoverflow response on ws1. Boom. Code copied below for clarity.
In : import subprocess
In : import sys
In : HOST="email@example.com"
In : COMMAND="caget -t -f10 C4:DAQ-DC0_GPS"
In : ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],
In : result = ssh.stdout.readlines()
In : print result
In : fb4gps = float(result.strip('\n'))
In : fb4gps
Now we have the time that fb4 thinks it is. Finally we have to make sure we can plot data from fb4 using that gpstime. Following the directions from my old elog:
In : import nds2
In : from pylab import *
In : ion()
In : c = nds2.connection('10.0.1.156', 8088)
In : chanName = 'C3:PSL-SCAV_FSS_SLOWOUT'
In : fb4gps = int(fb4gps)
In : data = c.fetch(fb4gps-60, fb4gps, [chanName])
In : plot(data.data)
Out: [<matplotlib.lines.Line2D at 0x7ff3c20431d0>]
This should display interactively the latest data from our south slow volt controller, no matter what time fb4 thinks it is.