satpy.tests.writer_tests.test_ninjogeotiff module

Tests for writing GeoTIFF files with NinJoTIFF tags.

satpy.tests.writer_tests.test_ninjogeotiff._get_fake_da(lo, hi, shp, dtype='f4')[source]

Generate dask array with synthetic data.

This is more or less a 2d linspace: it’ll return a 2-d dask array of shape shp, lowest value is lo, highest value is hi.

satpy.tests.writer_tests.test_ninjogeotiff._patch_datetime_now(monkeypatch)[source]

Get a fake datetime.datetime.now().

satpy.tests.writer_tests.test_ninjogeotiff.ntg1(test_image_small_mid_atlantic_L)[source]

Create instance of NinJoTagGenerator class.

satpy.tests.writer_tests.test_ninjogeotiff.ntg2(test_image_large_asia_RGB)[source]

Create instance of NinJoTagGenerator class.

satpy.tests.writer_tests.test_ninjogeotiff.ntg3(test_image_small_arctic_P)[source]

Create instance of NinJoTagGenerator class.

satpy.tests.writer_tests.test_ninjogeotiff.ntg_cmyk(test_image_cmyk_antarctic)[source]

Create NinJoTagGenerator instance with CMYK image.

satpy.tests.writer_tests.test_ninjogeotiff.ntg_latlon(test_image_latlon)[source]

Create NinJoTagGenerator with latlon-area image.

satpy.tests.writer_tests.test_ninjogeotiff.ntg_no_fill_value(test_image_small_mid_atlantic_L)[source]

Create instance of NinJoTagGenerator class.

satpy.tests.writer_tests.test_ninjogeotiff.ntg_northpole(test_image_northpole)[source]

Create NinJoTagGenerator with north pole image.

satpy.tests.writer_tests.test_ninjogeotiff.ntg_rgba(test_image_rgba_merc)[source]

Create NinJoTagGenerator instance with RGBA image.

satpy.tests.writer_tests.test_ninjogeotiff.ntg_weird(test_image_weird)[source]

Create NinJoTagGenerator instance with weird image.

satpy.tests.writer_tests.test_ninjogeotiff.test_area_epsg4326()[source]

Test with EPSG4326 (latlong) area, which has no CRS coordinate operation.

satpy.tests.writer_tests.test_ninjogeotiff.test_area_merc()[source]

Create a mercator area.

satpy.tests.writer_tests.test_ninjogeotiff.test_area_northpole()[source]

Create a 20x10 test area centered exactly on the north pole.

This has no well-defined central meridian so needs separate testing.

satpy.tests.writer_tests.test_ninjogeotiff.test_area_small_eqc_wgs84()[source]

Create 50x100 test equirectangular area centered on (50, 90), wgs84.

satpy.tests.writer_tests.test_ninjogeotiff.test_area_tiny_antarctic()[source]

Create a 20x10 test stereographic area centered near the south pole, wgs84.

satpy.tests.writer_tests.test_ninjogeotiff.test_area_tiny_eqc_sphere()[source]

Create 10x00 test equirectangular area centered on (40, -30), spherical geoid, m.

satpy.tests.writer_tests.test_ninjogeotiff.test_area_tiny_stereographic_wgs84()[source]

Create a 20x10 test stereographic area centered near the north pole, wgs84.

satpy.tests.writer_tests.test_ninjogeotiff.test_area_weird()[source]

Create a weird area (interrupted goode homolosine) to test error handling.

satpy.tests.writer_tests.test_ninjogeotiff.test_calc_single_tag_by_name(ntg1, ntg2, ntg3)[source]

Test calculating single tag from dataset.

satpy.tests.writer_tests.test_ninjogeotiff.test_create_unknown_tags(test_image_small_arctic_P)[source]

Test that unknown tags raise ValueError.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_all_tags(ntg1, ntg3, ntg_latlon, ntg_northpole, caplog)[source]

Test getting all tags from dataset.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_central_meridian(ntg1, ntg2, ntg3, ntg_latlon, ntg_northpole)[source]

Test calculating the central meridian.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_color_depth(ntg1, ntg2, ntg3, ntg_weird, ntg_rgba, ntg_cmyk)[source]

Test extracting the color depth.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_creation_date_id(ntg1, ntg2, ntg3)[source]

Test getting the creation date ID.

This is the time at which the file was created.

This test believes it is run at 2033-5-18 05:33:20Z.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_date_id(ntg1, ntg2, ntg3)[source]

Test getting the date ID.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_earth_radius_large(ntg1, ntg2, ntg3)[source]

Test getting the Earth semi-major axis.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_earth_radius_small(ntg1, ntg2, ntg3)[source]

Test getting the Earth semi-minor axis.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_filename(ntg1, ntg2, ntg3)[source]

Test getting the filename.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_max_gray_value_L(ntg1)[source]

Test getting max gray value for mode L.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_max_gray_value_P(ntg3)[source]

Test getting max gray value for mode P.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_max_gray_value_RGB(ntg2)[source]

Test max gray value for RGB.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_meridian_east(ntg1, ntg2, ntg3)[source]

Test getting east meridian.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_meridian_west(ntg1, ntg2, ntg3)[source]

Test getting west meridian.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_min_gray_value_L(ntg1)[source]

Test getting min gray value for mode L.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_min_gray_value_P(ntg3)[source]

Test getting min gray value for mode P.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_min_gray_value_RGB(ntg2)[source]

Test getting min gray value for RGB.

Note that min/max gray value is mandatory in NinJo even for RGBs?

satpy.tests.writer_tests.test_ninjogeotiff.test_get_projection(ntg1, ntg2, ntg3, ntg_weird, ntg_rgba, ntg_cmyk, ntg_latlon)[source]

Test getting projection string.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_ref_lat_1(ntg1, ntg2, ntg3, ntg_weird, ntg_latlon)[source]

Test getting reference latitude 1.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_ref_lat_2(ntg1, ntg2, ntg3)[source]

Test getting reference latitude 2.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_transparent_pixel(ntg1, ntg2, ntg3, ntg_no_fill_value)[source]

Test getting fill value.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_xmax(ntg1, ntg2, ntg3)[source]

Test getting maximum x.

satpy.tests.writer_tests.test_ninjogeotiff.test_get_ymax(ntg1, ntg2, ntg3)[source]

Test getting maximum y.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_cmyk_antarctic(test_area_tiny_antarctic)[source]

Get a small test image in mode CMYK on south pole.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_large_asia_RGB(test_area_small_eqc_wgs84)[source]

Get a large-ish test image in mode RGB, over Asia.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_latlon(test_area_epsg4326)[source]

Get image with latlon areadefinition.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_northpole(test_area_northpole)[source]

Test image with area exactly on northpole.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_rgba_merc(test_area_merc)[source]

Get a small test image in mode RGBA and mercator.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_small_arctic_P(test_area_tiny_stereographic_wgs84)[source]

Get a small-ish test image in mode P, over Arctic.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_small_mid_atlantic_K_L(test_area_tiny_eqc_sphere)[source]

Get a small test image in units K, mode L, over Atlantic.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_small_mid_atlantic_L(test_area_tiny_eqc_sphere)[source]

Get a small test image in mode L, over Atlantic.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_small_mid_atlantic_L_no_quantity(test_area_tiny_eqc_sphere)[source]

Get a small test image, mode L, over Atlantic, with non-quantitywvalues.

This could be the case, for example, for vis_with_night_ir.

satpy.tests.writer_tests.test_ninjogeotiff.test_image_weird(test_area_weird)[source]

Get a small image with some weird properties to test error handling.

satpy.tests.writer_tests.test_ninjogeotiff.test_str_ids(test_image_small_arctic_P)[source]

Test that channel and satellit IDs can be str.

satpy.tests.writer_tests.test_ninjogeotiff.test_write_and_read_file(test_image_small_mid_atlantic_L, tmp_path)[source]

Test that it writes a GeoTIFF with the appropriate NinJo-tags.

satpy.tests.writer_tests.test_ninjogeotiff.test_write_and_read_file_LA(test_image_latlon, tmp_path)[source]

Test writing and reading LA image.

satpy.tests.writer_tests.test_ninjogeotiff.test_write_and_read_file_P(test_image_small_arctic_P, tmp_path)[source]

Test writing and reading P image.

satpy.tests.writer_tests.test_ninjogeotiff.test_write_and_read_file_RGB(test_image_large_asia_RGB, tmp_path)[source]

Test writing and reading RGB.

satpy.tests.writer_tests.test_ninjogeotiff.test_write_and_read_file_units(test_image_small_mid_atlantic_K_L, tmp_path, caplog)[source]

Test that it writes a GeoTIFF with the appropriate NinJo-tags and units.

satpy.tests.writer_tests.test_ninjogeotiff.test_write_and_read_no_quantity(test_image_small_mid_atlantic_L_no_quantity, tmp_path, unit)[source]

Test that no scale/offset written if no valid units present.

satpy.tests.writer_tests.test_ninjogeotiff.test_write_and_read_via_scene(test_image_small_mid_atlantic_L, tmp_path)[source]

Test that all attributes are written also when writing from scene.

It appears that Satpy.Scene.save_dataset() does not pass the filename to the writer. Test that filename is still written to header when saving this way (the regular way).