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
Message ID: 1875     Entry time: Wed Aug 23 13:39:02 2017
Author: Craig, awade 
Type: HowTo 
Category: Computers 
Subject: How To Plot remote spectra and TF files in the ctn_labdata Git repo quickly 

Agilent GPIB IP address:

SR785 GPIB IP address:

Tektronix Scope IP Address:

To measure off of the Agilent or SR785: use Eric Q's netgpibdata scripts to get the measurements.  Just update the .yml files and then run ./AGmeasure measure.yml or ./SRmeasure measure.yml.

To measure off of the Tektronix scope: You can only get one channel dumped at a time from Tobin's script in the 40m SVN.  Check out the /tektronix/ folder from the 40m SVN and run ./tek-dump ch1 foo.csv

Now you have to plot the measurements you've taken.  I've prepared two scripts in the ctn_labdata/scripts Git repo.  One is twoColumnDataPlotter.py and the other is TFplotter.py.  Both have very good help messages, but I will give an example here.

Let's say that you just took a Noise spectrum with the Agilent using Q's netgpibdata script ./AGmeasure SPAG4395Atemplate.yml.  Then you will write your data to the /ctn_labdata/data/ Git repo like a good scientist in our lab.  You will also put your measurement in it's own folder, with a descriptive folder name like /ctn_labdata/data/YYYYMMDD_TransBeatnoteSpectrum/.

twoColumnDataPlotter.py and TFplotter.py are prepared to work with data like this.  In this case, since you have taken a spectrum, you have two columns of data in the resulting .txt file, frequency and the ASD.  So you will use go to ctn_labdata/scripts/twoColumnDataPlotter.py and use the script like so:

python twoColumnDataPlotter.py ../data/YYYYMMDD_TransBeatnoteSpectrum/ --xlabel "Frequency [Hz]" --ylabel "ASD [Vrms/$\sqrt{Hz}$" --title "Trans Beatnote ASD"

This will automatically create a folder called ctn_labdata/plots/YYYYMMDD_TransBeatnoteSpectrum/, and put the resulting plot in there with the title, x and y labels you specified.  The plot will be saved in a PDF format with a name of YYYYMMDD_HHMMSS_DataFileNameMinusTheDotTxt.pdf.  The ctn_labdata/plots/ directory will always have the same name as the ctn_labdata/data/ folder you made, and the actual plot PDF will always include the time and data you made the plot at the beginning, as well as the data file name minus the .txt at the end. 

If you have a TF measurement from the Agilent, use TFplotter.py in the exact same way as above, just replace python twoColumnDataPlotter.py with TFplotter.py.   You may also specify the second y axis using a --y2label "Phase [degs]" flag.

Please use this method to plot spectra and TFs in the Git repo!  This will avoid confusion and make things consistent and easy to find in the Git repo.

ELOG V3.1.3-