class_docstr: Testing the file handler.
class_docstr_tok: ["Testing","the","file","handler","."]
docstr: Test IR calibration.
code: def test_calibrate_ir(self):
      """Test IR calibration."""
      # Test radiance values and corresponding BT from NOAA lookup tables
      # rev. H (see [IR]).
      rad = {
          "03_9": xr.DataArray([0, 0.1, 2, 3.997, 4.199]),
          "06_5": xr.DataArray([0, 0.821, 12.201, 25.590, 100]),
          "10_7": xr.DataArray([0, 11.727, 101.810, 189.407, 192.658]),
          "13_3": xr.DataArray([0, 22.679, 90.133, 182.001, 500]),
      }
      bt_expected = {
          "03_9": np.array(
              [
                  [np.nan, 253.213, 319.451, 339.983, np.nan],
                  [np.nan, 253.213, 319.451, 339.983, np.nan],
              ]
          ),
          "06_5": np.array(
              [
                  [np.nan, 200.291, 267.860, 294.988, np.nan],
                  [np.nan, 200.308, 267.879, 295.008, np.nan],
              ]
          ),
          "10_7": np.array(
              [
                  [np.nan, 200.105, 294.437, 339.960, np.nan],
                  [np.nan, 200.097, 294.429, 339.953, np.nan],
              ]
          ),
          "13_3": np.array(
              [
                  [np.nan, 200.006, 267.517, 321.986, np.nan],
                  [np.nan, 200.014, 267.524, 321.990, np.nan],
              ]
          ),
      }  # first row is for detector 1, second for detector 2.
  
      # The accuracy of the input radiance is limited to 3 digits so that
      # the results differ slightly.
      atol = {"03_9": 0.04, "06_5": 0.03, "10_7": 0.01, "13_3": 0.01}
  
      for ch in sorted(rad.keys()):
          coefs = self.coefs[ch]
          for det in [0, 1]:
              bt = self.reader._calibrate_ir(
                  radiance=rad[ch],
                  coefs={
                      "a": coefs["a"][det],
                      "b": coefs["b"][det],
                      "n": coefs["n"][det],
                      "btmin": coefs["btmin"],
                      "btmax": coefs["btmax"],
                  },
              )
              assert np.allclose(
                  bt.data,
                  bt_expected[ch][det],
                  equal_nan=True,
                  atol=atol[ch],
              ), f"Incorrect conversion from radiance to brightness temperature in channel {ch} detector {det}"
  
imports: import datetime
  import unittest
  from unittest import mock
  import numpy
  import pytest
  import xarray
  from pyresample.geometry import AreaDefinition
  from satpy.readers.goes_imager_nc import is_vis_channel
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 7 for calling the GOESNCBaseFileHandlerTest obj's underlying member method code with example usage: obj.test_calibrate_ir() without return types