code: def cf_scene():
      """Create a cf scene."""
      tstart = datetime(2019, 4, 1, 12, 0)
      tend = datetime(2019, 4, 1, 12, 15)
      data_visir = np.array([[1, 2], [3, 4]])
      z_visir = [1, 2, 3, 4, 5, 6, 7]
      qual_data = [[1, 2, 3, 4, 5, 6, 7], [1, 2, 3, 4, 5, 6, 7]]
      time_vis006 = [1, 2]
      lat = 33.0 * np.array([[1, 2], [3, 4]])
      lon = -13.0 * np.array([[1, 2], [3, 4]])
  
      proj_dict = {
          "a": 6378169.0,
          "b": 6356583.8,
          "h": 35785831.0,
          "lon_0": 0.0,
          "proj": "geos",
          "units": "m",
      }
      x_size, y_size = data_visir.shape
      area_extent = (
          339045.5577,
          4365586.6063,
          1068143.527,
          4803645.4685,
      )
      area = AreaDefinition(
          "test",
          "test",
          "test",
          proj_dict,
          x_size,
          y_size,
          area_extent,
      )
  
      x, y = area.get_proj_coords()
      y_visir = y[:, 0]
      x_visir = x[0, :]
  
      common_attrs = {
          "start_time": tstart,
          "end_time": tend,
          "platform_name": "tirosn",
          "orbit_number": 99999,
          "area": area,
      }
  
      vis006 = xr.DataArray(
          data_visir,
          dims=("y", "x"),
          coords={
              "y": y_visir,
              "x": x_visir,
              "acq_time": ("y", time_vis006),
          },
          attrs={
              "name": "image0",
              "id_tag": "ch_r06",
              "coordinates": "lat lon",
              "resolution": 1000,
              "calibration": "reflectance",
              "wavelength": WavelengthRange(
                  min=0.58, central=0.63, max=0.68, unit="µm"
              ),
              "orbital_parameters": {
                  "projection_longitude": 1,
                  "projection_latitude": 1,
                  "projection_altitude": 1,
                  "satellite_nominal_longitude": 1,
                  "satellite_nominal_latitude": 1,
                  "satellite_actual_longitude": 1,
                  "satellite_actual_latitude": 1,
                  "satellite_actual_altitude": 1,
                  "nadir_longitude": 1,
                  "nadir_latitude": 1,
                  "only_in_1": False,
              },
          },
      )
  
      ir_108 = xr.DataArray(
          data_visir,
          dims=("y", "x"),
          coords={
              "y": y_visir,
              "x": x_visir,
              "acq_time": ("y", time_vis006),
          },
          attrs={
              "name": "image1",
              "id_tag": "ch_tb11",
              "coordinates": "lat lon",
          },
      )
      qual_f = xr.DataArray(
          qual_data,
          dims=("y", "z"),
          coords={
              "y": y_visir,
              "z": z_visir,
              "acq_time": ("y", time_vis006),
          },
          attrs={"name": "qual_flags", "id_tag": "qual_flags"},
      )
      lat = xr.DataArray(
          lat,
          dims=("y", "x"),
          coords={"y": y_visir, "x": x_visir},
          attrs={
              "name": "lat",
              "standard_name": "latitude",
              "modifiers": np.array([]),
          },
      )
      lon = xr.DataArray(
          lon,
          dims=("y", "x"),
          coords={"y": y_visir, "x": x_visir},
          attrs={
              "name": "lon",
              "standard_name": "longitude",
              "modifiers": np.array([]),
          },
      )
  
      # for prefix testing
      prefix_data = xr.DataArray(
          data_visir,
          dims=("y", "x"),
          coords={"y": y_visir, "x": x_visir},
          attrs={
              "name": "1",
              "id_tag": "ch_r06",
              "coordinates": "lat lon",
              "resolution": 1000,
              "calibration": "reflectance",
              "wavelength": WavelengthRange(
                  min=0.58, central=0.63, max=0.68, unit="µm"
              ),
              "area": area,
          },
      )
  
      # for swath testing
      area = SwathDefinition(lons=lon, lats=lat)
      swath_data = prefix_data.copy()
      swath_data.attrs.update({"name": "swath_data", "area": area})
  
      scene = Scene()
      scene.attrs["sensor"] = ["avhrr-1", "avhrr-2", "avhrr-3"]
      scene_dict = {
          "image0": vis006,
          "image1": ir_108,
          "swath_data": swath_data,
          "1": prefix_data,
          "lat": lat,
          "lon": lon,
          "qual_flags": qual_f,
      }
  
      for key in scene_dict:
          scene[key] = scene_dict[key]
          if key != "swath_data":
              scene[key].attrs.update(common_attrs)
      return scene
  
imports: import warnings
  from datetime import datetime
  import numpy
  import pytest
  import xarray
  from pyresample import AreaDefinition, SwathDefinition
  from satpy import Scene
  from satpy.dataset.dataid import WavelengthRange
  from satpy.readers.satpy_cf_nc import SatpyCFFileHandler
label_desc: Use image node_id 2 for calling a global function with example usage: cf_scene() and returns: scene