<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Isolating the Maximum Values
Step1:  The distance between the interferometer peaks should be constant, so finding the time separating two maximum values should tell me how much time elapses between the two peaks, which we can use as a measure of separation of frequencies.
Step2:  The time difference between peaks is 0.00158 seconds.
<ASSISTANT_TASK:>
Python Code:
get_peak_data(ch2, [0.025, 0.030]);
get_peak_data(ch2, [0.030, 0.035]);
get_peak_data(ch2, [0.0350,0.045]);
get_peak_data(ch2, [0.049, 0.0517]);
maximum_time_positions = [0.028124, 0.03266, 0.042744, 0.05052]
maximum_voltage_positions = [0.738, 0.53, 0.716, 0.48]
# Two subplots, unpack the axes array immediately
f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
f.set_figheight(10)
f.set_figwidth(15)
ax1.set_title("Maximum Values on SAS, No Doppler")
ax1.set_ylabel("Voltage (V)")
ax1.set_xlabel("Time (s)")
ax1.plot(maximum_time_positions, maximum_voltage_positions, 'rp')
ax1.plot(time, ch2)
ax2.set_title("Maximum Values on Interferometer Spikes")
ax2.set_xlabel("Time (s)")
ax2.plot(maximum_time_positions, maximum_voltage_positions, 'rp')
ax2.plot(time, ch3, 'y-')
Explanation: Isolating the Maximum Values
End of explanation
get_peak_data(ch3, [0.019, 0.020]);
get_peak_data(ch3, [0.019, 0.022]);
0.020856 - 0.019276
Explanation: The distance between the interferometer peaks should be constant, so finding the time separating two maximum values should tell me how much time elapses between the two peaks, which we can use as a measure of separation of frequencies.
End of explanation
differences = [0]
for i in range(1,len(maximum_time_positions)):
    differences.append(maximum_time_positions[i]-maximum_time_positions[i-1])
differences
from prettytable import PrettyTable
x = PrettyTable()
x = PrettyTable()
x.add_column("Time (s)", maximum_time_positions)
x.add_column("Voltage (V)", maximum_voltage_positions)
x.add_column("Difference (s)", [round(i, 5) for i in differences])
x.add_column("Number of Interferometer Distances Apart", [round(i, 5)/0.00158 for i in differences])
x.add_column("Separation of Features (MHz)", [round(i, 5)/0.00158 *379 for i in differences])
print(x)
file = open('SummaryTable.txt', 'w')
file.write(str(x))
file.close()
Explanation: The time difference between peaks is 0.00158 seconds.
End of explanation
<END_TASK>