40m QIL Cryo_Lab CTN SUS_Lab TCS_Lab OMC_Lab CRIME_Lab FEA ENG_Labs OptContFac Mariner WBEEShop
  40m Log  Not logged in ELOG logo
Entry  Fri Feb 24 16:10:48 2012, mike, Update, Computers, PyNDS and a Plot PSD_Comparison.png
    Reply  Fri Feb 24 18:59:04 2012, Jenne, Update, Computers, PyNDS and a Plot 
       Reply  Wed Feb 29 17:32:11 2012, Mike, Update, Computers, PyNDS and a Plot 
Message ID: 6314     Entry time: Fri Feb 24 16:10:48 2012     Reply to this: 6316
Author: mike 
Type: Update 
Category: Computers 
Subject: PyNDS and a Plot 

Power Spectral Density plot using PyNDS, comparing 5 fast data channels for ETMX.

**EDIT** Script here:

import nds
import numpy as np
import matplotlib.pyplot as plt
import time
daq=nds.daq('fb', 8088)
channels=daq.recv_channel_list()
e=0
start=int(time.time()-315964819)
rqst=['C1:SUS-ETMX_SENSOR_UR','C1:SUS-ETMX_SENSOR_UL','C1:SUS-ETMX_SENSOR_LL','C1:SUS-ETMX_SENSOR_LR','C1:SUS-ETMX_SENSOR_SIDE']    #Requested Channels
for c in channels:
    if c.name in rqst:
        daq=nds.daq('fb', 8088)
        data=daq.fetch(start-100, start, c.name)
        vars()['psddata'+str(e)], vars()['psdfreq'+str(e)]=plt.psd(data[0],NFFT=16384,Fs=c.rate)
        vars()['label'+str(e)]=c.name
        e+=1
plt.figure(1)
plt.clf()
plt.title('PSD Comparison')
plt.grid(True, which='majorminor')
plt.xlabel(r'Frequency $Hz$')
plt.ylabel(r'Decibels $\frac{dB}{Hz}$')       
for x in np.arange(0,e):
    plt.loglog(psdfreq0, 10*vars()['psddata'+str(x)], label=vars()['label'+str(x)])
plt.legend()
plt.show()

Attachment 1: PSD_Comparison.png  1.160 MB  | Hide | Hide all
PSD_Comparison.png
ELOG V3.1.3-