Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Param regression bug fix #18

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions radp/digital_twin/mobility/param_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ def calculate_distances_and_velocities(group: pd.DataFrame) -> pd.DataFrame:
group["prev_longitude"] = group["lon"].shift(1)
group["prev_latitude"] = group["lat"].shift(1)
group["distance"] = group.apply(
lambda row: GISTools.get_log_distance(
row["prev_latitude"], row["prev_longitude"], row["lat"], row["lon"]
)
if not pd.isna(row["prev_longitude"])
else 0,
axis=1,
)
lambda row: GISTools.dist(
(row["prev_latitude"], row["prev_longitude"]), (row["lat"], row["lon"])
) * 1000 # Multiplying by 1000 to convert km to m
if not pd.isna(row["prev_longitude"]) else 0,
axis=1,
)

# Assuming time interval between ticks is 1 unit, adjust below if different
group["velocity"] = (
group["distance"] / 1
Expand Down
Loading