Skip to content

Commit

Permalink
Refactor channel prefix determination
Browse files Browse the repository at this point in the history
  • Loading branch information
lahtinep committed Feb 27, 2025
1 parent 32a0554 commit 86cb81d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions satpy/readers/nwcsaf_hrw_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ def __del__(self):
def available_datasets(self, configured_datasets=None):
"""Form the names for the available datasets."""
for channel in WIND_CHANNELS:
prefix = channel + "_"
if self.merge_channels:
prefix = ""
prefix = self._get_channel_prefix(channel)
dset = self.h5f[channel]
for measurand in dset.dtype.fields.keys():
if measurand == "trajectory":
Expand All @@ -209,6 +207,11 @@ def available_datasets(self, configured_datasets=None):
if self.merge_channels:
break

def _get_channel_prefix(self, channel):
if self.merge_channels:
return ""
return channel + "_"

def _measurand_ds_info(self, prefix, measurand):
ds_info = {
"file_type": self.filetype_info["file_type"],
Expand Down

0 comments on commit 86cb81d

Please sign in to comment.