Skip to content

Commit

Permalink
Merge pull request #2176 from mraspaud/fix-instrument-cf-writer
Browse files Browse the repository at this point in the history
Fix cf write-read roundtrip
  • Loading branch information
mraspaud committed Aug 29, 2022
2 parents a7cff40 + 66fc9ac commit ff54a74
Show file tree
Hide file tree
Showing 3 changed files with 2,390 additions and 2,342 deletions.
14 changes: 7 additions & 7 deletions satpy/readers/satpy_cf_nc.py
Expand Up @@ -210,16 +210,16 @@ def end_time(self):
"""Get end time."""
return self.filename_info.get('end_time', self.start_time)

@property
def sensor(self):
"""Get sensor."""
nc = xr.open_dataset(self.filename, engine=self.engine)
return nc.attrs['instrument'].replace('/', '-').lower()

@property
def sensor_names(self):
"""Get sensor set."""
return {self.sensor}
sensors = set()
for _, ds_info in self.available_datasets():
try:
sensors.add(ds_info["sensor"])
except KeyError:
continue
return sensors

def available_datasets(self, configured_datasets=None):
"""Add information of available datasets."""
Expand Down

0 comments on commit ff54a74

Please sign in to comment.