Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Nov 27, 2024
1 parent 6fa604d commit da76aef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__/
*.py[cod]
*$py.class


# C extensions
*.so

Expand Down Expand Up @@ -134,3 +135,4 @@ dmypy.json
.bashrc
base_mqtt_pub_sub.py
flycheck_*
dump1090-json/base_mqtt_pub_sub.py
8 changes: 4 additions & 4 deletions dump1090-json/dump1090-json_pub_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _process_response(self) -> None:
data = data[~pd.isna(data.lat)]
data = data.fillna(0.0)
data["request_time"] = request_time
#data["on_ground"] = False
data["on_ground"] = False
data["timestamp"] = float(response["now"]) - data.seen_pos
if "geom_rate" in data.columns:
data['geom_rate'] = data['geom_rate'].astype(float) / 60 * 0.3048
Expand All @@ -131,15 +131,15 @@ def _process_response(self) -> None:
data.loc[data['alt_baro'] == 'ground', 'alt_geom'] = self.ground_level / 0.3048
data['alt_geom'] = data['alt_geom'].astype(float) * 0.3048
if "alt_baro" in data.columns:
#data["on_ground"] = data['alt_baro'] == 'ground'
data["on_ground"] = data['alt_baro'] == 'ground'
#data.loc[data['alt_baro'] == 'ground', 'on_ground'] = True
data.loc[data['alt_baro'] == 'ground', 'alt_baro'] = self.ground_level / 0.3048
data['alt_baro'] = data['alt_baro'].astype(float) * 0.3048
if "gs" in data.columns:
data['gs'] = data['gs'].astype(float) * 0.5144444
if "squawk" in data.columns:
data["squawk"] = data["squawk"].astype(str)
#data["on_ground"] = data["on_ground"].astype(bool)
data["on_ground"] = data["on_ground"].astype(bool)
# TODO: Add in barometric offset to get geometric altitude for those aircraft that do not report it
# tmp = data.loc[data.alt_geom!=0,'hex'][0]
# baro_offset = data.loc[data.hex==tmp,'alt_geom'] - data.loc[data.hex==tmp,'alt_baro']
Expand Down Expand Up @@ -172,7 +172,7 @@ def _process_data(self, inp_data: pd.DataFrame) -> None:
out_data["latitude"] = vld_data.lat.values[0]
out_data["longitude"] = vld_data.lon.values[0]
out_data["altitude"] = vld_data.alt_geom.values[0]
#out_data["on_ground"] = vld_data.on_ground.values[0]
out_data["on_ground"] = bool(vld_data.on_ground.values[0])
out_data["horizontal_velocity"] = vld_data.gs.values[0]
out_data["track"] = float(vld_data.track.values[0])
if "geom_rate" in vld_data.columns and "baro_rate" in vld_data.columns and vld_data.geom_rate.values[0] != 0.0:
Expand Down

0 comments on commit da76aef

Please sign in to comment.