def plot_resid(d,savename='resfig1.png'):
"""
Plots the residual frequency after the first wipe using the TLE velocity.
"""
flim = [-2.e3, 2.e3]
t = d['tvec']
dates = [dt.datetime.fromtimestamp(ts) for ts in t]
datenums = md.date2num(dates)
xfmt = md.DateFormatter('%Y-%m-%d %H:%M:%S')
fig1 = plt.figure(figsize=(7, 9))
doppler_residual = sp.interpolate.interp1d(d['tvec'],d['dopfit'])
fvec = d["fvec"]
res0 = d["res0"]
res1 = d["res1"]
plt.subplot(211)
mesh = plt.pcolormesh(datenums, fvec, sp.transpose(10.*sp.log10(res0+1e-12)), vmin=-5, vmax=25)
plt.plot(datenums, (150.0/400.0)*doppler_residual(t), "r--", label="doppler resid")
ax = plt.gca()
ax.xaxis.set_major_formatter(xfmt)
plt.ylim(flim)
plt.subplots_adjust(bottom=0.2)
plt.xticks(rotation=25)
plt.xlabel("UTC")
plt.ylabel("Frequency (Hz)")
plt.title("Power ch0 (dB) %1.2f MHz"%(150.012))
plt.legend()
plt.colorbar(mesh, ax=ax)
# quicklook spectra of residuals spectra along with measured Doppler residual from second channel.
plt.subplot(212)
mesh = plt.pcolormesh(datenums, fvec, sp.transpose(10.*sp.log10(res1+1e-12)), vmin=-5, vmax=25)
plt.plot(datenums, doppler_residual(t), "r--", label="doppler resid")
ax = plt.gca()
ax.xaxis.set_major_formatter(xfmt)
plt.ylim(flim)
plt.xlabel("UTC")
plt.ylabel("Frequency (Hz)")
plt.title("Power ch1 (dB), %1.2f MHz"%(400.032))
plt.subplots_adjust(bottom=0.2)
plt.xticks(rotation=25)
plt.legend()
plt.colorbar(mesh, ax=ax)
plt.tight_layout()
print('Saving residual plots: '+savename)
plt.savefig(savename, dpi=300)
plt.close(fig1)
评论列表
文章目录