class_docstr: Test the ViiL1bNCFileHandler reader.
class_docstr_tok: ["Test","the","ViiL1bNCFileHandler","reader","."]
docstr: Test the functions.
docstr_tok: ["Test","the","functions","."]
code: def test_functions(self):
      """Test the functions."""
      # Checks that the _perform_orthorectification function is correctly executed
      variable = xr.DataArray(
          dims=("num_lines", "num_pixels"),
          name="test_name",
          attrs={"key_1": "value_1", "key_2": "value_2"},
          data=da.from_array(np.ones((600, 72))),
      )
  
      orthorect_variable = self.reader._perform_orthorectification(
          variable, "data/measurement_data/delta_lat"
      )
      expected_values = np.degrees(
          np.ones((600, 72)) / MEAN_EARTH_RADIUS
      ) + np.ones((600, 72))
      assert np.allclose(orthorect_variable.values, expected_values)
  
      # Checks that the _perform_calibration function is correctly executed in all cases
      # radiance calibration: return value is simply a copy of the variable
      return_variable = self.reader._perform_calibration(
          variable, {"calibration": "radiance"}
      )
      assert np.all(return_variable == variable)
  
      # invalid calibration: raises a ValueError
      with pytest.raises(
          ValueError,
          match="Unknown calibration invalid for dataset test",
      ):
          self.reader._perform_calibration(
              variable, {"calibration": "invalid", "name": "test"}
          )
  
      # brightness_temperature calibration: checks that the return value is correct
      calibrated_variable = self.reader._perform_calibration(
          variable,
          {
              "calibration": "brightness_temperature",
              "chan_thermal_index": 3,
          },
      )
      expected_values = np.full((600, 72), 1101.10413712)
      assert np.allclose(calibrated_variable.values, expected_values)
  
      # reflectance calibration: checks that the return value is correct
      calibrated_variable = self.reader._perform_calibration(
          variable,
          {
              "calibration": "reflectance",
              "wavelength": [0.658, 0.668, 0.678],
              "chan_solar_index": 2,
          },
      )
      expected_values = np.full((600, 72), 173.3181982)
      assert np.allclose(calibrated_variable.values, expected_values)
  
file_path: satpy/satpy/tests/reader_tests/test_vii_l1b_nc.py
imports: import datetime
  import os
  import unittest
  import uuid
  import dask.array
  import numpy
  import pytest
  import xarray
  from netCDF4 import Dataset
  from satpy.readers.vii_l1b_nc import ViiL1bNCFileHandler
  from satpy.readers.vii_utils import MEAN_EARTH_RADIUS
label_desc: Use image node_id 4 for calling the TestViiL1bNCFileHandler obj's underlying member method code with example usage: obj.test_functions() without return types