satpy.tests.writer_tests.test_cf module

Tests for the CF writer.

class satpy.tests.writer_tests.test_cf.EncodingUpdateTest(methodName='runTest')[source]

Bases: TestCase

Test update of netCDF encoding.

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 data for testing.

test_dataset_name_digit()[source]

Test data with dataset name staring with a digit.

test_with_time()[source]

Test data with a time dimension.

test_without_time()[source]

Test data with no time dimension.

class satpy.tests.writer_tests.test_cf.TempFile(suffix='.nc')[source]

Bases: object

A temporary filename class.

Initialize.

class satpy.tests.writer_tests.test_cf.TestCFWriter(methodName='runTest')[source]

Bases: TestCase

Test case for CF writer.

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.

assertDictWithArraysEqual(d1, d2)[source]

Check that dicts containing arrays are equal.

get_test_attrs()[source]

Create some dataset attributes for testing purpose.

Returns

Attributes, encoded attributes, encoded and flattened attributes

test_ancillary_variables()[source]

Test ancillary_variables cited each other.

test_area2cf()[source]

Test the conversion of an area to CF standards.

test_area2gridmapping()[source]

Test the conversion from pyresample area object to CF grid mapping.

test_area2lonlat()[source]

Test the conversion from areas to lon/lat.

test_assert_xy_unique()[source]

Test that the x and y coordinates are unique.

test_bounds()[source]

Test setting time bounds.

test_bounds_minimum()[source]

Test minimum bounds.

test_bounds_missing_time_info()[source]

Test time bounds generation in case of missing time.

test_collect_datasets(*mocks)[source]

Test collecting CF datasets from a DataArray objects.

test_da2cf()[source]

Test the conversion of a DataArray to a CF-compatible DataArray.

test_encode_attrs_nc()[source]

Test attributes encoding.

test_encoding_kwarg()[source]

Test ‘encoding’ keyword argument.

test_global_attr_default_history_and_Conventions()[source]

Test saving global attributes history and Conventions.

test_global_attr_history_and_Conventions()[source]

Test saving global attributes history and Conventions.

test_groups()[source]

Test creating a file with groups.

test_header_attrs()[source]

Check global attributes are set.

test_init()[source]

Test initializing the CFWriter class.

Check that coordinates link has been established correctly.

test_load_module_with_old_pyproj()[source]

Test that cf_writer can still be loaded with pyproj 1.9.6.

test_make_alt_coords_unique()[source]

Test that created coordinate variables are unique.

test_save_array()[source]

Test saving an array to netcdf/cf.

test_save_array_coords()[source]

Test saving array with coordinates.

test_save_dataset_a_digit()[source]

Test saving an array to netcdf/cf where dataset name starting with a digit.

test_save_dataset_a_digit_no_prefix_include_attr()[source]

Test saving an array to netcdf/cf dataset name starting with a digit with no prefix include orig name.

test_save_dataset_a_digit_prefix()[source]

Test saving an array to netcdf/cf where dataset name starting with a digit with prefix.

test_save_dataset_a_digit_prefix_include_attr()[source]

Test saving an array to netcdf/cf where dataset name starting with a digit with prefix include orig name.

test_save_with_compression()[source]

Test saving an array with compression.

test_single_time_value()[source]

Test setting a single time value.

test_time_coordinate_on_a_swath()[source]

Test that time dimension is not added on swath data with time already as a coordinate.

test_unlimited_dims_kwarg()[source]

Test specification of unlimited dimensions.

class satpy.tests.writer_tests.test_cf.TestCFWriterData(methodName='runTest')[source]

Bases: TestCase

Test case for CF writer where data arrays are needed.

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 some test data.

test_collect_datasets_with_latitude_named_lat(*mocks)[source]

Test collecting CF datasets with latitude named lat.

test_dataset_is_projection_coords()[source]

Test the dataset_is_projection_coords function.

test_has_projection_coords()[source]

Test the has_projection_coords function.