satpy.readers.seviri_l2_grib module

Reader for the SEVIRI L2 products in GRIB2 format.

References

FM 92 GRIB Edition 2 https://www.wmo.int/pages/prog/www/WMOCodes/Guides/GRIB/GRIB2_062006.pdf EUMETSAT Product Navigator https://navigator.eumetsat.int/

class satpy.readers.seviri_l2_grib.SeviriL2GribFileHandler(filename, filename_info, filetype_info)[source]

Bases: BaseFileHandler

Reader class for SEVIRI L2 products in GRIB format.

Read the global attributes and prepare for dataset reading.

_get_attributes()[source]

Create a dictionary of attributes to be added to the dataset.

Returns:

A dictionary of parameter attributes.

ssp_lon: longitude of subsatellite point sensor: name of sensor platform_name: name of the platform

Return type:

dict

static _get_from_msg(gid, key)[source]

Get a value from the GRIB message based on the key, return None if missing.

Parameters:
  • gid – The ID of the GRIB message.

  • key – The key of the required attribute.

Returns:

The retrieved attribute or None if the key is missing.

_get_proj_area(gid)[source]

Compute the dictionary with the projection and area definition from a GRIB message.

Parameters:

gid – The ID of the GRIB message.

Returns:

A tuple of two dictionaries for the projection and the area definition.
pdict:

a: Earth major axis [m] b: Earth minor axis [m] h: Height over surface [m] ssp_lon: longitude of subsatellite point [deg] nlines: number of lines ncols: number of columns a_name: name of the area a_desc: description of the area p_id: id of the projection

area_dict:

center_point: coordinate of the center point north: coodinate of the north limit east: coodinate of the east limit west: coodinate of the west limit south: coodinate of the south limit

Return type:

tuple

_get_xarray_from_msg(gid)[source]

Read the values from the GRIB message and return a DataArray object.

Parameters:

gid – The ID of the GRIB message.

Returns:

The array containing the retrieved values.

Return type:

DataArray

_read_attributes(gid)[source]

Read the parameter attributes from the message and create the projection and area dictionaries.

static _scale_earth_axis(data)[source]

Scale Earth axis data to make sure the value matched the expected unit [m].

The earthMinorAxis value stored in the aerosol over sea product is scaled incorrectly by a factor of 1e8. This method provides a flexible temporarily workaraound by making sure that all earth axis values are scaled such that they are on the order of millions of meters as expected by the reader. As soon as the scaling issue has been resolved by EUMETSAT this workaround can be removed.

property end_time

Return the sensing end time.

get_area_def(dataset_id)[source]

Return the area definition for a dataset.

get_dataset(dataset_id, dataset_info)[source]

Get dataset using the parameter_number key in dataset_info.

In a previous version of the reader, the attributes (nrows, ncols, ssp_lon) and projection information (pdict and area_dict) were computed while initializing the file handler. Also the code would break out from the While-loop below as soon as the correct parameter_number was found. This has now been revised becasue the reader would sometimes give corrupt information about the number of messages in the file and the dataset dimensions within a given message if the file was only partly read (not looping over all messages) in an earlier instance.

property start_time

Return the sensing start time.