class_docstr: Unit tests for SEVIRI netCDF reader.
class_docstr_tok: ["Unit","tests","for","SEVIRI","netCDF","reader","."]
docstr: Create a fake dataset.
  
  Args:
      counts (xr.DataArray):
          Array with data.
      h5netcdf (boolean):
          If True an array attribute will be created which is common
          for the h5netcdf backend in xarray for scalar values.
docstr_tok: ["Create","a","fake","dataset",".","Args",":","counts","(","xr.DataArray",")",":","Array","with","data",".","h5netcdf","(","boolean",")",":","If","True","an","array","attribute","will","be","created","which","is","common","for","the","h5netcdf","backend","in","xarray","for","scalar","values","."]
code: def _get_fake_dataset(self, counts, h5netcdf):
      """Create a fake dataset.
  
      Args:
          counts (xr.DataArray):
              Array with data.
          h5netcdf (boolean):
              If True an array attribute will be created which is common
              for the h5netcdf backend in xarray for scalar values.
  
      """
      acq_time_day = np.repeat([1, 1], 11).reshape(2, 11)
      acq_time_msec = np.repeat([1000, 2000], 11).reshape(2, 11)
      line_validity = np.repeat([3, 3], 11).reshape(2, 11)
      line_geom_radio_quality = np.repeat([4, 4], 11).reshape(2, 11)
      orbit_poly_start_day, orbit_poly_start_msec = to_cds_time(
          np.array(
              [datetime(2019, 12, 31, 18), datetime(2019, 12, 31, 22)],
              dtype="datetime64",
          )
      )
      orbit_poly_end_day, orbit_poly_end_msec = to_cds_time(
          np.array(
              [datetime(2019, 12, 31, 22), datetime(2020, 1, 1, 2)],
              dtype="datetime64",
          )
      )
      counts = counts.rename(
          {"y": "num_rows_vis_ir", "x": "num_columns_vis_ir"}
      )
      scan_time_days, scan_time_msecs = to_cds_time(self.scan_time)
      ds = xr.Dataset(
          {
              "ch1": counts.copy(),
              "ch9": counts.copy(),
              "HRV": (
                  ("num_rows_hrv", "num_columns_hrv"),
                  [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
              ),
              "planned_chan_processing": self.radiance_types,
              "channel_data_visir_data_l10_line_mean_acquisition_time_day": (
                  ("num_rows_vis_ir", "channels_vis_ir_dim"),
                  acq_time_day,
              ),
              "channel_data_visir_data_l10_line_mean_acquisition_msec": (
                  ("num_rows_vis_ir", "channels_vis_ir_dim"),
                  acq_time_msec,
              ),
              "channel_data_visir_data_line_validity": (
                  ("num_rows_vis_ir", "channels_vis_ir_dim"),
                  line_validity,
              ),
              "channel_data_visir_data_line_geometric_quality": (
                  ("num_rows_vis_ir", "channels_vis_ir_dim"),
                  line_geom_radio_quality,
              ),
              "channel_data_visir_data_line_radiometric_quality": (
                  ("num_rows_vis_ir", "channels_vis_ir_dim"),
                  line_geom_radio_quality,
              ),
              "orbit_polynomial_x": (
                  (
                      "orbit_polynomial_dim_row",
                      "orbit_polynomial_dim_col",
                  ),
                  ORBIT_POLYNOMIALS["X"][0:2],
              ),
              "orbit_polynomial_y": (
                  (
                      "orbit_polynomial_dim_row",
                      "orbit_polynomial_dim_col",
                  ),
                  ORBIT_POLYNOMIALS["Y"][0:2],
              ),
              "orbit_polynomial_z": (
                  (
                      "orbit_polynomial_dim_row",
                      "orbit_polynomial_dim_col",
                  ),
                  ORBIT_POLYNOMIALS["Z"][0:2],
              ),
              "orbit_polynomial_start_time_day": (
                  "orbit_polynomial_dim_row",
                  orbit_poly_start_day,
              ),
              "orbit_polynomial_start_time_msec": (
                  "orbit_polynomial_dim_row",
                  orbit_poly_start_msec,
              ),
              "orbit_polynomial_end_time_day": (
                  "orbit_polynomial_dim_row",
                  orbit_poly_end_day,
              ),
              "orbit_polynomial_end_time_msec": (
                  "orbit_polynomial_dim_row",
                  orbit_poly_end_msec,
              ),
          },
          attrs={
              "equatorial_radius": 6378.169,
              "north_polar_radius": 6356.5838,
              "south_polar_radius": 6356.5838,
              "longitude_of_SSP": 0.0,
              "nominal_longitude": -3.5,
              "satellite_id": self.platform_id,
              "true_repeat_cycle_start_day": scan_time_days,
              "true_repeat_cycle_start_mi_sec": scan_time_msecs,
              "planned_repeat_cycle_end_day": scan_time_days,
              "planned_repeat_cycle_end_mi_sec": scan_time_msecs,
              "north_most_line": 3712,
              "east_most_pixel": 1,
              "west_most_pixel": 3712,
              "south_most_line": 1,
              "vis_ir_grid_origin": 0,
              "vis_ir_column_dir_grid_step": 3.0004032,
              "vis_ir_line_dir_grid_step": 3.0004032,
              "type_of_earth_model": "0x02",
              "nominal_image_scanning": "T",
          },
      )
  
      if h5netcdf:
          nattrs = {
              "equatorial_radius": np.array([6378.169]),
              "north_polar_radius": np.array([6356.5838]),
              "south_polar_radius": np.array([6356.5838]),
              "longitude_of_SSP": np.array([0.0]),
              "vis_ir_column_dir_grid_step": np.array([3.0004032]),
              "vis_ir_line_dir_grid_step": np.array([3.0004032]),
          }
  
          ds.attrs.update(nattrs)
  
      ds["ch1"].attrs.update(
          {
              "scale_factor": self.gains_nominal[0],
              "add_offset": self.offsets_nominal[0],
          }
      )
      # IR_108 is dataset with key ch9
      ds["ch9"].attrs.update(
          {
              "scale_factor": self.gains_nominal[8],
              "add_offset": self.offsets_nominal[8],
          }
      )
  
      # Add some attributes so that the reader can strip them
      strip_attrs = {
          "comment": None,
          "long_name": None,
          "valid_min": None,
          "valid_max": None,
      }
      for name in ["ch1", "ch9"]:
          ds[name].attrs.update(strip_attrs)
  
      return ds
  
imports: from datetime import datetime
  from unittest import mock
  import numpy
  import pytest
  import xarray
  from satpy.readers.seviri_l1b_nc import NCSEVIRIFileHandler
  from satpy.tests.reader_tests.test_seviri_base import ORBIT_POLYNOMIALS
  from satpy.tests.reader_tests.test_seviri_l1b_calibration import TestFileHandlerCalibrationBase
  from satpy.tests.utils import assert_attrs_equal, make_dataid
label_desc: Use image node_id 1 for calling the TestNCSEVIRIFileHandler obj's underlying member method code with example usage: obj._get_fake_dataset(counts, h5netcdf) and returns: ds