Skip to content

Commit

Permalink
Refactor storing shared info
Browse files Browse the repository at this point in the history
  • Loading branch information
lahtinep committed Jun 14, 2024
1 parent 90fd3f8 commit 21a5bcc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions satpy/readers/fci_l1c_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@
"grid_width": 5568},
}

NONSHAREABLE_VARIABLE_ENDINGS = [
"index",
"time",
"measured/effective_radiance",
"measured/y",
"position_row",
"index_map",
"pixel_quality"]


def _get_aux_data_name_from_dsname(dsname):
aux_data_name = [key for key in AUX_DATA.keys() if key in dsname]
Expand Down Expand Up @@ -717,16 +726,10 @@ def _recycle_shared_info(self, listed_variables, filetype_info):
return listed_variables

def _store_shared_info(self, filetype_info):
nonshareable = ["index", "time"]
if "shared_info" not in filetype_info:
shared_info = {}
for key in self.file_content:
if (key in nonshareable or
"measured/effective_radiance" in key or
"measured/y" in key or
"start_position" in key or
"measured/index_map" in key or
"measured/pixel_quality" in key):
if any(key.endswith(k) for k in NONSHAREABLE_VARIABLE_ENDINGS):
continue
shared_info[key] = self.file_content[key]
filetype_info["shared_info"] = shared_info
Expand Down

0 comments on commit 21a5bcc

Please sign in to comment.