satpy.composites.lookup module
Compositors using lookup tables.
- class satpy.composites.lookup.CategoricalDataCompositor(name, lut=None, **kwargs)[source]
Bases:
CompositeBaseCompositor used to recategorize categorical data using a look-up-table.
Each value in the data array will be recategorized to a new category defined in the look-up-table using the original value as an index for that look-up-table.
Example
data = [[1, 3, 2], [4, 2, 0]] lut = [10, 20, 30, 40, 50] res = [[20, 40, 30], [50, 30, 10]]
Get look-up-table used to recategorize data.
- Parameters:
lut (list) – a list of new categories. The lenght must be greater than the maximum value in the data array that should be recategorized.
- class satpy.composites.lookup.ColorizeCompositor(name, common_channel_mask=True, **kwargs)[source]
Bases:
ColormapCompositorA compositor colorizing the data, interpolating the palette colors when needed.
Warning
Deprecated since Satpy 0.39. See the
ColormapCompositordocstring for documentation on the alternative.Collect custom configuration values.
- Parameters:
common_channel_mask (bool) – If True, mask all the channels with a mask that combines all the invalid areas of the given data.
- class satpy.composites.lookup.ColormapCompositor(name, common_channel_mask=True, **kwargs)[source]
Bases:
GenericCompositorA compositor that uses colormaps.
Warning
Deprecated since Satpy 0.39.
This compositor is deprecated. To apply a colormap, use a
satpy.composites.core.SingleBandCompositorcomposite with acolorize()orpalettize()enhancement instead. For example, to make acloud_top_heightcomposite based on a datasetctth_altipalettized byctth_alti_pal, the composite would be:cloud_top_height: compositor: !!python/name:satpy.composites.core.SingleBandCompositor prerequisites: - ctth_alti tandard_name: cloud_top_height
and the enhancement:
cloud_top_height: standard_name: cloud_top_height operations: - name: palettize method: !!python/name:satpy.enhancements.colormap.palettize kwargs: palettes: - dataset: ctth_alti_pal color_scale: 255 min_value: 0 max_value: 255Collect custom configuration values.
- Parameters:
common_channel_mask (bool) – If True, mask all the channels with a mask that combines all the invalid areas of the given data.
- static build_colormap(palette, dtype, info)[source]
Create the colormap from the raw_palette and the valid_range.
Colormaps come in different forms, but they are all supposed to have color values between 0 and 255. The following cases are considered:
Palettes comprised of only a list of colors. If dtype is uint8, the values of the colormap are the enumeration of the colors. Otherwise, the colormap values will be spread evenly from the min to the max of the valid_range provided in info.
Palettes that have a palette_meanings attribute. The palette meanings will be used as values of the colormap.
- class satpy.composites.lookup.PaletteCompositor(name, common_channel_mask=True, **kwargs)[source]
Bases:
ColormapCompositorA compositor colorizing the data, not interpolating the palette colors.
Warning
Deprecated since Satpy 0.39. See the
ColormapCompositordocstring for documentation on the alternative.Collect custom configuration values.
- Parameters:
common_channel_mask (bool) – If True, mask all the channels with a mask that combines all the invalid areas of the given data.