handle when sondehub db doesn't have a frequency listed for recovery ingestion

This commit is contained in:
xssfox 2024-07-28 17:18:27 +10:00
parent 0250d3fc41
commit 66936a691c
2 changed files with 6 additions and 1 deletions

3
.terraform.lock.hcl generated
View File

@ -4,6 +4,7 @@
provider "registry.terraform.io/hashicorp/archive" { provider "registry.terraform.io/hashicorp/archive" {
version = "2.4.0" version = "2.4.0"
hashes = [ hashes = [
"h1:ZtsrX5F13Ohsv/k/BvgyBVn0gF+lW4bkG7JmCGrN35Y=",
"h1:cJokkjeH1jfpG4QEHdRx0t2j8rr52H33A7C/oX73Ok4=", "h1:cJokkjeH1jfpG4QEHdRx0t2j8rr52H33A7C/oX73Ok4=",
"zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594", "zh:18e408596dd53048f7fc8229098d0e3ad940b92036a24287eff63e2caec72594",
"zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b", "zh:392d4216ecd1a1fd933d23f4486b642a8480f934c13e2cae3c13b6b6a7e34a7b",
@ -23,6 +24,7 @@ provider "registry.terraform.io/hashicorp/archive" {
provider "registry.terraform.io/hashicorp/aws" { provider "registry.terraform.io/hashicorp/aws" {
version = "5.22.0" version = "5.22.0"
hashes = [ hashes = [
"h1:4oAjE3Fn/vXruaORPWH1lH7q/+oPEqxNm6+KjOMeMrI=",
"h1:XuU3tsGzElMt4Ti8SsM05pFllNMwSC4ScUxcfsOS140=", "h1:XuU3tsGzElMt4Ti8SsM05pFllNMwSC4ScUxcfsOS140=",
"zh:09b8475cd519c945423b1e1183b71a4209dd2927e0d289a88c5abeecb53c1753", "zh:09b8475cd519c945423b1e1183b71a4209dd2927e0d289a88c5abeecb53c1753",
"zh:2448e0c3ce9b991a5dd70f6a42d842366a6a2460cf63b31fb9bc5d2cc92ced19", "zh:2448e0c3ce9b991a5dd70f6a42d842366a6a2460cf63b31fb9bc5d2cc92ced19",
@ -46,6 +48,7 @@ provider "registry.terraform.io/hashicorp/random" {
version = "3.5.1" version = "3.5.1"
hashes = [ hashes = [
"h1:IL9mSatmwov+e0+++YX2V6uel+dV6bn+fC/cnGDK3Ck=", "h1:IL9mSatmwov+e0+++YX2V6uel+dV6bn+fC/cnGDK3Ck=",
"h1:sZ7MTSD4FLekNN2wSNFGpM+5slfvpm5A/NLVZiB7CO0=",
"zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64", "zh:04e3fbd610cb52c1017d282531364b9c53ef72b6bc533acb2a90671957324a64",
"zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d", "zh:119197103301ebaf7efb91df8f0b6e0dd31e6ff943d231af35ee1831c599188d",
"zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831", "zh:4d2b219d09abf3b1bb4df93d399ed156cadd61f44ad3baf5cf2954df2fba0831",

View File

@ -62,7 +62,9 @@ def findSonde(recovery, lat, lon):
timeDifference = receivedTime - launchTime timeDifference = receivedTime - launchTime
if timeDifference.total_seconds() < 10800: # 3 Hours or less if timeDifference.total_seconds() < 10800: # 3 Hours or less
if value["type"] in sondeType: # Type matches 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 serial = key
return serial return serial