예제 #1
0
print("Fitted non linear model: sqrt(({} * HDOP)**2 + {}**2)".format(*hdop_drms_nonlinear))

logging.info("Done")

plot_step = (len(fixes) // arguments.plotted_sample_count) or 1
print("Scatter plots will only use 1/{} samples".format(plot_step))

fig1 = plt.figure()
fixes_plot = fig1.add_subplot(1, 1, 1)
fixes_plot.scatter(x, y, c=hdop, marker=".", s=40, alpha=0.5, edgecolors="none", rasterized=True)
fixes_plot.set_xlabel(r"Easting/\si{\meter}")
fixes_plot.set_ylabel(r"Northing/\si{\meter}")
fixes_plot.set_aspect(1)
fixes_plot.autoscale(tight=True)

matplotlib_settings.common_plot_settings(fixes_plot, set_limits=False)

fig2 = plt.figure()
if arguments.max_plot_hdop is not None:
    max_plot_hdop = arguments.max_plot_hdop
else:
    max_plot_hdop = numpy.max(hdop)

if arguments.max_plot_error is not None:
    max_plot_error = arguments.max_plot_error
else:
    max_plot_error = numpy.max(dist)

hdop_plot = fig2.add_subplot(1, 1, 1)
hdop_plot.scatter(
    hdop[::plot_step],
예제 #2
0
        ('sv_ids', numpy.float),
        ('errors', numpy.float),
    ])

times = data["times"][::arguments.plot_thinning]
sv_ids = (data["sv_ids"] / data["sv_ids"].max())[::arguments.plot_thinning]
errors = data["errors"][::arguments.plot_thinning]

logging.info("Plotting")

error_plot = plt.figure().add_subplot(1, 1, 1)
error_plot.scatter(times, errors, c=sv_ids, marker='.', s=40, alpha=0.7,
    edgecolors='none', rasterized=True)
error_plot.set_title('Measurement error derivation')
error_plot.set_xlabel(r'Time/\si{\second}')
error_plot.set_ylabel(r'Error derivation/\si{\meter\per\second}')
matplotlib_settings.common_plot_settings(error_plot, set_limits=False)

error_histogram = plt.figure().add_subplot(1, 1, 1)
mu, sigma, outliers = matplotlib_settings.plot_hist(error_histogram,
                                                    data['errors'],
                                                    arguments.outlier_threshold)
print("Mean: {}".format(mu))
print("Sigma: {}".format(sigma))
error_histogram.set_title('Measurement errors')
error_histogram.set_xlabel(r'Error/\si{\meter}')
error_histogram.set_ylabel(r'Count')

if not arguments.no_show:
    plt.show()
예제 #3
0
                                                    errors,
                                                    arguments.outlier_threshold)
print("Mean: {}".format(mu))
print("Sigma: {}".format(sigma))
error_histogram.set_title('Measurement errors')
error_histogram.set_xlabel(r'Error/\si{\meter}')
error_histogram.set_ylabel(r'Count')
matplotlib_settings.maybe_save_plot(error_histogram, arguments.save_pseudorange_histogram)

drifts_plot = plt.figure().add_subplot(1, 1, 1)
drifts_plot.plot(times, clock_drifts,
    '-', alpha=0.7)
drifts_plot.set_title('Receiver clock drifts')
drifts_plot.set_xlabel(r'Time/\si{\second}')
drifts_plot.set_ylabel(r'Drift/\si{\meter\per\second}')
matplotlib_settings.common_plot_settings(drifts_plot, set_limits=False)

velocity_plot = plt.figure().add_subplot(1, 1, 1)
velocity_plot.scatter(times,velocity_errors, c=sv_ids, marker='.', s=40, alpha=0.7,
    edgecolors='none', rasterized=True)
velocity_plot.set_title('Velocity errors')
velocity_plot.set_xlabel(r'Time/\si{\second}')
velocity_plot.set_ylabel(r'Error/\si{\meter\per\second}')
matplotlib_settings.common_plot_settings(velocity_plot, set_limits=False)


velocity_error_histogram = plt.figure().add_subplot(1, 1, 1)
mu, sigma, outliers = matplotlib_settings.plot_hist(velocity_error_histogram,
                                                    velocity_errors,
                                                    arguments.velocity_outlier_threshold)
print("Velocity mean: {}".format(mu))
예제 #4
0
res = arguments.hist_resolution
bins = [res * x - (res / 2) for x in range(int(math.floor(max_hdop / res) + 2))]

if arguments.max_plot_hdop is not None:
    max_hdop = arguments.max_plot_hdop

for i, (hdop, label) in enumerate(zip(hdops, arguments.labels)):
    plot = fig.add_subplot(len(hdops), 1, i + 1)
    n, _, _ = plot.hist(hdop, bins=bins, label=label, alpha=0.7)

    plot.set_xlabel("HDOP")
    plot.set_ylabel("Fix count")
    plot.locator_params(axis='x', nbins=20, integer=False)
    matplotlib_settings.common_plot_settings(plot,
        0, max_hdop,
        0, numpy.amax(n))

    if arguments.max_plot_hdop is not None:
        print("Outliers in {}:".format(label))
        for low, high, count in zip(bins[:-1], bins[1:], n):
            if high > max_hdop and count > 0:
                print("{} - {}: {}".format(low, high, count))

# Magic fiddling with sizes to make three histograms fit on a single page.
# Do not look for logic here
w, h = fig.get_size_inches()
height_multiple = 0.6 * len(hdops)
fig.set_size_inches(w, h * height_multiple)
fig.subplots_adjust(
    bottom=matplotlib_settings.m.rcParams['figure.subplot.bottom'] / 2,