pyresample.ewa._legacy_dask_ewa module
EWA algorithms operating on numpy arrays.
- class pyresample.ewa._legacy_dask_ewa.LegacyDaskEWAResampler(source_geo_def, target_geo_def)
Bases:
BaseResamplerResample using an elliptical weighted averaging algorithm.
This algorithm does not use caching or any externally provided data mask (unlike the ‘nearest’ resampler). This algorithm also does not do any special handling of dask arrays and will simply pass entire dask arrays to delayed versions of the EWA algorithm. Use
DaskEWAResamplerfor improved parallel processing which should result in reduced overall memory usage when dask is configured properly.This algorithm works under the assumption that the data is observed one scan line at a time. However, good results can still be achieved for non-scan based data provided rows_per_scan is set to the number of rows in the entire swath or by setting it to None.
- Parameters:
rows_per_scan (int, None) – Number of data rows for every observed scanline. If None then the entire swath is treated as one large scanline.
weight_count (int) – number of elements to create in the gaussian weight table. Default is 10000. Must be at least 2
weight_min (float) – the minimum value to store in the last position of the weight table. Default is 0.01, which, with a weight_distance_max of 1.0 produces a weight of 0.01 at a grid cell distance of 1.0. Must be greater than 0.
weight_distance_max (float) – distance in grid cell units at which to apply a weight of weight_min. Default is 1.0. Must be greater than 0.
weight_delta_max (float) – maximum distance in grid cells in each grid dimension over which to distribute a single swath cell. Default is 10.0.
weight_sum_min (float) – minimum weight sum value. Cells whose weight sums are less than weight_sum_min are set to the grid fill value. Default is EPSILON.
maximum_weight_mode (bool) – If False (default), a weighted average of all swath cells that map to a particular grid cell is used. If True, the swath cell having the maximum weight of all swath cells that map to a particular grid cell is used. This option should be used for coded/category data, i.e. snow cover.
Init EWAResampler.
- __init__(source_geo_def, target_geo_def)
Init EWAResampler.
Wrap fornav() to run as a dask delayed.
- _call_ll2cr(lons, lats, target_geo_def, swath_usage=0)
Wrap ll2cr() for handling dask delayed calls better.
- _get_data_arr(data)
- _get_data_arr_from_xarray(data_arr)
- _get_rows_per_scan(kwargs, data)
- _is_data_arr(data)
- compute(data, cache_id=None, fill_value=0, weight_count=10000, weight_min=0.01, weight_distance_max=1.0, weight_delta_max=10.0, weight_sum_min=-1.0, maximum_weight_mode=False, grid_coverage=0, chunks=None, **kwargs)
Resample the data according to the precomputed X/Y coordinates.
- precompute(cache_dir=None, swath_usage=0, **kwargs)
Generate row and column arrays and store it for later use.
- resample(*args, **kwargs)
Run precompute and compute methods.
Note
This sets the default of ‘mask_area’ to False since it is not needed in EWA resampling currently.