From a9723a5f3cbfb294626e8698da4f8b21212fcd28 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Wed, 5 Jun 2024 19:06:03 +0200 Subject: [PATCH] use timestamp from sigmf as default --- apps/iridium-extractor | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/iridium-extractor b/apps/iridium-extractor index 2833846..906f0ab 100755 --- a/apps/iridium-extractor +++ b/apps/iridium-extractor @@ -261,6 +261,13 @@ if __name__ == "__main__": fmt = sigmf['global']['core:datatype'] except: print("[sigmf] datatype missing.", file=sys.stderr) + try: + import datetime + dt = datetime.datetime.fromisoformat(sigmf['captures'][0]['core:datetime'].replace("Z", "+00:00")) + if args.file_info is None: + args.file_info = f'i-{dt.timestamp():.20g}-t1' + except: + print("[sigmf] timestamp missing.", file=sys.stderr) if args.sample_rate is not None: sample_rate = args.sample_rate