Пример #1
0
                       4, [len(sf_p_0001_cdf_x), len(sf_p_1_cdf_x),len(sf_p_100_cdf_x), len(sf_p_10000_cdf_x)], \
                       ["co-", "b*-", "rp-", "m+-"],
                       ["$s_{P0} =0.0001$", "$s_{P0} =1$",
                        "$s_{P0} =100$", "$s_{P0} =10000$"], 
                       "CDF of position errors", \
                       "Position error ($m$)", "Probability", '', 1, 0, 0, [0,5], 0, [],
                       legend_loc="lower right", fs=FS_PLOT, 
                       if_use_shift=1, x_shift_legend=SHIFT_LEGEND_X-0.2, y_shift_legend=-0.02) 
pdf_P0.savefig(fig)


"""
Statistics
"""
print("")
(mean1, std1,  rms1, d801, d951, max1) = tools.cal_statics(sf_p_0001_err_p_kf)
print("sf_p_0001_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
      %(mean1, rms1, d801, d951, max1))
(mean1, std1,  rms1, d801, d951, max1) = tools.cal_statics(sf_p_1_err_p_kf)
print("sf_p_1_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
      %(mean1, rms1, d801, d951, max1))
(mean1, std1,  rms1, d801, d951, max1) = tools.cal_statics(sf_p_100_err_p_kf)
print("sf_p_100_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
      %(mean1, rms1, d801, d951, max1))
(mean1, std1,  rms1, d801, d951, max1) = tools.cal_statics(sf_p_10000_err_p_kf)
print("sf_p_10000_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
      %(mean1, rms1, d801, d951, max1))
print("")

"""
Close files
    fs=FS_PLOT,
    if_use_shift=1,
    x_shift_legend=SHIFT_LEGEND_X + 0.1)
pdf_BD.savefig(fig)

bd_0_cdf_x, bd_0_cdf_y = tools.cal_cdf(bd_0_err_p_kf)
bd_1_cdf_x, bd_1_cdf_y = tools.cal_cdf(bd_1_err_p_kf)

fig = tools.plot_figure([bd_0_cdf_x, bd_1_cdf_x],
                       [bd_0_cdf_y, bd_1_cdf_y],
                       2, [len(bd_0_cdf_x), len(bd_1_cdf_x)], \
                       ["r*-", "bo-"],
                       ["$e_{p}$ (no BD)","$e_{p}$ (with BD)"],
                       "CDF of position errors", \
                       "Position error ($m$)", "Probability", '', 1, 0, 0, [0,5], 0, [],
                       legend_loc="lower right", fs=FS_PLOT,
                       if_use_shift=1, y_shift_legend=-0.01)
pdf_BD.savefig(fig)
"""
Statistics
"""
(mean1, std1, rms1, d801, d951, max1) = tools.cal_statics(bd_0_err_p_kf)
print("\n bd_0_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m" %
      (mean1, rms1, d801, d951, max1))
(mean1, std1, rms1, d801, d951, max1) = tools.cal_statics(bd_1_err_p_kf)
print("\n bd_1_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m" %
      (mean1, rms1, d801, d951, max1))
"""
Close files
"""
pdf_BD.close()
fig = tools.plot_figure([vrw_0001_cdf_x, vrw_001_cdf_x, vrw_01_cdf_x, vrw_1_cdf_x], 
                       [vrw_0001_cdf_y, vrw_001_cdf_y, vrw_01_cdf_y, vrw_1_cdf_y], 
                       4, [len(vrw_0001_cdf_x), len(vrw_001_cdf_x),len(vrw_01_cdf_x), len(vrw_1_cdf_x)], \
                       ["co-", "b*-", "r+-", "mp-"],
                       ["$q_a=0.001 m/s/\u221A s$","$q_a= 0.01 m/s/\u221A s$","$q_a= 0.1 m/s/\u221A s$", "$q_a= 1 m/s/\u221A s$"], 
                       "CDF of position errors", \
                       "Position error ($m$)", "Probability", '', 1, 0, 0, [0,5], 0, [],
                       legend_loc="lower right", fs=FS_PLOT, 
                       if_use_shift=1, x_shift_legend=SHIFT_LEGEND_X-0.2, y_shift_legend=-0.02) 
pdf_Q_qa.savefig(fig)


"""
Statistics
"""
(mean1, std1,  rms1, d801, d951, max1) = tools.cal_statics(vrw_0001_err_p_kf)
print("\n vrw_0001_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
      %(mean1, rms1, d801, d951, max1))
(mean1, std1,  rms1, d801, d951, max1) = tools.cal_statics(vrw_001_err_p_kf)
print("\n vrw_001_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
      %(mean1, rms1, d801, d951, max1))
(mean1, std1,  rms1, d801, d951, max1) = tools.cal_statics(vrw_01_err_p_kf)
print("\n vrw_01_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
      %(mean1, rms1, d801, d951, max1))
(mean1, std1,  rms1, d801, d951, max1) = tools.cal_statics(vrw_1_err_p_kf)
print("\n vrw_1_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
      %(mean1, rms1, d801, d951, max1))

"""
Close files
"""
Пример #4
0
fig = tools.plot_figure([tau_01_cdf_x, tau_1_cdf_x, tau_10_cdf_x, tau_100_cdf_x],
                       [tau_01_cdf_y, tau_1_cdf_y, tau_10_cdf_y, tau_100_cdf_y],
                       4, [len(tau_01_cdf_x), len(tau_1_cdf_x),len(tau_10_cdf_x), len(tau_100_cdf_x)], \
                       ["co-", "b*-", "rp-", "m+-"],
                       ["$\\tau =0.1 s$", "$\\tau =1 s$",
                        "$\\tau =10 s$", "$\\tau =100 s$"],
                       "CDF of position errors", \
                       "Position error ($m$)", "Probability", '', 1, 0, 0, [0,5], 0, [],
                       legend_loc="lower right", fs=FS_PLOT,
                       if_use_shift=1, x_shift_legend=SHIFT_LEGEND_X-0.2, y_shift_legend=-0.02)
pdf_Q_tau.savefig(fig)
"""
Statistics
"""
(mean1, std1, rms1, d801, d951, max1) = tools.cal_statics(tau_01_err_p_kf)
print(
    "\n tau_01_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m" %
    (mean1, rms1, d801, d951, max1))
(mean1, std1, rms1, d801, d951, max1) = tools.cal_statics(tau_1_err_p_kf)
print(
    "\n tau_1_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m" %
    (mean1, rms1, d801, d951, max1))
(mean1, std1, rms1, d801, d951, max1) = tools.cal_statics(tau_10_err_p_kf)
print(
    "\n tau_10_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m" %
    (mean1, rms1, d801, d951, max1))
(mean1, std1, rms1, d801, d951, max1) = tools.cal_statics(tau_100_err_p_kf)
print(
    "\n tau_100_err_p_kf: mean=%.1f, rms=%.1f, d80=%.1f, d95=%.1f, max=%.1f m"
    % (mean1, rms1, d801, d951, max1))