class_docstr: Unit tests for SEVIRI netCDF reader.
class_docstr_tok: ["Unit","tests","for","SEVIRI","netCDF","reader","."]
docstr: Test the calibration.
docstr_tok: ["Test","the","calibration","."]
code: def test_calibrate(
      self, file_handler, channel, calibration, use_ext_coefs
  ):
      """Test the calibration."""
      external_coefs = self.external_coefs if use_ext_coefs else {}
      expected = self._get_expected(
          channel=channel,
          calibration=calibration,
          calib_mode="NOMINAL",
          use_ext_coefs=use_ext_coefs,
      )
      fh = file_handler
      fh.ext_calib_coefs = external_coefs
      dataset_id = make_dataid(name=channel, calibration=calibration)
  
      key = channel_keys_dict[channel]
  
      res = fh.calibrate(fh.nc[key], dataset_id)
      xr.testing.assert_allclose(res, expected)
  
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 4 for calling the TestNCSEVIRIFileHandler obj's underlying member method code with example usage: obj.test_calibrate(file_handler, channel, calibration, use_ext_coefs) without return types