class_docstr: Test OSI-SAF level 3 netCDF reader ice files.
class_docstr_tok: ["Test","OSI-SAF","level","3","netCDF","reader","ice","files","."]
docstr: Create a fake dataset.
docstr_tok: ["Create","a","fake","dataset","."]
code: def setup_method(self, tester="ice"):
      """Create a fake dataset."""
      base_data = np.array(
          ([-999, 1215, 1125, 11056, 9500], [200, 1, -999, 4215, 5756])
      )
      base_data_ssi = np.array(
          (
              [-999.99, 121.5, 11.25, 110.56, 950.0],
              [200, 1, -999.99, 42.15, 5.756],
          )
      )
      base_data_sst = np.array(
          (
              [-32768, 273.2, 194.2, 220.78, 301.0],
              [-32768, -32768, 273.22, 254.34, 204.21],
          )
      )
      base_data_ssi_geo = np.array(
          (
              [-32768, 121.5, 11.25, 110.56, 950.0],
              [200, 1, -32768, 42.15, 5.756],
          )
      )
      base_data = np.expand_dims(base_data, axis=0)
      base_data_ssi = np.expand_dims(base_data_ssi, axis=0)
      base_data_sst = np.expand_dims(base_data_sst, axis=0)
      unc_data = np.array(([0, 1, 2, 3, 4], [4, 3, 2, 1, 0]))
      yc_data = np.array(([-10, -5, 0, 5, 10], [-10, -5, 0, 5, 10]))
      xc_data = np.array(([-5, -5, -5, -5, -5], [5, 5, 5, 5, 5]))
      time_data = np.array([1.0])
      self.scl = 1.0
      self.add = 0.0
  
      lat_data = np.array(
          ([-68, -69, -70, -71, -72], [-68, -69, -70, -71, -72])
      )
      lon_data = np.array(
          ([-60, -60, -60, -60, -60], [-65, -65, -65, -65, -65])
      )
  
      xc = xr.DataArray(
          xc_data,
          dims=("yc", "xc"),
          attrs={
              "standard_name": "projection_x_coordinate",
              "units": "km",
          },
      )
      yc = xr.DataArray(
          yc_data,
          dims=("yc", "xc"),
          attrs={
              "standard_name": "projection_y_coordinate",
              "units": "km",
          },
      )
      time = xr.DataArray(
          time_data,
          dims="time",
          attrs={
              "standard_name": "projection_y_coordinate",
              "units": "km",
          },
      )
      lat = xr.DataArray(
          lat_data,
          dims=("yc", "xc"),
          attrs={"standard_name": "latitude", "units": "degrees_north"},
      )
      lon = xr.DataArray(
          lon_data,
          dims=("yc", "xc"),
          attrs={"standard_name": "longitude", "units": "degrees_east"},
      )
      conc = xr.DataArray(
          base_data,
          dims=("time", "yc", "xc"),
          attrs={
              "scale_factor": 0.01,
              "add_offset": 0.0,
              "_FillValue": -999,
              "units": "%",
              "valid_min": 0,
              "valid_max": 10000,
              "standard_name": "sea_ice_area_fraction",
          },
      )
      uncert = xr.DataArray(
          unc_data,
          dims=("yc", "xc"),
          attrs={
              "scale_factor": 0.01,
              "add_offset": 0.0,
              "_FillValue": -999,
              "valid_min": 0,
              "valid_max": 10000,
              "standard_name": "total_uncertainty",
          },
      )
      ssi_geo = xr.DataArray(
          base_data_ssi_geo,
          dims=("lat", "lon"),
          attrs={
              "scale_factor": 0.1,
              "add_offset": 0.0,
              "_FillValue": 32768,
              "valid_min": 0.0,
              "valid_max": 1000.0,
              "standard_name": "surface_downwelling_shortwave_flux_in_air",
          },
      )
      ssi = xr.DataArray(
          base_data_ssi,
          dims=("time", "yc", "xc"),
          attrs={
              "_FillValue": -999.99,
              "units": "W m-2",
              "valid_min": 0.0,
              "valid_max": 1000.0,
              "standard_name": "surface_downwelling_shortwave_flux_in_air",
          },
      )
      sst = xr.DataArray(
          base_data_sst,
          dims=("time", "yc", "xc"),
          attrs={
              "scale_factor": 0.01,
              "add_offset": 273.15,
              "_FillValue": -32768,
              "units": "K",
              "valid_min": -8000.0,
              "valid_max": 5000.0,
              "standard_name": "sea_ice_surface_temperature",
          },
      )
      data_vars = {
          "xc": xc,
          "yc": yc,
          "time": time,
          "lat": lat,
          "lon": lon,
      }
  
      if tester == "ice":
          data_vars["Lambert_Azimuthal_Grid"] = ease_ds
          data_vars["Polar_Stereographic_Grid"] = stere_ds
          data_vars["ice_conc"] = conc
          data_vars["total_uncertainty"] = uncert
          self.fake_dataset = xr.Dataset(
              data_vars=data_vars, attrs=attrs_ice
          )
      elif tester == "sst":
          data_vars["Polar_Stereographic_Grid"] = stere_ds
          data_vars["surface_temperature"] = sst
          self.fake_dataset = xr.Dataset(
              data_vars=data_vars, attrs=attrs_ice
          )
      elif tester == "flux_stere":
          data_vars["Polar_Stereographic_Grid"] = stere_ds_noproj
          data_vars["ssi"] = ssi
          self.fake_dataset = xr.Dataset(
              data_vars=data_vars, attrs=attrs_flux
          )
      elif tester == "flux_geo":
          data_vars["ssi"] = ssi_geo
          self.fake_dataset = xr.Dataset(
              data_vars=data_vars, attrs=attrs_geo
          )
  
imports: import os
  from datetime import datetime
  import numpy
  import pytest
  import xarray
  from pyproj import CRS
  from satpy import DataQuery
  from satpy.readers.osisaf_l3_nc import OSISAFL3NCFileHandler
label_desc: Use image node_id 1 for calling the OSISAFL3ReaderTests obj's underlying member method code with example usage: obj.setup_method(tester) without return types