Skip to content

Commit

Permalink
Merge pull request #1035 from lk-iqt/dev-offline
Browse files Browse the repository at this point in the history
File handling for gamutrf-offline
  • Loading branch information
anarkiwi authored Dec 12, 2023
2 parents 9beecf0 + a1b70ad commit 628ac5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gamutrf/offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def main():
options = argument_parser().parse_args()
filename = options.filename
out_dir = os.path.dirname(filename)
if out_dir == "":
out_dir = "."
_data_filename, _samples, meta = get_samples(filename)
freq_start = int(meta["center_frequency"] - (meta["sample_rate"] / 2))
scan_args = {
Expand Down
5 changes: 5 additions & 0 deletions gamutrf/sample_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ def get_samples(filename):

meta = sigmf.sigmffile.fromfile(filename)
data_filename = filename[:meta_ext]
if os.path.splitext(data_filename)[-1] != ".sigmf-data":
data_filename = data_filename + ".sigmf-data"
if not os.path.exists(data_filename):
raise FileNotFoundError(data_filename)

meta.set_data_file(data_filename)
samples = meta.read_samples()
global_meta = meta.get_global_info()
Expand Down

0 comments on commit 628ac5b

Please sign in to comment.