From 0a5db1164e087c36e04a9152f74627c7c0f4f2c8 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Fri, 16 Aug 2024 01:40:59 -0700 Subject: [PATCH] grab sample_rate and center_freq from filename if missing --- apps/iridium-extractor | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/iridium-extractor b/apps/iridium-extractor index 95ae83c..e4a0e2b 100755 --- a/apps/iridium-extractor +++ b/apps/iridium-extractor @@ -3,6 +3,7 @@ import time import getopt import sys +import re import threading import os.path import argparse @@ -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)