Skip to content

Commit

Permalink
handle when sondehub db doesn't have a frequency listed for recovery …
Browse files Browse the repository at this point in the history
…ingestion
  • Loading branch information
xssfox committed Jul 28, 2024
1 parent 0250d3f commit 66936a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lambda/recovery_ingest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def findSonde(recovery, lat, lon):
timeDifference = receivedTime - launchTime
if timeDifference.total_seconds() < 10800: # 3 Hours or less
if value["type"] in sondeType: # Type matches
if abs(float(sondeFrequency) - float(value["frequency"])) < 0.05: # 0.05 MHz or less
if "frequency" in value and abs(float(sondeFrequency) - float(value["frequency"])) < 0.05: # 0.05 MHz or less
serial = key
elif "frequency" not in value: # if frequency not in sondehub db assume its right anyway.
serial = key

return serial
Expand Down

0 comments on commit 66936a6

Please sign in to comment.