class_docstr: Test generic image reader.
class_docstr_tok: ["Test","generic","image","reader","."]
docstr: Test reading PNG images via satpy.Scene().
docstr_tok: ["Test","reading","PNG","images","via","satpy.Scene","(",")","."]
code: def test_png_scene(self):
      """Test reading PNG images via satpy.Scene()."""
      from rasterio.errors import NotGeoreferencedWarning
  
      from satpy import Scene
  
      fname = os.path.join(self.base_dir, "test_l.png")
      with pytest.warns(
          NotGeoreferencedWarning, match=r"Dataset has no geotransform"
      ):
          scn = Scene(reader="generic_image", filenames=[fname])
      scn.load(["image"])
      assert scn["image"].shape == (1, self.y_size, self.x_size)
      assert scn.sensor_names == {"images"}
      assert scn.start_time is None
      assert scn.end_time is None
      assert "area" not in scn["image"].attrs
  
      fname = os.path.join(self.base_dir, "20180101_0000_test_la.png")
      with pytest.warns(
          NotGeoreferencedWarning, match=r"Dataset has no geotransform"
      ):
          scn = Scene(reader="generic_image", filenames=[fname])
      scn.load(["image"])
      data = da.compute(scn["image"].data)
      assert scn["image"].shape == (1, self.y_size, self.x_size)
      assert scn.sensor_names == {"images"}
      assert scn.start_time == self.date
      assert scn.end_time == self.date
      assert "area" not in scn["image"].attrs
      assert np.sum(np.isnan(data)) == 100
  
file_path: satpy/satpy/tests/reader_tests/test_generic_image.py
imports: import os
  import unittest
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 3 for calling the TestGenericImage obj's underlying member method code with example usage: obj.test_png_scene() without return types