satpy.enhancements.enhancer module

Helpers to apply enhancements.

class satpy.enhancements.enhancer.EnhancementDecisionTree(*decision_dicts, **kwargs)[source]

Bases: DecisionTree

The enhancement decision tree.

Init the decision tree.

__init__(*decision_dicts, **kwargs)[source]

Init the decision tree.

_get_config_dict_from_user(config_file)[source]
Return type:

dict

_get_yaml_enhancement_dict(config_file)[source]
Return type:

dict

add_config_to_tree(*decision_dict)[source]

Add configuration to tree.

Return type:

None

find_match(**query_dict)[source]

Find a match.

class satpy.enhancements.enhancer.Enhancer(enhancement_config_file=None)[source]

Bases: object

Helper class to get enhancement information for images.

Initialize an Enhancer instance.

Parameters:

enhancement_config_file – The enhancement configuration to apply, False to leave as is.

__init__(enhancement_config_file=None)[source]

Initialize an Enhancer instance.

Parameters:

enhancement_config_file – The enhancement configuration to apply, False to leave as is.

add_sensor_enhancements(sensor)[source]

Add sensor-specific enhancements.

apply(img, **info)[source]

Apply the enhancements.

get_sensor_enhancement_config(sensor)[source]

Get the sensor-specific config.

satpy.enhancements.enhancer.get_enhanced_image(dataset, enhance=None, overlay=None, decorate=None, fill_value=None)[source]

Get an enhanced version of dataset as an XRImage instance.

Parameters:
  • dataset (xarray.DataArray) – Data to be enhanced and converted to an image.

  • enhance (bool or satpy.enhancements.enhancer.Enhancer) – Whether to automatically enhance data to be more visually useful and to fit inside the file format being saved to. By default, this will default to using the enhancement configuration files found using the default Enhancer class. This can be set to False so that no enhancments are performed. This can also be an instance of the Enhancer class if further custom enhancement is needed.

  • overlay (dict) – Options for image overlays. See add_overlay() for available options.

  • decorate (dict) – Options for decorating the image. See add_decorate() for available options.

  • fill_value (int or float) – Value to use when pixels are masked or invalid. Default of None means to create an alpha channel. See finalize() for more details. Only used when adding overlays or decorations. Otherwise it is up to the caller to “finalize” the image before using it except if calling img.show() or providing the image to a writer as these will finalize the image.