Commit 70100d09 authored by Peter Jansweijer's avatar Peter Jansweijer

get rid of docopt

parent 1c812028
......@@ -21,16 +21,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
-------------------------------------------------------------------------------
Usage:
edge_edge.py <IP#> [--meas=<number>]
edge_edge.py IP# [-m=<number>]
edge_edge.py -h | --help
IP IP number of the Oscilloscope
(for example: 192.168.32.248 which is its DevNet IP number)
IP IP number of the instrument [default 192.168.32.248]
Options:
-h --help Show this screen.
--version Show version.
-m --meas=<number> number of measurements to be taken [default: 1]
-m <intr> number of measurements to be taken [default: 1]
-h --help Show help
"""
......@@ -47,7 +45,6 @@ lib_path = os.path.join(lib_path,"..")
sys.path.insert(0,lib_path)
# private imports:
from lib.docopt import docopt
import lib.LeCroy8254 as DSO
#import lib.Agilent_DSO6104A as DSO
import lib.pat_gen as pat_gen
......@@ -155,24 +152,47 @@ def average_edge_to_edge(scope, num_meas, expect_max, estimate, tolerance = 1.0e
##
## If run from commandline, we can test the library
##
if __name__ == "__main__":
arguments = docopt(__doc__,version='Edge to SFD delay 1.1')
"""
Usage:
edge_edge.py IP# [-m=<number>]
edge_edge.py -h | --help
num_meas = 1
IP IP number of the instrument [default 192.168.32.248]
if len(sys.argv) >= 3:
num_meas = int(sys.argv[2].split('=')[1])
Options:
-tol <float> tolerance [default: 10.0e-9] specifies how far the
measured delay may be off target. Tolerance helps you to
skip outliers in your measurements.
-timebase <float> time base [default: 20.0e-8] # 20 ns/div
-m <intr> number of measurements to be taken [default: 1]
-h --help Show help
"""
if __name__ == "__main__":
#arguments = docopt(__doc__,version='Edge to SFD delay 1.1')
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("IP", help="IP number of the instrument", default="192.168.32.248")
parser.add_argument("-peak", help="expected sample number for peak", default=0)
parser.add_argument("-delay", help="estimated delay", default=0)
parser.add_argument("-tol", help="outliers tolerance", default=10.0e-9)
parser.add_argument("-timebase", help="DSO timbase", default=20.0e-9)
parser.add_argument("-m", help="number of measurements", default=1)
args = parser.parse_args()
# When oscilloscope triggers on Channel 1 and trigger is set to the middle
# of the screen then the expected edge maximum for edge and SFD are at:
expect_max = -22
estimated_delay = 7.257475000009182e-11
tolerance = 10.0e-9
time_base = 20.0e-9 # 2 ns/div
scope = vxi11.Instrument(sys.argv[1])
#scope = vxi11.Instrument("192.168.32.248")
IP = str(args.IP)
expect_max = int(args.peak)
estimated_delay = float(args.delay)
tolerance = float(args.tol)
time_base = float(args.timebase)
num_meas = int(args.m)
scope = vxi11.Instrument(IP)
# Initialize oscilloscope
# Use Channel 1 pulse input
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment