class_docstr: Test the implementation of the calibration factors.
class_docstr_tok: ["Test","the","implementation","of","the","calibration","factors","."]
docstr: Test radiance calibration steps.
docstr_tok: ["Test","radiance","calibration","steps","."]
code: def test_radiance_calibration(self, xr_):
      """Test radiance calibration steps."""
      from satpy.readers.slstr_l1b import CHANCALIB_FACTORS
  
      xr_.open_dataset.return_value = self.fake_dataset
  
      ds_id = make_dataid(
          name="foo", calibration="radiance", stripe="a", view="nadir"
      )
      filename_info = {
          "mission_id": "S3A",
          "dataset_name": "foo",
          "start_time": 0,
          "end_time": 0,
          "stripe": "a",
          "view": "n",
      }
  
      test = NCSLSTR1B("somedir/S1_radiance_co.nc", filename_info, "c")
      # Check warning is raised if we don't have calibration
      with pytest.warns(
          UserWarning,
          match=r"No radiance adjustment supplied for channel",
      ):
          test.get_dataset(
              ds_id, dict(filename_info, **{"file_key": "foo"})
          )
  
      # Check user calibration is used correctly
      test = NCSLSTR1B(
          "somedir/S1_radiance_co.nc",
          filename_info,
          "c",
          user_calibration={"foo_nadir": 0.4},
      )
      data = test.get_dataset(
          ds_id, dict(filename_info, **{"file_key": "foo"})
      )
      np.testing.assert_allclose(data.values, self.base_data * 0.4)
  
      # Check internal calibration is used correctly
      ds_id = make_dataid(
          name="S5", calibration="radiance", stripe="a", view="nadir"
      )
      filename_info["dataset_name"] = "S5"
      test = NCSLSTR1B("somedir/S1_radiance_an.nc", filename_info, "c")
      data = test.get_dataset(
          ds_id, dict(filename_info, **{"file_key": "S5"})
      )
      np.testing.assert_allclose(
          data.values, self.base_data * CHANCALIB_FACTORS["S5_nadir"]
      )
  
file_path: satpy/satpy/tests/reader_tests/test_slstr_l1b.py
imports: import unittest
  import unittest.mock
  from datetime import datetime
  import numpy
  import pytest
  import xarray
  from satpy.dataset.dataid import DataID, ModifierTuple, WavelengthRange
  from satpy.readers.slstr_l1b import NCSLSTR1B, NCSLSTRAngles, NCSLSTRFlag, NCSLSTRGeo
label_desc: Use image node_id 1 for calling the TestSLSTRCalibration obj's underlying member method code with example usage: obj.test_radiance_calibration(xr_) without return types