Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File handling for gamutrf-offline #1035

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
options = argument_parser().parse_args()
filename = options.filename
out_dir = os.path.dirname(filename)
if out_dir == "":
out_dir = "."

Check warning on line 148 in gamutrf/offline.py

View check run for this annotation

Codecov / codecov/patch

gamutrf/offline.py#L147-L148

Added lines #L147 - L148 were not covered by tests
_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 @@

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)

Check warning on line 161 in gamutrf/sample_reader.py

View check run for this annotation

Codecov / codecov/patch

gamutrf/sample_reader.py#L158-L161

Added lines #L158 - L161 were not covered by tests

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