1.5.1.1.4.1.1. polar2grid.filters._base module

Base class for all filters.

class polar2grid.filters._base.BaseFilter(product_filter_criteria: Optional[dict] = None)[source]

Bases: object

Base class for filtering products that don’t match certain conditions.

This class uses a series of metadata comparisons to check if a product should be checked for filtering. If any of the product metadata criteria match then filtering checks are continued. Otherwise, the product is ignored. If the criteria is not provided or is None or is empty then no products will be checked. If the criteria is passed as True then all products will be checked.

By default, no extra filtering is performed and only the metadata criteria is used. This means that if no criteria is provided, this class will remove all provided DataArrays.

FILTER_MSG = "Unloading '{}' due to filtering."
_filter_data_array(data_arr: DataArray, _cache: dict)[source]

Check if this DataArray should be removed.

Returns:

True if it meets the condition and does not have enough day data and should therefore be removed. False otherwise meaning it should be kept.

static _iter_scene_coarsest_to_finest_area(scene: Scene)[source]
_matches_criteria(data_arr: DataArray)[source]
filter_scene(scene: Scene)[source]

Create a new Scene with filtered DataArrays removed.