satpy.dataset.metadata module
Utilities for merging metadata from various sources.
- satpy.dataset.metadata._all_arrays_equal(arrays)[source]
Check if the arrays are equal.
If the arrays are lazy, just check if they have the same identity.
- satpy.dataset.metadata._all_identical(values)[source]
Check that the identities of all values are the same.
- satpy.dataset.metadata._all_list_of_arrays_equal(array_lists)[source]
Check that the lists of arrays are equal.
- satpy.dataset.metadata._dict_equal(d1, d2)[source]
Check that two dictionaries are equal.
Nested dictionaries are flattened to facilitate comparison.
- satpy.dataset.metadata._filter_time_values(values)[source]
Remove values that are not datetime objects.
- satpy.dataset.metadata._get_valid_dicts(metadata_objects)[source]
Get the valid dictionaries matching the metadata_objects.
- satpy.dataset.metadata.average_datetimes(datetime_list)[source]
Average a series of datetime objects.
Note
This function assumes all datetime objects are naive and in the same time zone (UTC).
- Parameters:
datetime_list (iterable) – Datetime objects to average
Returns: Average datetime as a datetime object
- satpy.dataset.metadata.combine_metadata(*metadata_objects, average_times=None)[source]
Combine the metadata of two or more Datasets.
If the values corresponding to any keys are not equal or do not exist in all provided dictionaries then they are not included in the returned dictionary.
All values of the keys containing the substring ‘start_time’ will be set to the earliest value and similarly for ‘end_time’ to latest time. All other keys containing the word ‘time’ are averaged. Before these adjustments, None values resulting from data that don’t have times associated to them are removed. These rules are applied also to values in the ‘time_parameters’ dictionary.
Changed in version 0.47: Before Satpy 0.47, all times, including start_time and end_time, were averaged.
In the interest of processing time, lazy arrays are compared by object identity rather than by their contents.
- Parameters:
*metadata_objects – MetadataObject or dict objects to combine
- Kwargs:
average_times (bool): Removed option to average all time attributes.
- Returns:
the combined metadata
- Return type: