Skip to content

Commit

Permalink
Review recommendations and assumption about angles
Browse files Browse the repository at this point in the history
  • Loading branch information
mew-nsc committed Dec 16, 2021
1 parent e74e44e commit 928eb23
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions importers/full_shore_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def parse_ownship_state(self, data_store, datafile, line_number, sensor, timesta
state = datafile.create_state(data_store, self.platform, sensor, timestamp, self.short_name)

location = Location(errors=self.errors, error_type=self.error_type)
lat_degs = float(lat_token.text) * (180 / math.pi)
lon_degs = float(lon_token.text) * (180 / math.pi)
lat_degs = math.degrees(float(lat_token.text))
lon_degs = math.degrees(float(lon_token.text))
lat_success = location.set_latitude_decimal_degrees(lat_degs)
lon_success = location.set_longitude_decimal_degrees(lon_degs)
if lat_success and lon_success:
Expand All @@ -168,8 +168,9 @@ def parse_ownship_state(self, data_store, datafile, line_number, sensor, timesta
height_token.record(self.name, "altitude", state.elevation)
if course_token.text:
# TODO - check format of this angle (might be rads)
heading_degs = math.degrees(float(course_token.text))
heading_valid, heading = convert_absolute_angle(
course_token.text, line_number, self.errors, self.error_type
heading_degs, line_number, self.errors, self.error_type
)
if heading_valid:
state.heading = heading
Expand Down Expand Up @@ -228,9 +229,11 @@ def parse_contact(self, data_store, datafile, line_number, sensor, timestamp, to
contact.elevation = elevation
height_token.record(self.name, "altitude", contact.elevation)
if course_token.text:

# TODO - check format of this angle (might be rads)
bearing_degs = math.degrees(float(course_token.text))
bearing_valid, bearing = convert_absolute_angle(
course_token.text, line_number, self.errors, self.error_type
bearing_degs, line_number, self.errors, self.error_type
)
if bearing_valid:
contact.bearing = bearing
Expand Down

0 comments on commit 928eb23

Please sign in to comment.