Skip to content

Commit

Permalink
Fix instrument name reading from attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
lahtinep committed Mar 13, 2024
1 parent 2ae2935 commit ec09be0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion satpy/readers/viirs_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ def platform_name(self):
@property
def sensor_name(self):
"""Get sensor name."""
return self["/attr/instrument"].lower()
try:
# Until v3r0 (or v3r1)
instrument = self["/attr/instrument_name"].lower()
except KeyError:
# Changed in ASCI v3r1 or v3r2
instrument = self["/attr/instrument"].lower()
return instrument

def _get_dataset_file_units(self, ds_info, var_path):
file_units = ds_info.get("units")
Expand Down

0 comments on commit ec09be0

Please sign in to comment.