Commit c13bd095 authored by Peter Jansweijer's avatar Peter Jansweijer

Only consider fswp dat files (and skip others like already saved png files in the same directory)

parent 53bd2af7
......@@ -246,27 +246,30 @@ if __name__ == "__main__":
# add plot title if input with -t
if plot_title != "":
ax.set_title(plot_title)
# scan all files in the direcory
for filename in os.listdir(data_dir):
fswp_data = file_to_fswp_plot(os.path.join(data_dir,filename))
if only_trace1:
x = fswp_data["trace"][1][0]
y = fswp_data["trace"][1][1]
if fswp_data["window"] == "Noise Spectrum":
trace = ax.semilogx(x, y, label = filename + str(" [1]"))
else:
trace = ax.plot(x, y, label = filename + str(" [1]"))
lns = lns + trace
else:
for trace_nr in fswp_data["trace"].keys():
x = fswp_data["trace"][trace_nr][0]
y = fswp_data["trace"][trace_nr][1]
if fswp_data["window"] == "Noise Spectrum":
trace = ax.semilogx(x, y, label = filename + str(" [") + str(trace_nr) + ("]"))
else:
trace = ax.plot(x, y, label = filename + str(" [") + str(trace_nr) + ("]"))
lns = lns + trace
# but only consider FSWP DAT files
if (".DAT" in filename) or (".dat" in filename):
fswp_data = file_to_fswp_plot(os.path.join(data_dir,filename))
if only_trace1:
x = fswp_data["trace"][1][0]
y = fswp_data["trace"][1][1]
if fswp_data["window"] == "Noise Spectrum":
trace = ax.semilogx(x, y, label = filename + str(" [1]"))
else:
trace = ax.plot(x, y, label = filename + str(" [1]"))
lns = lns + trace
else:
for trace_nr in fswp_data["trace"].keys():
x = fswp_data["trace"][trace_nr][0]
y = fswp_data["trace"][trace_nr][1]
if fswp_data["window"] == "Noise Spectrum":
trace = ax.semilogx(x, y, label = filename + str(" [") + str(trace_nr) + ("]"))
else:
trace = ax.plot(x, y, label = filename + str(" [") + str(trace_nr) + ("]"))
lns = lns + trace
if fswp_data["window"] == "Spectrogram" or fswp_data["window"] == "Frequency Sweep":
if plot_title == "" :
......
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