satpy.readers.modis_l2 module

Modis level 2 hdf-eos format reader.


The modis_l2 reader reads and calibrates Modis L2 image data in hdf-eos format. Since there are a multitude of different level 2 datasets not all of theses are implemented (yet).

Currently the reader supports:
  • m[o/y]d35_l2: cloud_mask dataset

  • some datasets in m[o/y]d06 files

To get a list of the available datasets for a given file refer to the “Load data” section in Reading.

Geolocation files

Similar to the modis_l1b reader the geolocation files (mod03) for the 1km data are optional and if not given 1km geolocations will be interpolated from the 5km geolocation contained within the file.

For the 500m and 250m data geolocation files are needed.


class satpy.readers.modis_l2.ModisL2HDFFileHandler(filename, filename_info, filetype_info, **kwargs)[source]

Bases: HDFEOSGeoReader

File handler for MODIS HDF-EOS Level 2 files.

Includes error handling for files produced by IMAPP produced files.

Initialize the geographical reader.

_extract_and_mask_category_dataset(dataset_id, dataset_info, var_name)[source]
_mask_with_quality_assurance_if_needed(dataset, dataset_info, dataset_id)[source]
_select_hdf_dataset(hdf_dataset_name, byte_dimension)[source]

Load a dataset from HDF-EOS level 2 file.

property end_time

Get the end time of the dataset.

get_dataset(dataset_id, dataset_info)[source]

Get DataArray for specified dataset.

property is_imapp_mask_byte1

Get if this file is the IMAPP ‘mask_byte1’ file type.

static read_geo_resolution(metadata)[source]

Parse metadata to find the geolocation resolution.

It is implemented as a staticmethod to match read_mda pattern.

property start_time

Get the start time of the dataset.

satpy.readers.modis_l2._bits_strip(bit_start, bit_count, value)[source]

Extract specified bit from bit representation of integer value.

  • bit_start (int) – Starting index of the bits to extract (first bit has index 0)

  • bit_count (int) – Number of bits starting from bit_start to extract

  • value (int) – Number from which to extract the bits

  • Returns

  • ------- – int Value of the extracted bits

satpy.readers.modis_l2._extract_byte_mask(dataset, byte_information, bit_start, bit_count)[source]
satpy.readers.modis_l2._extract_two_byte_mask(data_a: ndarray, data_b: ndarray, bit_start: int, bit_count: int) ndarray[source]