Skip to content

Commit

Permalink
add rf_bandwidth to ds_ls
Browse files Browse the repository at this point in the history
  • Loading branch information
misko committed Dec 27, 2024
1 parent d4daa92 commit d7adc98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions spf/dataset/spf_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
segment_session,
segment_session_star,
speed_of_light,
torch_circular_mean,
torch_circular_mean_notrim,
torch_get_phase_diff,
torch_pi_norm,
)
Expand Down Expand Up @@ -592,6 +590,9 @@ def __init__(
self.carrier_frequencies = [
receiver["f-carrier"] for receiver in self.yaml_config["receivers"]
]
self.rf_bandwidths = [
receiver["bandwidth"] for receiver in self.yaml_config["receivers"]
]

for rx_idx in range(1, self.n_receivers):
assert (
Expand All @@ -600,6 +601,7 @@ def __init__(
)

assert self.wavelengths[0] == self.wavelengths[rx_idx]
assert self.rf_bandwidths[0] == self.rf_bandwidths[rx_idx]

self.rx_spacing = self.yaml_config["receivers"][0]["antenna-spacing-m"]
self.rx_wavelength_spacing = self.rx_spacing / self.wavelengths[0]
Expand Down
7 changes: 4 additions & 3 deletions spf/scripts/ls_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from spf.dataset.spf_dataset import v5spfdataset

LS_VERSION = 1.0
LS_VERSION = 1.1


def ls_zarr(ds_fn, force=False):
Expand All @@ -28,6 +28,7 @@ def ls_zarr(ds_fn, force=False):
ls_info = {
"ds_fn": ds_fn,
"frequency": ds.carrier_frequencies[0],
"rf_bandwidth": ds.rf_bandwidths[0],
"rx_spacing": ds.rx_spacing,
"samples": len(ds),
"routine": ds.yaml_config["routine"],
Expand Down Expand Up @@ -69,11 +70,11 @@ def ls_zarr(ds_fn, force=False):
# aggregate results
merged_stats = {}
for result in results:
key = f"{result['frequency']},{result['rx_spacing']},{result['routine']}"
key = f"{result['frequency']},{result['rx_spacing']},{result['routine']},{result['rf_bandwidth']}"
if key not in merged_stats:
merged_stats[key] = 0
merged_stats[key] += result["samples"]

print("frequency,rx_spacing,routine,samples")
print("frequency,rx_spacing,routine,rf_bandwidth,samples")
for key in sorted(merged_stats.keys()):
print(f"{key},{merged_stats[key]}")

0 comments on commit d7adc98

Please sign in to comment.