Commit 8a2e288e authored by Peter Jansweijer's avatar Peter Jansweijer

apply normalize to rad/sqrt(Hz)

parent 2050efff
......@@ -301,21 +301,32 @@ if __name__ == "__main__":
norm_pn = normalize
if only_trace1:
# x, y in [dBc/Hz]
x = fswp_data["trace"][1][0]
y = fswp_data["trace"][1][1]
# x_rad, y_rad in [rad/sqrt(Hz)]
x_rad = fswp_data["trace_rad"][1][0]
y_rad= fswp_data["trace_rad"][1][1]
# Normalize logarithmic [dBc/Hz] by add/subtract dB's
y_norm = fswp_data["trace"][1][1] + norm_pn
# Normalize lineair [rad/sqrt(Hz)] by multpilying dbc2rad(dB's)
y_norm_rad = fswp_data["trace_rad"][1][1] * dbc2rad(norm_pn)
#pdb.set_trace()
if fswp_data["window"] == "Noise Spectrum":
if rad:
trace = ax.loglog(x_rad, y_rad, color=cycle_colors[color], label = filename + str(" [1]"))
lns = lns + trace
# plot dashed normalized trace in same color
if norm_pn != 0:
trace = ax.loglog(x_rad, y_norm_rad, color=cycle_colors[color], linestyle="dashed", label = filename + str(" [1] Normalized"))
lns = lns + trace
else:
trace = ax.semilogx(x, y, color=cycle_colors[color], label = filename + str(" [1]"))
lns = lns + trace
# plot dashed normalized trace in same color
if norm_pn != 0:
trace = ax.semilogx(x, y_norm, color=cycle_colors[color], linestyle="dashed", label = filename + str(" [1] Normalized"))
lns = lns + trace
# plot dashed normalized trace in same color
if norm_pn != 0:
trace = ax.semilogx(x, y_norm, color=cycle_colors[color], linestyle="dashed", label = filename + str(" [1] Normalized"))
lns = lns + trace
else:
trace = ax.plot(x, y, color=cycle_colors[color], label = filename + str(" [1]"))
lns = lns + trace
......@@ -324,8 +335,8 @@ if __name__ == "__main__":
for trace_nr in fswp_data["trace"].keys():
x = fswp_data["trace"][trace_nr][0]
y = fswp_data["trace"][trace_nr][1]
x_rad = fswp_data["trace_rad"][1][0]
y_rad= fswp_data["trace_rad"][1][1]
x_rad = fswp_data["trace_rad"][trace_nr][1][0]
y_rad= fswp_data["trace_rad"][trace_nr][1][1]
if fswp_data["window"] == "Noise Spectrum":
if rad:
trace = ax.loglog(x_rad, y_rad, label = filename + str(" [") + str(trace_nr) + ("]"))
......
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