satpy.readers.modis_l1b module

Modis level 1b hdf-eos format reader.

Introduction

The modis_l1b reader reads and calibrates Modis L1 image data in hdf-eos format. Files often have a pattern similar to the following one:

M[O/Y]D02[1/H/Q]KM.A[date].[time].[collection].[processing_time].hdf

Other patterns where “collection” and/or “proccessing_time” are missing might also work (see the readers yaml file for details). Geolocation files (MOD03) are also supported. The IMAPP direct broadcast naming format is also supported with names like: a1.12226.1846.1000m.hdf.

Saturation Handling

Band 2 of the MODIS sensor is available in 250m, 500m, and 1km resolutions. The band data may include a special fill value to indicate when the detector was saturated in the 250m version of the data. When the data is aggregated to coarser resolutions this saturation fill value is converted to a “can’t aggregate” fill value. By default, Satpy will replace these fill values with NaN to indicate they are invalid. This is typically undesired when generating images for the data as they appear as “holes” in bright clouds. To control this the keyword argument mask_saturated can be passed and set to False to set these two fill values to the maximum valid value.

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

Note that the saturation fill value can appear in other bands (ex. bands 7-19) in addition to band 2. Also, the “can’t aggregate” fill value is a generic “catch all” for any problems encountered when aggregating high resolution bands to lower resolutions. Filling this with the max valid value could replace non-saturated invalid pixels with valid values.

Geolocation files

For the 1km data (mod021km) geolocation files (mod03) are optional. If not given to the reader 1km geolocations will be interpolated from the 5km geolocation contained within the file.

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

References

class satpy.readers.modis_l1b.HDFEOSBandReader(filename, filename_info, filetype_info, mask_saturated=True, **kwargs)[source]

Bases: HDFEOSBaseFileReader

Handler for the regular band channels.

Init the file handler.

get_dataset(key, info)[source]

Read data from file and return the corresponding projectables.

res = {'1': 1000, 'H': 500, 'Q': 250}
res_to_possible_variable_names = {250: ['EV_250_RefSB'], 500: ['EV_250_Aggr500_RefSB', 'EV_500_RefSB'], 1000: ['EV_250_Aggr1km_RefSB', 'EV_500_Aggr1km_RefSB', 'EV_1KM_RefSB', 'EV_1KM_Emissive']}
class satpy.readers.modis_l1b.MixedHDFEOSReader(filename, filename_info, filetype_info, **kwargs)[source]

Bases: HDFEOSGeoReader, HDFEOSBandReader

A file handler for the files that have both regular bands and geographical information in them.

Init the file handler.

get_dataset(key, info)[source]

Get the dataset.

satpy.readers.modis_l1b.calibrate_bt(array, attributes, index, band_name)[source]

Calibration for the emissive channels.

satpy.readers.modis_l1b.calibrate_counts(array, attributes, index)[source]

Calibration for counts channels.

satpy.readers.modis_l1b.calibrate_radiance(array, attributes, index)[source]

Calibration for radiance channels.

satpy.readers.modis_l1b.calibrate_refl(array, attributes, index)[source]

Calibration for reflective channels.