File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,11 +132,11 @@ def normalize_string_dtypes(ds: xr.Dataset) -> xr.Dataset:
132132
133133
134134def _get_freq_channel_map (ds : xr .Dataset ) -> dict [float , int ]:
135- """Map frequency_nominal → channel index."""
135+ """Map frequency_nominal → channel index. Skips NaN frequencies. """
136136 if "frequency_nominal" not in ds .coords and "frequency_nominal" not in ds .data_vars :
137137 return {}
138138 freqs = ds ["frequency_nominal" ].values
139- return {float (f ): i for i , f in enumerate (freqs )}
139+ return {float (f ): i for i , f in enumerate (freqs ) if not np . isnan ( f ) }
140140
141141
142142def _clear_encoding (ds : xr .Dataset ) -> xr .Dataset :
@@ -824,7 +824,8 @@ def generate_echograms_for_day(
824824
825825 # Determine which frequencies are available
826826 if "channel" in ds .coords :
827- freq_labels = [str (c ) for c in ds .channel .values ]
827+ freq_labels = [str (c ) for c in ds .channel .values
828+ if "nan" not in str (c ).lower ()]
828829 else :
829830 freq_labels = ["38kHz" ]
830831
You can’t perform that action at this time.
0 commit comments