satpy.dataset.dataid module
Dataset identifying objects.
- class satpy.dataset.dataid.DataID(id_keys, **keyval_dict)[source]
Bases:
dict
Identifier for all DataArray objects.
DataID is a dict that holds identifying and classifying information about a DataArray.
Init the DataID.
The id_keys dictionary has to be formed as described in Satpy internal workings: having a look under the hood. The other keyword arguments are values to be assigned to the keys. Note that None isn’t a valid value and will simply be ignored.
- convert_dict(keyvals)[source]
Convert a dictionary’s values to the types defined in this object’s id_keys.
- classmethod from_dataarray(array, default_keys={'name': {'required': True}, 'resolution': {'transitive': True}})[source]
Get the DataID using the dataarray attributes.
- property id_keys
Get the id_keys.
- class satpy.dataset.dataid.DataQuery(**kwargs)[source]
Bases:
object
The data query object.
A DataQuery can be used in Satpy to query for a Dataset. This way a fully qualified DataID can be found even if some DataID elements are unknown. In this case a * signifies something that is unknown or not applicable to the requested Dataset.
Initialize the query.
Check if dataid shares required keys with the current query.
- sort_dataids(dataids)[source]
Sort the DataIDs based on this query.
Returns the sorted dataids and the list of distances.
The sorting is performed based on the types of the keys to search on (as they are defined in the DataIDs from dataids). If that type defines a distance method, then it is used to find how ‘far’ the DataID is from the current query. If the type is a number, a simple subtraction is performed. For other types, the distance is 0 if the values are identical, np.inf otherwise.
For example, with the default DataID, we use the following criteria:
Central wavelength is nearest to the key wavelength if specified.
Least modified dataset if modifiers is None in key. Otherwise, the modifiers are ignored.
Highest calibration if calibration is None in key. Calibration priority is the order of the calibration list defined as reflectance, brightness temperature, radiance counts if not overridden in the reader configuration.
Best resolution (smallest number) if resolution is None in key. Otherwise, the resolution is ignored.
- class satpy.dataset.dataid.ModifierTuple(iterable=(), /)[source]
Bases:
tuple
A tuple holder for modifiers.
- class satpy.dataset.dataid.ValueList(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
IntEnum
A static value list.
This class is meant to be used for dynamically created Enums. Due to this it should not be used as a normal Enum class or there may be some unexpected behavior. For example, this class contains custom pickling and unpickling handling that may break in subclasses.
- class satpy.dataset.dataid.WavelengthRange(min, central, max, unit='µm')[source]
Bases:
WavelengthRange
A named tuple for wavelength ranges.
The elements of the range are min, central and max values, and optionally a unit (defaults to µm). No clever unit conversion is done here, it’s just used for checking that two ranges are comparable.
Create new instance of WavelengthRange(min, central, max, unit)
- satpy.dataset.dataid._generalize_value_for_comparison(val)[source]
Get a generalize value for comparisons.
- satpy.dataset.dataid.create_filtered_query(dataset_key, filter_query)[source]
Create a DataQuery matching dataset_key and filter_query.
If a property is specified in both dataset_key and filter_query, the former has priority.
- satpy.dataset.dataid.default_co_keys_config = {'name': {'required': True}, 'resolution': {'transitive': True}}
Default ID keys for coordinate DataArrays.
- satpy.dataset.dataid.default_id_keys_config = {'calibration': {'enum': ['reflectance', 'brightness_temperature', 'radiance', 'radiance_wavenumber', 'counts'], 'transitive': True}, 'modifiers': {'default': (), 'type': <class 'satpy.dataset.dataid.ModifierTuple'>}, 'name': {'required': True}, 'resolution': {'transitive': False}, 'wavelength': {'type': <class 'satpy.dataset.dataid.WavelengthRange'>}}
Default ID keys DataArrays.
- satpy.dataset.dataid.get_keys_from_config(common_id_keys, config)[source]
Gather keys for a new DataID from the ones available in configured dataset.
- satpy.dataset.dataid.minimal_default_keys_config = {'name': {'required': True}, 'resolution': {'transitive': True}}
Minimal ID keys for DataArrays, for example composites.
- satpy.dataset.dataid.wlklass
alias of
WavelengthRange