pyresample.gradient package

Module contents

Implementation of the gradient search algorithm as described by Trishchenko.

pyresample.gradient.GradientSearchResampler(source_geo_def, target_geo_def)

Create a gradient search resampler.

class pyresample.gradient.ResampleBlocksGradientSearchResampler(source_geo_def, target_geo_def)

Bases: BaseResampler

Resample using gradient search based bilinear interpolation, using resample_blocks for lazy processing.

compute(data, method='bilinear', cache_id=None, **kwargs)

Perform the resampling.

precompute(**kwargs)

Precompute resampling parameters.

class pyresample.gradient.StackingGradientSearchResampler(source_geo_def, target_geo_def)

Bases: BaseResampler

Resample using gradient search based bilinear interpolation, using stacking for dask processing.

compute(data, fill_value=None, **kwargs)

Resample the given data using gradient search algorithm.

get_chunk_mappings()

Map source and target chunks together if they overlap.

pyresample.gradient.block_bilinear_interpolator(data, indices_xy, fill_value=nan, block_info=None, **kwargs)

Bilinear interpolation implementation for resample_blocks.

pyresample.gradient.block_nn_interpolator(data, indices_xy, fill_value=nan, block_info=None, **kwargs)

Nearest neighbour ‘interpolator’ for resample_blocks.

pyresample.gradient.check_overlap(src_poly, dst_poly)

Check if the two polygons overlap.

pyresample.gradient.create_gradient_search_resampler(source_geo_def, target_geo_def)

Create a gradient search resampler.

pyresample.gradient.ensure_3d_data(func)

Ensure the data is in three dimensions.

pyresample.gradient.ensure_data_array(func)

Ensure the data is an instance of an xarray.DataArray with correct dimensions.

pyresample.gradient.get_border_lonlats(geo_def: AreaDefinition)

Get the border x- and y-coordinates.

pyresample.gradient.get_polygon(prj, geo_def)

Get border polygon from area definition in projection prj.

pyresample.gradient.gradient_resampler(data, source_area, target_area, method='bilinear')

Do the gradient search resampling.

The input data can be 2d, or 3d with the two last axes being respectively y and x.

pyresample.gradient.gradient_resampler_indices(source_area, target_area, block_info=None, **kwargs)

Do the gradient search resampling, returning the resulting indices.

pyresample.gradient.gradient_resampler_indices_block(block_info=None, **kwargs)

Do the gradient search resampling using block_info for areas, returning the resulting indices.

Run gradient search in parallel in input area coordinates.