satpy.tests.test_resample module

Unittests for resamplers.

class satpy.tests.test_resample.TestBilinearResampler(methodName='runTest')[source]

Bases: TestCase

Test the bilinear resampler.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_bil_resampling(xr_resampler, create_filename, move_existing_caches)[source]

Test the bilinear resampler.

test_move_existing_caches()[source]

Test that existing caches are moved to a subdirectory.

class satpy.tests.test_resample.TestBucketAvg(methodName='runTest')[source]

Bases: TestCase

Test the bucket resampler.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Create fake area definitions and resampler to be tested.

test_compute()[source]

Test bucket resampler computation.

test_compute_and_not_use_skipna_handling()[source]

Test bucket resampler computation and not use skipna handling.

test_compute_and_use_skipna_handling()[source]

Test bucket resampler computation and use skipna handling.

test_init()[source]

Test bucket resampler initialization.

test_precompute(bucket)[source]

Test bucket resampler precomputation.

test_resample(pyresample_bucket)[source]

Test bucket resamplers resample method.

class satpy.tests.test_resample.TestBucketCount(methodName='runTest')[source]

Bases: TestCase

Test the count bucket resampler.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Create fake area definitions and resampler to be tested.

test_compute()[source]

Test count bucket resampler computation.

class satpy.tests.test_resample.TestBucketFraction(methodName='runTest')[source]

Bases: TestCase

Test the fraction bucket resampler.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Create fake area definitions and resampler to be tested.

test_compute()[source]

Test fraction bucket resampler computation.

test_resample(pyresample_bucket)[source]

Test fraction bucket resamplers resample method.

class satpy.tests.test_resample.TestBucketSum(methodName='runTest')[source]

Bases: TestCase

Test the sum bucket resampler.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

setUp()[source]

Create fake area definitions and resampler to be tested.

test_compute()[source]

Test sum bucket resampler computation.

test_compute_and_not_use_skipna_handling()[source]

Test bucket resampler computation and not use skipna handling.

test_compute_and_use_skipna_handling()[source]

Test bucket resampler computation and use skipna handling.

class satpy.tests.test_resample.TestCoordinateHelpers(methodName='runTest')[source]

Bases: TestCase

Test various utility functions for working with coordinates.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_area_def_coordinates()[source]

Test coordinates being added with an AreaDefinition.

test_swath_def_coordinates()[source]

Test coordinates being added with an SwathDefinition.

class satpy.tests.test_resample.TestEWAResampler(methodName='runTest')[source]

Bases: TestCase

Test EWA resampler class.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_2d_ewa(get_lonlats, ll2cr, fornav)[source]

Test EWA with a 2D dataset.

test_3d_ewa(get_lonlats, ll2cr, fornav)[source]

Test EWA with a 3D dataset.

class satpy.tests.test_resample.TestHLResample(methodName='runTest')[source]

Bases: TestCase

Test the higher level resampling functions.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_type_preserve()[source]

Check that the type of resampled datasets is preserved.

class satpy.tests.test_resample.TestKDTreeResampler(methodName='runTest')[source]

Bases: TestCase

Test the kd-tree resampler.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_check_numpy_cache(xr_Dataset, np_load)[source]

Test that cache stored in .npz is converted to zarr.

test_kd_resampling(xr_resampler, create_filename, zarr_open, xr_dset, cnc)[source]

Test the kd resampler.

class satpy.tests.test_resample.TestNativeResampler(methodName='runTest')[source]

Bases: TestCase

Tests for the ‘native’ resampling method.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

test_expand_dims()[source]

Test expanding native resampling with 2D data.

test_expand_dims_3d()[source]

Test expanding native resampling with 3D data.

test_expand_reduce()[source]

Test class method ‘expand_reduce’ basics.

test_expand_without_dims()[source]

Test expanding native resampling with no dimensions specified.

test_expand_without_dims_4D()[source]

Test expanding native resampling with 4D data with no dimensions specified.

satpy.tests.test_resample.get_test_data(input_shape=(100, 50), output_shape=(200, 100), output_proj=None, input_dims=('y', 'x'))[source]

Get common data objects used in testing.

Returns

  • input_data_on_area: DataArray with dimensions as if it is a gridded dataset.

  • input_area_def: AreaDefinition of the above DataArray

  • input_data_on_swath: DataArray with dimensions as if it is a swath.

  • input_swath: SwathDefinition of the above DataArray

  • target_area_def: AreaDefinition to be used as a target for resampling

Return type

tuple