satpy.tests.scene_tests.test_resampling module

Unit tests for resampling and crop-related functionality in scene.py.

class satpy.tests.scene_tests.test_resampling.TestSceneAggregation[source]

Bases: object

Test the scene’s aggregate method.

_check_aggregation_results(expected_aggregated_shape, scene1, scene2, x_size, y_size)[source]
static _create_test_data(x_size, y_size)[source]
test_aggregate()[source]

Test the aggregate method.

test_aggregate_with_boundary()[source]

Test aggregation with boundary argument.

test_custom_aggregate()[source]

Test the aggregate method with custom function.

class satpy.tests.scene_tests.test_resampling.TestSceneCrop[source]

Bases: object

Test creating new Scenes by cropping an existing Scene.

test_crop()[source]

Test the crop method.

test_crop_epsg_crs()[source]

Test the crop method when source area uses an EPSG code.

test_crop_rgb()[source]

Test the crop method on multi-dimensional data.

class satpy.tests.scene_tests.test_resampling.TestSceneResampling[source]

Bases: object

Test resampling a Scene to another Scene object.

_fake_resample_dataset(dataset, dest_area, **kwargs)[source]

Return copy of dataset pretending it was resampled.

_fake_resample_dataset_force_20x20(dataset, dest_area, **kwargs)[source]

Return copy of dataset pretending it was resampled to (20, 20) shape.

pytestmark = [Mark(name='usefixtures', args=('include_test_etc',), kwargs={})]
test_comp_loading_after_resampling_existing_sensor()[source]

Test requesting a composite after resampling.

test_comp_loading_after_resampling_new_sensor()[source]

Test requesting a composite after resampling when the sensor composites weren’t loaded before.

test_comp_loading_multisensor_composite_created_user()[source]

Test that multisensor composite can be created manually.

Test that if the user has created datasets “manually”, that multi-sensor composites provided can still be read.

test_comps_need_resampling_optional_mod_deps()[source]

Test that a composite with complex dependencies.

This is specifically testing the case where a compositor depends on multiple resolution prerequisites which themselves are composites. These sub-composites depend on data with a modifier that only has optional dependencies. This is a very specific use case and is the simplest way to present the problem (so far).

The general issue is that the Scene loading creates the “ds13” dataset which already has one modifier on it. The “comp27” composite requires resampling so its 4 prerequisites + the requested “ds13” (from the reader which includes mod1 modifier) remain. If the DependencyTree is not copied properly in this situation then the new Scene object will have the composite dependencies without resolution in its dep tree, but have the DataIDs with the resolution in the dataset dictionary. This all results in the Scene trying to regenerate composite dependencies that aren’t needed which fail.

test_no_generate_comp10(rs)[source]

Test generating a composite after loading.

test_resample_ancillary()[source]

Test that the Scene reducing data does not affect final output.

test_resample_multi_ancillary()[source]

Test that multiple ancillary variables are retained after resampling.

This test corresponds to GH#2329

test_resample_reduce_data()[source]

Test that the Scene reducing data does not affect final output.

test_resample_reduce_data_toggle(rs)[source]

Test that the Scene can be reduced or not reduced during resampling.

test_resample_scene_copy(rs, datasets)[source]

Test that the Scene is properly copied during resampling.

The Scene that is created as a copy of the original Scene should not be able to affect the original Scene object.

test_resample_scene_preserves_requested_dependencies(rs)[source]

Test that the Scene is properly copied during resampling.

The Scene that is created as a copy of the original Scene should not be able to affect the original Scene object.