satpy.readers.seviri_l1b_native module

SEVIRI Level 1.5 native format reader.

Introduction

The seviri_l1b_native reader reads and calibrates MSG-SEVIRI L1.5 image data in binary format. The format is explained in the MSG Level 1.5 Native Format File Definition. The files are usually named as follows:

MSG4-SEVI-MSG15-0100-NA-20210302124244.185000000Z-NA.nat

Reader Arguments

Some arguments can be provided to the reader to change its behaviour. These are provided through the Scene instantiation, eg:

scn = Scene(filenames=filenames, reader="seviri_l1b_native", reader_kwargs={'fill_disk': True})

To see the full list of arguments that can be provided, look into the documentation of NativeMSGFileHandler.

Example:

Here is an example how to read the data in satpy.

NOTE: When loading the data, the orientation of the image can be set with upper_right_corner-keyword. Possible options are NW, NE, SW, SE, or native.

from satpy import Scene

filenames = ['MSG4-SEVI-MSG15-0100-NA-20210302124244.185000000Z-NA.nat']
scn = Scene(filenames=filenames, reader='seviri_l1b_native')
scn.load(['VIS006', 'IR_108'], upper_right_corner='NE')
print(scn['IR_108'])

Output:

<xarray.DataArray 'reshape-969ef97d34b7b0c70ca19f53c6abcb68' (y: 3712, x: 3712)>
dask.array<truediv, shape=(3712, 3712), dtype=float32, chunksize=(928, 3712), chunktype=numpy.ndarray>
Coordinates:
    acq_time  (y) datetime64[ns] NaT NaT NaT NaT NaT NaT ... NaT NaT NaT NaT NaT
    crs       object PROJCRS["unknown",BASEGEOGCRS["unknown",DATUM["unknown",...
  * y         (y) float64 -5.566e+06 -5.563e+06 ... 5.566e+06 5.569e+06
  * x         (x) float64 5.566e+06 5.563e+06 5.56e+06 ... -5.566e+06 -5.569e+06
Attributes:
    orbital_parameters:       {'projection_longitude': 0.0, 'projection_latit...
    time_parameters:          {'nominal_start_time': datetime.datetime(2021, ...
    units:                    K
    wavelength:               10.8 µm (9.8-11.8 µm)
    standard_name:            toa_brightness_temperature
    platform_name:            Meteosat-11
    sensor:                   seviri
    georef_offset_corrected:  True
    start_time:               2021-03-02 12:30:11.584603
    end_time:                 2021-03-02 12:45:09.949762
    reader:                   seviri_l1b_native
    area:                     Area ID: msg_seviri_fes_3km\\nDescription: MSG S...
    name:                     IR_108
    resolution:               3000.403165817
    calibration:              brightness_temperature
    modifiers:                ()
    _satpy_id:                DataID(name='IR_108', wavelength=WavelengthRang...
    ancillary_variables:      []

References

class satpy.readers.seviri_l1b_native.ImageBoundaries(header, trailer, mda)[source]

Bases: object

Collect image boundary information.

Initialize the class.

static _check_for_valid_bounds(img_bounds)[source]
static _convert_visir_bound_to_hrv(bound)[source]
_get_hrv_actual_img_bounds()[source]

Get HRV (if not ROI) image boundaries from the ActualL15CoverageHRV information stored in the trailer.

_get_hrv_img_shape()[source]
_get_selected_img_bounds(dataset_id)[source]

Get VISIR and HRV (if ROI) image boundaries from the SelectedRectangle information stored in the header.

_get_visir_img_shape()[source]
get_img_bounds(dataset_id, is_roi)[source]

Get image line and column boundaries.

Returns:

Dictionary with the four keys ‘south_bound’, ‘north_bound’, ‘east_bound’ and ‘west_bound’, each containing a list of the respective line/column numbers of the image boundaries.

Lists (rather than scalars) are returned since the HRV data in FES mode contain data from two windows/areas.

class satpy.readers.seviri_l1b_native.NativeMSGFileHandler(filename, filename_info, filetype_info, calib_mode='nominal', fill_disk=False, ext_calib_coefs=None, include_raw_metadata=False, mda_max_array_size=100)[source]

Bases: BaseFileHandler

SEVIRI native format reader.

Calibration

See satpy.readers.seviri_base.

Padding channel data to full disk

By providing the fill_disk as True in the reader_kwargs, the channel is loaded as full disk, padded with no-data where necessary. This is especially useful for the HRV channel, but can also be used for RSS and ROI data. By default, the original, unpadded, data are loaded:

scene = satpy.Scene(filenames,
                    reader='seviri_l1b_native',
                    reader_kwargs={'fill_disk': False})

Metadata

See satpy.readers.seviri_base.

Initialize the reader.

_add_scanline_acq_time(dataset, dataset_id)[source]

Add scanline acquisition time to the given dataset.

_get_acq_time_hrv()[source]

Get raw acquisition time for HRV channel.

_get_acq_time_visir(dataset_id)[source]

Get raw acquisition time for VIS/IR channels.

_get_calib_coefs(channel_name)[source]

Get coefficients for calibration from counts to radiance.

_get_data_dtype()[source]

Get the dtype of the file based on the actual available channels.

_get_hrv_channel()[source]
_get_orbital_parameters()[source]
_get_visir_channel(dataset_id)[source]
_make_dask_array_with_map_blocks()[source]

Make the dask array using the da.map_blocks() functionality.

_number_of_visir_channels()[source]

Return the number of visir channels, i.e. all channels excluding HRV.

_read_header()[source]

Read the header info.

_read_trailer()[source]
property _repeat_cycle_duration

Get repeat cycle duration from the trailer.

_update_attrs(dataset, dataset_info)[source]

Update dataset attributes.

calibrate(data, dataset_id)[source]

Calibrate the data.

property end_time

Get the general end time for this file.

get_area_def(dataset_id)[source]

Get the area definition of the band.

In general, image data from one window/area is available. For the HRV channel in FES mode, however, data from two windows (‘Lower’ and ‘Upper’) are available. Hence, we collect lists of area-extents and corresponding number of image lines/columns. In case of FES HRV data, two area definitions are computed, stacked and squeezed. For other cases, the lists will only have one entry each, from which a single area definition is computed.

Note that the AreaDefinition area extents returned by this function for Native data will be slightly different compared to the area extents returned by the SEVIRI HRIT reader. This is due to slightly different pixel size values when calculated using the data available in the files. E.g. for the 3 km grid:

Native: data15hd['ImageDescription']['ReferenceGridVIS_IR']['ColumnDirGridStep'] == 3000.4031658172607 HRIT:                            np.deg2rad(2.**16 / pdict['lfac']) * pdict['h'] == 3000.4032785810186

This results in the Native 3 km full-disk area extents being approx. 20 cm shorter in each direction.

The method for calculating the area extents used by the HRIT reader (CFAC/LFAC mechanism) keeps the highest level of numeric precision and is used as reference by EUM. For this reason, the standard area definitions defined in the areas.yaml file correspond to the HRIT ones.

get_area_extent(dataset_id)[source]

Get the area extent of the file.

Until December 2017, the data is shifted by 1.5km SSP North and West against the nominal GEOS projection. Since December 2017 this offset has been corrected. A flag in the data indicates if the correction has been applied. If no correction was applied, adjust the area extent to match the shifted data.

For more information see Section 3.1.4.2 in the MSG Level 1.5 Image Data Format Description. The correction of the area extent is documented in a developer’s memo.

get_dataset(dataset_id, dataset_info)[source]

Get the dataset.

is_roi()[source]

Check if data covers a selected region of interest (ROI).

Standard RSS data consists of 3712 columns and 1392 lines, covering the three northmost segments of the SEVIRI disk. Hence, if the data does not cover the full disk, nor the standard RSS region in RSS mode, it’s assumed to be ROI data.

property nominal_end_time

Get the repeat cycle nominal end time from file header and round it to expected nominal time slot.

property nominal_start_time

Get the repeat cycle nominal start time from file header and round it to expected nominal time slot.

property observation_end_time

Get observation end time from trailer.

property observation_start_time

Get observation start time from trailer.

property satpos

Get actual satellite position in geodetic coordinates (WGS-84).

Evaluate orbit polynomials at the start time of the scan.

Returns: Longitude [deg east], Latitude [deg north] and Altitude [m]

property start_time

Get general start time for this file.

class satpy.readers.seviri_l1b_native.Padder(dataset_id, img_bounds, is_full_disk)[source]

Bases: object

Padding of HRV, RSS and ROI data to full disk.

Initialize the padder.

_extract_data_to_pad(dataset, south_bound, north_bound)[source]

Extract the data that shall be padded.

In case of FES (HRV) data, ‘dataset’ contains data from two separate windows that are padded separately. Hence, we extract a subset of data.

pad_data(dataset)[source]

Pad data to full disk with empty pixels.

satpy.readers.seviri_l1b_native._get_array(filename=None, hdr_size=None, block_info=None)[source]

Get the numpy array for the SEVIRI data.

satpy.readers.seviri_l1b_native.get_available_channels(header)[source]

Get the available channels from the header information.

satpy.readers.seviri_l1b_native.has_archive_header(filename)[source]

Check whether the file includes an ASCII archive header.

satpy.readers.seviri_l1b_native.read_header(filename)[source]

Read SEVIRI L1.5 native header.