Skip to content

Commit

Permalink
grab sample_rate and center_freq from filename if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Sec42 committed Aug 16, 2024
1 parent 0ddc285 commit 0a5db11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/iridium-extractor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import time
import getopt
import sys
import re
import threading
import os.path
import argparse
Expand Down Expand Up @@ -291,6 +292,13 @@ if __name__ == "__main__":
else:
args.file_info = ''

# grab things from filename as fallback
if sample_rate is None and (g := re.search(r"-s(\d+(\.\d+)?(e[+-]\d+)?)-", filename)):
sample_rate = int(float(g.group(1)))

if center is None and (g := re.search(r"-f(\d+(\.\d+)?(e[+-]\d+)?)-", filename)):
center = int(float(g.group(1)))

if sample_rate == None:
print("Sample rate missing!", file=sys.stderr)
exit(1)
Expand Down

0 comments on commit 0a5db11

Please sign in to comment.