pyresample.gradient package

Submodules

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.

Init GradientResampler.

__init__(source_geo_def, target_geo_def)

Init GradientResampler.

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

Perform the resampling.

precompute(**kwargs)

Precompute resampling parameters.

pyresample.gradient._check_input_coordinates(dst_x, dst_y, src_gradient_xl, src_gradient_xp, src_gradient_yl, src_gradient_yp, src_x, src_y)
pyresample.gradient._concatenate_chunks(chunks)

Concatenate chunks to full output array.

pyresample.gradient._fill_in_coords(target_geo_def, data_coords, data_dims)
pyresample.gradient._get_coordinates_in_same_projection(source_area, target_area)
pyresample.gradient._get_mask_and_adjusted_indices(indices_xy, block_info)

Get a mask for valid data and adjusted x and y indices.

pyresample.gradient._gradient_resample_data(src_data, src_x, src_y, src_gradient_xl, src_gradient_xp, src_gradient_yl, src_gradient_yp, dst_x, dst_y, method='bilinear')

Resample using gradient search.

pyresample.gradient._gradient_resample_indices(src_x, src_y, src_gradient_xl, src_gradient_xp, src_gradient_yl, src_gradient_yp, dst_x, dst_y)

Return indices computed using gradient search.

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.

Run gradient search in parallel in input area coordinates.