satpy.readers.generic_image module

Reader for generic image (e.g. gif, png, jpg, tif, geotiff, …).

Returns a dataset without calibration. Includes coordinates if available in the file (eg. geotiff). If nodata values are present (and rasterio is able to read them), it will be preserved as attribute _FillValue in the returned dataset. In case that nodata values should be used to mask pixels (that have equal values) with np.nan, it has to be enabled in the reader yaml file (key nodata_handling per dataset with value "nan_mask").

class satpy.readers.generic_image.GenericImageFileHandler(filename, filename_info, filetype_info)[source]

Bases: BaseFileHandler

Handle reading of generic image files.

Initialize filehandler.

property end_time

Return end time.

get_area_def(dsid)[source]

Get area definition of the image.

get_dataset(key, info)[source]

Get a dataset from the file.

read()[source]

Read the image.

property start_time

Return start time.

satpy.readers.generic_image._handle_nodatavals(data, nodata_handling)[source]

Mask data with np.nan or only set ‘attr_FillValue’.

satpy.readers.generic_image._mask_image_data(data, info)[source]

Mask image data if necessary.

Masking is done if alpha channel is present or dataset ‘nodata_handling’ is set to ‘nan_mask’. In the latter case even integer data is converted to float32 and masked with np.nan.