satpy.tests.reader_tests.gms.test_gms5_vissr_l1b module

Unit tests for GMS-5 VISSR reader.

class satpy.tests.reader_tests.gms.test_gms5_vissr_l1b.TestCorruptFile[source]

Bases: object

Test reading corrupt files.

corrupt_file(file_contents, tmp_path)[source]

Write corrupt VISSR file to disk.

file_contents()[source]

Get corrupt file contents (all zero).

test_corrupt_file(corrupt_file)[source]

Test reading a corrupt file.

class satpy.tests.reader_tests.gms.test_gms5_vissr_l1b.TestEarthMask[source]

Bases: object

Test getting the earth mask.

test_get_earth_mask()[source]

Test getting the earth mask.

class satpy.tests.reader_tests.gms.test_gms5_vissr_l1b.TestFileHandler[source]

Bases: object

Test VISSR file handler.

_patch_number_of_pixels_per_scanline(monkeypatch)[source]

Patch data types so that each scanline has two pixels.

area_def_exp(dataset_id)[source]

Get expected area definition.

attitude_prediction()[source]

Get attitude prediction.

attrs_exp(area_def_exp)[source]

Get expected dataset attributes.

cal_params(vis_calibration, ir1_calibration, ir2_calibration, wv_calibration)[source]

Get calibration parameters.

control_block(dataset_id)[source]

Get VISSR control block.

coord_conv()[source]

Get parameters for coordinate conversions.

Adjust pixel offset so that the first column is at the image center. This has the advantage that we can test with very small 2x2 images. Otherwise, all pixels would be in space.

coordinate_conversion(coord_conv, simple_coord_conv_table)[source]

Get all coordinate conversion parameters.

dataset_exp(dataset_id, ir1_counts_exp, ir1_bt_exp, vis_refl_exp)[source]

Get expected dataset.

dataset_id(request)[source]

Get dataset ID.

file_contents(control_block, image_parameters, image_data)[source]

Get VISSR file contents.

file_handler(vissr_file_like, mask_space)[source]

Get file handler to be tested.

image_data(dataset_id, image_data_ir1, image_data_vis)[source]

Get VISSR image data.

image_data_ir1()[source]

Get IR1 image data.

image_data_vis()[source]

Get VIS image data.

image_parameters(mode_block, cal_params, nav_params)[source]

Get VISSR image parameters.

ir1_bt_exp(lons_lats_exp)[source]

Get expected IR1 brightness temperature.

ir1_calibration()[source]

Get IR1 calibration block.

ir1_counts_exp(lons_lats_exp)[source]

Get expected IR1 counts.

ir2_calibration()[source]

Get IR2 calibration block.

lons_lats_exp(dataset_id)[source]

Get expected lon/lat coordinates.

Computed with JMA’s Msial library for 2 pixels near the central column (6688.5/1672.5 for VIS/IR).

VIS:

pix = [6688, 6688, 6689, 6689] lin = [2744, 8356, 2744, 8356]

IR1:

pix = [1672, 1672, 1673, 1673] lin = [686, 2089, 686, 2089]

mask_space(request)[source]

Mask space pixels.

mode_block()[source]

Get VISSR mode block.

nav_params(coordinate_conversion, attitude_prediction, orbit_prediction)[source]

Get navigation parameters.

open_function(with_compression)[source]

Get open function for writing test files.

orbit_prediction(orbit_prediction_1, orbit_prediction_2)[source]

Get predictions of orbital parameters.

orbit_prediction_1()[source]

Get first block of orbit prediction data.

orbit_prediction_2()[source]

Get second block of orbit prediction data.

simple_coord_conv_table()[source]

Get simple coordinate conversion table.

test_get_dataset(file_handler, dataset_id, dataset_exp, attrs_exp)[source]

Test getting the dataset.

test_time_attributes(file_handler, attrs_exp)[source]

Test the file handler’s time attributes.

vis_calibration()[source]

Get VIS calibration block.

vis_refl_exp(mask_space, lons_lats_exp)[source]

Get expected VIS reflectance.

vissr_file(dataset_id, file_contents, open_function, tmp_path)[source]

Get test VISSR file.

vissr_file_like(vissr_file, with_compression)[source]

Get file-like object for VISSR test file.

with_compression(request)[source]

Enable compression.

wv_calibration()[source]

Get WV calibration block.

class satpy.tests.reader_tests.gms.test_gms5_vissr_l1b.VissrFileWriter(ch_type, open_function)[source]

Bases: object

Write data in VISSR archive format.

Initialize the writer.

Parameters:
  • ch_type – Channel type (VIS or IR)

  • open_function – Open function to be used (e.g. open or gzip.open)

_fill(fd, target_byte)[source]

Write placeholders from current position to target byte.

_write(fd, data, offset=None)[source]

Write data to file.

If specified, prepend with ‘offset’ placeholder bytes.

_write_control_block(fd, contents)[source]
_write_image_data(fd, contents)[source]
_write_image_parameter(fd, im_param, name)[source]
_write_image_parameters(fd, contents)[source]
image_params_order = ['mode', 'coordinate_conversion', 'attitude_prediction', 'orbit_prediction_1', 'orbit_prediction_2', 'vis_calibration', 'ir1_calibration', 'ir2_calibration', 'wv_calibration', 'simple_coordinate_conversion_table']
write(filename, contents)[source]

Write file contents to disk.

satpy.tests.reader_tests.gms.test_gms5_vissr_l1b._disable_jit(request, monkeypatch)[source]

Run tests with jit enabled and disabled.

Reason: Coverage report is only accurate with jit disabled.