Skip to content

Commit

Permalink
tool to plot canbuses
Browse files Browse the repository at this point in the history
  • Loading branch information
julienguy committed Jul 7, 2020
1 parent eb389f3 commit fc88ddf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bin/plot_canbus
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python

import sys
from desimeter.io import load_metrology
import matplotlib.pyplot as plt
import numpy as np

metro=load_metrology()
if not "BUS_ID" in metro.dtype.names :
print("error, no column BUS_ID in metrology")
sys.exit(12)

busids=np.unique(metro["BUS_ID"])
for bus in busids :
ii=np.where(metro["BUS_ID"]==bus)[0]
x=metro["X_FP"][ii]
y=metro["Y_FP"][ii]
plt.plot(x,y,"o",label="{}".format(bus))
plt.legend()
plt.show()

0 comments on commit fc88ddf

Please sign in to comment.