class_docstr: Test various VIIRS-specific composites.
class_docstr_tok: ["Test","various","VIIRS-specific","composites","."]
docstr: Test the 'hncc_dnb' compositor.
docstr_tok: ["Test","the","'hncc_dnb","'","compositor","."]
code: def test_hncc_dnb(self, area, dnb, sza, lza):
      """Test the 'hncc_dnb' compositor."""
      from satpy.composites.viirs import NCCZinke
  
      comp = NCCZinke(
          "hncc_dnb",
          prerequisites=("dnb",),
          standard_name="toa_outgoing_radiance_per_" "unit_wavelength",
      )
      mif = xr.DataArray(
          da.zeros((5,), chunks=5) + 0.1,
          dims=("y",),
          attrs={"name": "moon_illumination_fraction", "area": area},
      )
      res = comp((dnb, sza, lza, mif))
      assert isinstance(res, xr.DataArray)
      assert isinstance(res.data, da.Array)
      assert res.attrs["name"] == "hncc_dnb"
      assert res.attrs["standard_name"] == "ncc_radiance"
      data = res.compute()
      unique = np.unique(data)
      np.testing.assert_allclose(
          unique,
          [
              3.48479712e-04,
              6.96955799e-04,
              1.04543189e-03,
              4.75394738e-03,
              9.50784532e-03,
              1.42617433e-02,
              1.50001560e03,
              3.00001560e03,
              4.50001560e03,
          ],
      )
  
      with pytest.raises(ValueError, match="Expected .*, got 2"):
          comp((dnb, sza))
  
file_path: satpy/satpy/tests/compositor_tests/test_viirs.py
imports: from datetime import datetime
  import dask.array
  import numpy
  import pytest
  import xarray
  from pyresample.geometry import AreaDefinition
label_desc: Use image node_id 8 for calling the TestVIIRSComposites obj's underlying member method code with example usage: obj.test_hncc_dnb(area, dnb, sza, lza) without return types