satpy.resample.kdtree module
Resamplers based on the kdtree algorightm.
- class satpy.resample.kdtree.BilinearResampler(source_geo_def, target_geo_def)[source]
Bases:
BaseResamplerResample using bilinear interpolation.
This resampler implements on-disk caching when the cache_dir argument is provided to the resample method. This should provide significant performance improvements on consecutive resampling of geostationary data.
- Parameters:
cache_dir (str) – Long term storage directory for intermediate results.
radius_of_influence (float) – Search radius cut off distance in meters
epsilon (float) – Allowed uncertainty in meters. Increasing uncertainty reduces execution time.
reduce_data (bool) – Reduce the input data to (roughly) match the target area.
Init BilinearResampler.
- compute(data, fill_value=None, **kwargs)[source]
Resample the given data using bilinear interpolation.
- class satpy.resample.kdtree.KDTreeResampler(source_geo_def, target_geo_def)[source]
Bases:
BaseResamplerResample using a KDTree-based nearest neighbor algorithm.
This resampler implements on-disk caching when the cache_dir argument is provided to the resample method. This should provide significant performance improvements on consecutive resampling of geostationary data. It is not recommended to provide cache_dir when the mask keyword argument is provided to precompute which occurs by default for SwathDefinition source areas.
- Parameters:
cache_dir (str) – Long term storage directory for intermediate results.
mask (bool) – Force resampled data’s invalid pixel mask to be used when searching for nearest neighbor pixels. By default this is True for SwathDefinition source areas and False for all other area definition types.
radius_of_influence (float) – Search radius cut off distance in meters
epsilon (float) – Allowed uncertainty in meters. Increasing uncertainty reduces execution time.
Init KDTreeResampler.
- compute(data, weight_funcs=None, fill_value=nan, with_uncert=False, **kwargs)[source]
Resample data.
- load_neighbour_info(cache_dir, mask=None, **kwargs)[source]
Read index arrays from either the in-memory or disk cache.