From d7adc986949f4906522d785c4fe5831d4f8bef13 Mon Sep 17 00:00:00 2001 From: misko Date: Thu, 26 Dec 2024 17:06:43 -0800 Subject: [PATCH] add rf_bandwidth to ds_ls --- spf/dataset/spf_dataset.py | 6 ++++-- spf/scripts/ls_ds.py | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/spf/dataset/spf_dataset.py b/spf/dataset/spf_dataset.py index 3b9448c..8dae9a9 100644 --- a/spf/dataset/spf_dataset.py +++ b/spf/dataset/spf_dataset.py @@ -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, ) @@ -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 ( @@ -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] diff --git a/spf/scripts/ls_ds.py b/spf/scripts/ls_ds.py index 004027a..9496e7f 100644 --- a/spf/scripts/ls_ds.py +++ b/spf/scripts/ls_ds.py @@ -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): @@ -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"], @@ -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]}")