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[source]

Bases: object

Tests for the ‘native’ resampling method.

setup_method()[source]

Create test data used by multiple tests.

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_agg_rechunk()[source]

Test that an incompatible factor for the chunk size is rechunked.

This can happen when a user chunks their data that makes sense for the overall shape of the array and for their local machine’s performance, but the resulting resampling factor does not divide evenly into that chunk size.

test_expand_reduce_aggregate()[source]

Test classmethod ‘expand_reduce’ to aggregate by half.

test_expand_reduce_aggregate_identity()[source]

Test classmethod ‘expand_reduce’ returns the original dask array when factor is 1.

test_expand_reduce_aggregate_invalid(dim0_factor)[source]

Test classmethod ‘expand_reduce’ fails when factor does not divide evenly.

test_expand_reduce_numpy()[source]

Test classmethod ‘expand_reduce’ converts numpy arrays to dask arrays.

test_expand_reduce_replicate()[source]

Test classmethod ‘expand_reduce’ to replicate by 2.

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