class_docstr: Test case for CF writer.
docstr: Test that time dimension is not added on swath data with time already as a coordinate.
docstr_tok: ["Test","that","time","dimension","is","not","added","on","swath","data","with","time","already","as","a","coordinate","."]
code: def test_time_coordinate_on_a_swath(self):
      """Test that time dimension is not added on swath data with time already as a coordinate."""
      scn = Scene()
      test_array = np.array([[1, 2], [3, 4], [5, 6], [7, 8]])
      times = np.array(
          [
              "2018-05-30T10:05:00",
              "2018-05-30T10:05:01",
              "2018-05-30T10:05:02",
              "2018-05-30T10:05:03",
          ],
          dtype="datetime64[ns]",
      )
      scn["test-array"] = xr.DataArray(
          test_array,
          dims=["y", "x"],
          coords={"time": ("y", times)},
          attrs=dict(start_time=times[0], end_time=times[-1]),
      )
      with TempFile() as filename:
          scn.save_datasets(
              filename=filename,
              writer="cf",
              pretty=True,
              encoding={"time": {"units": "seconds since 2018-01-01"}},
          )
          with xr.open_dataset(filename, decode_cf=True) as f:
              np.testing.assert_array_equal(
                  f["time"], scn["test-array"]["time"]
              )
  
imports: import os
  import tempfile
  import warnings
  from datetime import datetime
  import numpy
  import pytest
  import xarray
  from packaging.version import Version
  from satpy import Scene
  from satpy.tests.utils import make_dsq
  from satpy.writers.cf_writer import _get_backend_versions
label_desc: Use image node_id 11 for calling the TestCFWriter obj's underlying member method code with example usage: obj.test_time_coordinate_on_a_swath() without return types