class_docstr: Test the NIR Emissive part from reflectance compositor.
docstr: Test the NIR emissive part from reflectance compositor.
docstr_tok: ["Test","the","NIR","emissive","part","from","reflectance","compositor","."]
code: def test_compositor(self, calculator, apply_modifier_info, sza):
      """Test the NIR emissive part from reflectance compositor."""
      from satpy.modifiers.spectral import NIRReflectance
  
      refl_arr = np.random.random((2, 2))
      refl = da.from_array(refl_arr)
  
      refl_from_tbs = mock.MagicMock()
      refl_from_tbs.return_value = refl
      calculator.return_value = mock.MagicMock(
          reflectance_from_tbs=refl_from_tbs
      )
  
      emissive_arr = np.random.random((2, 2))
      emissive = da.from_array(emissive_arr)
      emissive_part = mock.MagicMock()
      emissive_part.return_value = emissive
      calculator.return_value = mock.MagicMock(
          emissive_part_3x=emissive_part
      )
  
      from satpy.modifiers.spectral import (
          NIREmissivePartFromReflectance,
      )
  
      comp = NIREmissivePartFromReflectance(
          name="test", sunz_threshold=86.0
      )
      info = {"modifiers": None}
  
      platform = "NOAA-20"
      sensor = "viirs"
      chan_name = "M12"
  
      get_lonlats = mock.MagicMock()
      lons, lats = 1, 2
      get_lonlats.return_value = (lons, lats)
      area = mock.MagicMock(get_lonlats=get_lonlats)
  
      nir_arr = np.random.random((2, 2))
      nir = xr.DataArray(da.from_array(nir_arr), dims=["y", "x"])
      nir.attrs["platform_name"] = platform
      nir.attrs["sensor"] = sensor
      nir.attrs["name"] = chan_name
      nir.attrs["area"] = area
      ir_arr = np.random.random((2, 2))
      ir_ = xr.DataArray(da.from_array(ir_arr), dims=["y", "x"])
      ir_.attrs["area"] = area
  
      sunz_arr = 100 * np.random.random((2, 2))
      sunz = xr.DataArray(da.from_array(sunz_arr), dims=["y", "x"])
      sunz.attrs["standard_name"] = "solar_zenith_angle"
      sunz.attrs["area"] = area
      sunz2 = da.from_array(sunz_arr)
      sza.return_value = sunz2
  
      res = comp([nir, ir_], optional_datasets=[sunz], **info)
      assert res.attrs["sun_zenith_threshold"] == 86.0
      assert res.attrs["units"] == "K"
      assert res.attrs["platform_name"] == platform
      assert res.attrs["sensor"] == sensor
      assert res.attrs["name"] == chan_name
      calculator.assert_called_with(
          "NOAA-20",
          "viirs",
          "M12",
          sunz_threshold=86.0,
          masking_limit=NIRReflectance.MASKING_LIMIT,
      )
  
imports: import unittest
  from datetime import datetime
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from pyresample.geometry import AreaDefinition, StackedAreaDefinition
  from pytest_lazyfixture import lazy_fixture
label_desc: Use image node_id 1 for calling the TestNIREmissivePartFromReflectance obj's underlying member method code with example usage: obj.test_compositor(calculator, apply_modifier_info, sza) without return types