Commit 518ad15e authored by Peter Jansweijer's avatar Peter Jansweijer

INSITU_ALPHA: Cleaned pps_diff.py

parent f9b955a8
......@@ -376,30 +376,23 @@ if __name__ == "__main__":
parser.add_argument("name", help="file containing ddelay measurements to perform")
parser.add_argument("-mserial", default="/dev/ttyUSB2")
parser.add_argument("-sserial", default="/dev/ttyUSB1")
#parser.add_argument("-alpha", default=0, type=int)
#parser.add_argument("-itu", default=18.0, type=float)
parser.add_argument("-t", help="track fiber spool temperature (using PT100 and Digital Multimeter at IP address)", default=None)
parser.add_argument("-dso", default="192.168.32.243") # LeCroy8254M default IP
parser.add_argument("-output_dir", default="data")
#parser.add_argument("-measurements", default=1, type=int)
args = parser.parse_args()
name = args.name
print("Used Delta Delay input file: ",name)
print("Use Master Serial port: ",args.mserial)
print("Use Slave Serial port: ",args.sserial)
#print("Alpha @ ITU channel (SPEC format): ",args.alpha)
#print("ITU channel: ",args.itu)
print("Fiber spool temperature track: ",args.t)
print("Osciloscope: ",args.dso)
print("Output directory: ",args.output_dir)
#print("Number of measuremnt cycles: ", args.measurements)
if os.path.exists(name) == True and os.path.isfile(name) == True:
measure, pairs = file_to_array(name)
else:
print("Delat Delay input file not found")
sys.exit()
# add trailing slash if not present
output_dir = os.path.join(args.output_dir,'')
......@@ -407,15 +400,10 @@ if __name__ == "__main__":
os.mkdir(output_dir)
print("Output directory does not exist => created: "+output_dir)
#measurements = args.measurements
#alpha = args.alpha
#ch = args.itu
# Some constants (for now)
# scan from itu channel start to stop and skipt he channel that is used
# scan from itu channel start to stop and skip the channel that is used
# for the return channel. "itu_skip_width" can be made larger than 1
# in case the dwdm filters are wider than just the return channel
# Step size of the scan is defined by "itu_channel_increment"
fixed_delay_mst=int(328182) # Master (dTx + dRx) [ps]
fixed_delay_slv=int(327963) # Slave (dTx + dRx) [ps]
master_is_switch = False # If the master is a WR switch then the restart sequence is different from CLB or SPEC
......@@ -427,17 +415,14 @@ if __name__ == "__main__":
sfp_module_vendor_id = params["vendor_id"]
itu_channel_start = params["itu_channel_start"]
itu_channel_stop = params["itu_channel_stop"]
#itu_channel_stop = 11.5 ## use this one for testing (it only tunes itu-11 and itu-11.5)
# Slave SFP (fixed)
vendor_id_slv = "EOLS-1612-24205D"
itu_channel_skip = 20
itu_skip_width = 0.5
#itu_channel_increment = params["itu_channel_spacing"]
itu_channel_increment = 1
ddelay_measurement = 2 # number of delta delay measurements over which is averaged
restarts = 2 # number of link restarts over which the delta_delay is averaged
ddelay_measurement = 10 # number of delta delay measurements over which is averaged
restarts = 10 # number of link restarts over which the delta_delay is averaged
scope = vxi11.Instrument(args.dso)
osc_init(scope, time_base = 1.0e-9)
......@@ -548,10 +533,6 @@ if __name__ == "__main__":
wr2wrpc(ser_tunable,"sfp rd_ch\r",ser_tunable_str)
print(ser_tunable.readline())
# while measurements > 0:
# measurements = measurements - 1
restart = 0
while restart < restarts:
#for restart in range(restarts):
......
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