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
Message ID: 1075     Entry time: Thu Oct 23 18:45:18 2008
Author: Alberto 
Type: Omnistructure 
Category: Computer Scripts / Programs 
Subject: Python code for GPIB devices developed for the Absl length experiment 
I wrote two Python scripts for my measurement that can be also used/imitated by others: sweepfrequency. py and HP8590.py. The first is is the one that we run by a Python interpreter (just typing "python <name script> <parameters>"from the terminal). It manages the parameters that we have to pass it for the measurement and calls the second one, HP8590.py which actually does most of the job.

Here what it does. It scans the frequency of the Marconi and, for each step, searches the highest peak in the Spectrum Analyzer (which is centered 50 KHz around the frequency of the Marconi). It then associates the amplitude of the peak to the frequency of the Marconi and write the two number in two columns of a file.
The file name, the GPIB-to/LAN interface IP address, the frequency range, the frequency step amplitude and the number of measures we want it to average for each step, are all set by the parameters when we call sweepfrequency.py.
More details are in the help of the function or just looking at the header of the code.

I guess that one can perform other similar measurement just with little changes in the code so I think it could turn out useful to anyone else.
Attachment 1: HP8590.py  1 kB  | Hide | Hide all
# This function provides the measuremeent of the peak amplitude on the spectrum analyzer
# HP8590 analyzer while sweeping the excitation frequency on the function generator.
# Alberto Stochino 2008

import re
import sys
import math
from optparse import OptionParser
from socket import *
... 55 more lines ...
Attachment 2: sweepfrequency.py  1 kB  | Hide | Hide all
## sweepfrequency.py [-f filename] [-i ip_address] [-a startFreq] [-z endFreq] [-s stepFreq] [-m numAvg]
## This script sweeps the frequency of a Marconi local oscillator, within the range
## delimited by startFreq and endFreq, with a step set by stepFreq. An arbitary
## signal is monitored on a HP8590 spectrum analyzer and the scripts records the
## amplitude of the spectrum at the frequency injected by the Marconi at the moment.

## The GPIB address of the Marconi is assumed to be 17, that of the HP Spectrum Analyzer to be 18

## Alberto Stochino, October 2008
... 51 more lines ...
ELOG V3.1.3-