satpy.readers.msi_safe module

SAFE MSI L1C reader.

The MSI data has a special value for saturated pixels. By default, these pixels are set to np.inf, but for some applications it might be desirable to have these pixels left untouched. For this case, the mask_saturated flag is available in the reader, and can be toggled with reader_kwargs upon Scene creation:

scene = satpy.Scene(filenames,
                    reader='msi_safe',
                    reader_kwargs={'mask_saturated': False})
scene.load(['B01'])

L1B format description for the files read here:

class satpy.readers.msi_safe.SAFEMSIL1C(filename, filename_info, filetype_info, mda, tile_mda, mask_saturated=True)[source]

Bases: BaseFileHandler

File handler for SAFE MSI files (jp2).

Initialize the reader.

_read_from_file(key)[source]
property end_time

Get the end time.

get_area_def(dsid)[source]

Get the area def.

get_dataset(key, info)[source]

Load a dataset.

property start_time

Get the start time.

class satpy.readers.msi_safe.SAFEMSIMDXML(filename, filename_info, filetype_info, mask_saturated=True)[source]

Bases: SAFEMSIXMLMetadata

File handle for sentinel 2 safe XML generic metadata.

Init the reader.

_band_index(band)[source]
_sanitize_data(data)[source]
property band_indices

Get the band indices from the metadata.

band_offset(band)[source]

Get the band offset for band.

property band_offsets

Get the band offsets from the metadata.

calibrate_to_radiances(data, band_name)[source]

Calibrate data to radiance using the radiometric information for the metadata.

calibrate_to_reflectances(data, band_name)[source]

Calibrate data using the radiometric information for the metadata.

property no_data

Get the nodata value from the metadata.

physical_gain(band_name)[source]

Get the physical gain for a given band_name.

property physical_gains

Get the physical gains dictionary.

property saturated

Get the saturated value from the metadata.

property special_values

Get the special values from the metadata.

class satpy.readers.msi_safe.SAFEMSITileMDXML(filename, filename_info, filetype_info, mask_saturated=True)[source]

Bases: SAFEMSIXMLMetadata

File handle for sentinel 2 safe XML tile metadata.

Init the reader.

_area_extent(resolution)[source]
static _do_interp(minterp, xcoord, ycoord)[source]
_get_coarse_dataset(key, info)[source]

Get the coarse dataset refered to by key from the XML data.

_get_satellite_angles(angles, info)[source]
_get_solar_angles(angles, info)[source]
static _get_values_from_tag(xml_tree, xml_tag)[source]
_shape(resolution)[source]
get_area_def(dsid)[source]

Get the area definition of the dataset.

get_dataset(key, info)[source]

Get the dataset referred to by key.

interpolate_angles(angles, resolution)[source]

Interpolate the angles.

property projection

Get the geographic projection.

class satpy.readers.msi_safe.SAFEMSIXMLMetadata(filename, filename_info, filetype_info, mask_saturated=True)[source]

Bases: BaseFileHandler

Base class for SAFE MSI XML metadata filehandlers.

Init the reader.

property end_time

Get end time.

property start_time

Get start time.

satpy.readers.msi_safe._fill_swath_edges(angles)[source]

Fill gaps at edges of swath.