Commit be350ade authored by Peter Jansweijer's avatar Peter Jansweijer

added selection for scientific or 1 digit precision decimal [ps] output in file

parent 4bbb7ed4
......@@ -62,11 +62,21 @@ def save_plot(out_file, name, nameref, measurement_str, measurement_lst, outlier
meas_arr= numpy.array(measurement_lst)
mean = meas_arr.mean()
stdev = meas_arr.std(ddof=1)
# output in [ps] with one digit
mean_str = "{0:.1f}".format(mean*1e12)
stdev_str = "{0:.1f}".format(stdev*1e12)
#out_file.write("outliers: " + str(outliers) + "\n")
#out_file.write("mean: " + str(mean) + "\n")
#out_file.write("stdev: " + str(stdev) + "\n")
out_file.write(str(mean) + ", " + str(stdev) + ", " +str(outliers) + ", " +str(measurement_str_shortend) + "\n")
ScientificNotation = False
if ScientificNotation:
out_file.write(str(mean) + ", " + str(stdev) + ", " +str(outliers) + ", " +str(measurement_str_shortend) + "\n")
else:
out_file.write(mean_str + ", " + stdev_str + ", " +str(outliers) + ", " +str(measurement_str_shortend) + "\n")
fig = plt.figure("PPS_skew_fiberspool - PPS_skew_reference [ps]")
ax = fig.add_subplot(111)
......
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