# 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.

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.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.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, **kwargs)

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

pyresample.gradient.is_area_to_area(source_geo_def, target_geo_def)

  Check if source is area and target is area.

pyresample.gradient.is_area_to_swath(source_geo_def, target_geo_def)

  Check if source is area and targed is swath.

pyresample.gradient.is_swath_to_area(source_geo_def, target_geo_def)

  Check if source is swath and target is area.

pyresample.gradient.parallel_gradient_search(data, src_x, src_y, dst_x, dst_y, src_gradient_xl, src_gradient_xp, src_gradient_yl, src_gradient_yp, dst_mosaic_locations, dst_slices, **kwargs)

  Run gradient search in parallel in input area coordinates.