Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Feb 9, 2024
1 parent 99809c9 commit 1eeb860
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,32 @@ def base_analysis():
hours_per_model()
per_month()

base_analysis()

def distribution():
x = duckdb.sql(
f"""
INSTALL spatial;
LOAD spatial;
SELECT
epoch("end" - "start") / 60 / 60 AS "flying_time_k_hours"
, ST_Distance(ST_Point(from_lat,from_lon),ST_Point(to_lat,to_lon))
FROM '{PATH}'
USING SAMPLE 10%
"""
).fetchall()

y = [x[1] for x in x]
x = [x[0] for x in x]

plt.figure(figsize=FIG_SIZE)
plt.plot(x, y, '.')
plt.xlabel("Flying time (hours)")
plt.ylabel("Distance (feet)")
plt.grid(linestyle="dotted")
plt.tight_layout()
plt.savefig("results/dist.png", dpi=300)


distribution()

# base_analysis()

0 comments on commit 1eeb860

Please sign in to comment.