satpy.composites.core module
Core functionality of composites.
- class satpy.composites.core.CompositeBase(name, prerequisites=None, optional_prerequisites=None, **kwargs)[source]
Bases:
objectBase class for all compositors and modifiers.
A compositor in Satpy is a class that takes in zero or more input DataArrays and produces a new DataArray with its own identifier (name). The result of a compositor is typically a brand new “product” that represents something different than the inputs that went into the operation.
See the
ModifierBaseclass for information on the similar concept of “modifiers”.Initialise the compositor.
- __init__(name, prerequisites=None, optional_prerequisites=None, **kwargs)[source]
Initialise the compositor.
- static align_geo_coordinates(data_arrays)[source]
Align DataArrays along geolocation coordinates.
See
align()for more information. This function uses the “override” join method to essentially ignore differences between coordinates. Thecheck_geolocation()should be called before this to ensure that geolocation coordinates and “area” are compatible. Thedrop_coordinates()method should be called before this to ensure that coordinates that are considered “negligible” when computing composites do not affect alignment.
- apply_modifier_info(origin, destination)[source]
Apply the modifier info from origin to destination.
- check_geolocation(data_arrays)[source]
Check that the geolocations of the data_arrays are compatible.
For the purpose of this method, “compatible” means:
All arrays should have the same dimensions.
Either all arrays should have an area, or none should.
If all have an area, the areas should be all the same.
- Parameters:
- Raises:
IncompatibleAreas – If dimension or areas do not match.
ValueError – If some, but not all data arrays lack an area attribute.
- Return type:
- static drop_coordinates(data_arrays)[source]
Drop negligible non-dimensional coordinates.
Drops negligible coordinates if they do not correspond to any dimension. Negligible coordinates are defined in the
NEGLIGIBLE_COORDSmodule attribute.
- property id
Return the DataID of the object.
- match_data_arrays(data_arrays)[source]
Match data arrays so that they can be used together in a composite.
For the purpose of this method, “can be used together” means:
All arrays should have the same dimensions.
Either all arrays should have an area, or none should.
If all have an area, the areas should be all the same.
In addition, negligible non-dimensional coordinates are dropped (see
drop_coordinates()) and dask chunks are unified (seesatpy.utils.unify_chunks()).- Parameters:
- Return type:
- Returns:
Arrays with negligible non-dimensional coordinates removed.
- Raises:
IncompatibleAreas – If dimension or areas do not match.
ValueError – If some, but not all data arrays lack an area attribute.
- class satpy.composites.core.GenericCompositor(name, common_channel_mask=True, **kwargs)[source]
Bases:
CompositeBaseBasic colored composite builder.
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.
- __init__(name, common_channel_mask=True, **kwargs)[source]
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.
- modes = {1: 'L', 2: 'LA', 3: 'RGB', 4: 'RGBA'}
- exception satpy.composites.core.IncompatibleAreas[source]
Bases:
ExceptionError raised upon compositing things of different shapes.
- exception satpy.composites.core.IncompatibleTimes[source]
Bases:
ExceptionError raised upon compositing things from different times.
- satpy.composites.core.NEGLIGIBLE_COORDS = ['time']
Keywords identifying non-dimensional coordinates to be ignored during composite generation.
- class satpy.composites.core.RGBCompositor(name, common_channel_mask=True, **kwargs)[source]
Bases:
GenericCompositorMake a composite from three color bands (deprecated).
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.core.SingleBandCompositor(name, prerequisites=None, optional_prerequisites=None, **kwargs)[source]
Bases:
CompositeBaseBasic single-band composite builder.
This preserves all the attributes of the dataset it is derived from.
Initialise the compositor.