diff rs_fsp7_noisetest.py @ 85:60ad91b4c67c default tip

Add 'quick' option to use a faster sweep time with no averaging. Useful for testing the hardware is setup correctly without having to wait 3 minutes.
author Daniel O'Connor <doconnor@gsoft.com.au>
date Mon, 21 Oct 2024 14:12:50 +1030
parents 4b4ae555067b
children
line wrap: on
line diff
--- a/rs_fsp7_noisetest.py	Thu Oct 03 08:57:10 2024 +0930
+++ b/rs_fsp7_noisetest.py	Mon Oct 21 14:12:50 2024 +1030
@@ -156,6 +156,7 @@
     parser.add_argument('-s', '--span', default = 1e6, help = 'Span frequency in Hz (default: %(default).0f Hz)', type = float)
     parser.add_argument('-t', '--time', default = 30, help = 'Sweep time (default: %(default)f sec)', type = float)
     parser.add_argument('-w', '--sweeps', default = 3, help = 'Number of sweeps to average (default: %(default)d)', type = int)
+    parser.add_argument('-q', '--quick', action = 'store_true', help = 'Use presets for a quick test to check hardware is setup correctly')
     parser.add_argument('address', help = 'Spectrum analyser address', type = str)
     parser.add_argument('centre', help = 'Centre frequency (Hz)', type = float)
 
@@ -167,6 +168,10 @@
     if args.time is not None and args.time <= 0:
         parser.error('Sweep time must be >0')
 
+    if args.quick:
+        args.time = 5
+        args.sweeps = 1
+
     # Compute ENR at frequency of interest
     enr = findenr(args.input)