Commit b7415d20 authored by Paul Brust's avatar Paul Brust
Browse files

basic element plotting

parent 8ff9f9d7
......@@ -16,11 +16,24 @@ def get_floors(data):
return floors
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
def plot_floor(input_data, floor_height, floor_range, error_percentage, offset=0, name=""):
floor_data = input_data.loc[input_data['Z'] < (floor_height + offset + floor_range * error_percentage)]
floor_data = floor_data.loc[floor_data['Z'] > (floor_height + offset - floor_range * error_percentage)]
floor_data.plot.scatter(x="X", y="Y", title=name)
plt.show()
def main():
input_data = pd.read_csv("Scan_1087.csv")
input_data = input_data.loc[input_data['R'] > 50]
floor_heights = get_floors(input_data)
error_percentage = 0.1
floor_range = floor_heights[1] - floor_heights[0]
error_percentage = 0.02
input_data.plot.scatter(x="X", y="Y")
plt.show()
plot_floor(input_data, floor_heights[0], floor_range, error_percentage, name="floor")
plot_floor(input_data, floor_heights[0], floor_range, error_percentage, 1, name="walls")
plot_floor(input_data, floor_heights[1], floor_range, error_percentage, name="ceiling")
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
main()
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