Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions satpy/readers/li_base_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,15 @@ def update_array_attributes(self, data_array, ds_info):

return data_array

def add_orbital_parameters(self, data_array):
"""Hard code the nominal position of the satellite in the orbital parameters attribute."""
logger.debug("Assuming nominal satellite position for LI L2. The exact position is available from FCI L1.")
data_array.attrs["orbital_parameters"] = {"satellite_nominal_longitude": 0.0,
"satellite_nominal_latitude": 0.0,
"satellite_nominal_altitude": 35786400.0
}
Comment on lines +743 to +746
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If at least the satellite number is known from the metadata (is it?) this hardcoded position could be sorted by satellite. MTG-I2 / Meteosat-14 will have a different position.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I didn't think about the fact that other satellite's products would require the use of the LI reader... But it is true that in any case, it would be better to have a more general solution because apparently the same problem holds for any L2 product of the MTG.
However, I am not sure to understand, how does the satellite number can be used to for this application? By writing a dict of satellites containing a dict of nominal position for each satellite?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would have a dict of satellites. Those should rarely change, although if they do, it will cause more of a headache as we would need to cover old and new data.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, when we start moving the MTGs between the nominal, rapid scan , IODC position etc, we'll have a new headache. But maybe by then we can include the information in the file format... So for now a simple dict mapping the platform_name to the satellite_nominal_longitude should be good for a while. Note that the platform_name was added only recently in #2993

return data_array

def get_dataset(self, dataset_id, ds_info=None):
"""Get a dataset."""
# Retrieve default infos if missing:
Expand Down Expand Up @@ -770,5 +779,8 @@ def get_dataset(self, dataset_id, ds_info=None):
# Update the attributes in the final array:
data_array = self.update_array_attributes(data_array, ds_info)

# Add the nominal sat position in attrs orbital parameters
data_array = self.add_orbital_parameters(data_array)

# Return the resulting array:
return data_array
Loading