class_docstr: Equalized DNB composite using the Zinke algorithm [#ncc1]_.
  
  References:
      .. [#ncc1] Stephan Zinke (2017),
  
             A simplified high and near-constant contrast approach for the
             display of VIIRS day/night band imagery
             :doi:`10.1080/01431161.2017.1338838`
class_docstr_tok: ["Equalized","DNB","composite","using","the","Zinke","algorithm","[","#","ncc1","]","_.","References",":","..","[","#","ncc1","]","Stephan","Zinke","(","2017",")",",","A","simplified","high","and","near-constant","contrast","approach","for","the","display","of","VIIRS","day\/night","band","imagery",":","doi",":","`","10.1080\/01431161.2017.1338838","`"]
docstr: Create HNCC DNB composite.
docstr_tok: ["Create","HNCC","DNB","composite","."]
code: def __call__(self, datasets, **info):
      """Create HNCC DNB composite."""
      if len(datasets) < 3 or len(datasets) > 4:
          raise ValueError(
              "Expected either 3 or 4 datasets, got %d"
              % (len(datasets),)
          )
      dnb_data = datasets[0]
      sza_data = datasets[1]
      lza_data = datasets[2]
      moon_illum_fraction = _check_moon_phase(
          datasets[3:4], dnb_data.attrs["start_time"]
      )
  
      # this algorithm assumes units of "W cm-2 sr-1" so if there are other
      # units we need to adjust for that
      if dnb_data.attrs.get("units", "W m-2 sr-1") == "W m-2 sr-1":
          unit_factor = 10000.0
      else:
          unit_factor = 1.0
  
      mda = dnb_data.attrs.copy()
      dnb_data = dnb_data.copy() / unit_factor
  
      phi = da.rad2deg(da.arccos(2.0 * moon_illum_fraction - 1))
  
      vfl = 0.026 * phi + 4.0e-9 * (phi**4.0)
  
      m_fullmoon = -12.74
      m_sun = -26.74
      m_moon = vfl + m_fullmoon
  
      gs_ = self.gain_factor(sza_data.data)
  
      r_sun_moon = 10.0 ** ((m_sun - m_moon) / -2.5)
      gl_ = r_sun_moon * self.gain_factor(lza_data.data)
      gtot = 1.0 / (1.0 / gs_ + 1.0 / gl_)
  
      dnb_data += 2.6e-10
      dnb_data *= gtot
  
      mda["name"] = self.attrs["name"]
      mda["standard_name"] = "ncc_radiance"
      dnb_data.attrs = mda
      return dnb_data
  
imports: from __future__ import annotations
  import logging
  import math
  from datetime import datetime
  import dask
  import dask.array
  import numpy
  import xarray
  from satpy.composites import CompositeBase, GenericCompositor
  from satpy.dataset import combine_metadata
label_desc: Use image node_id 1 for calling the NCCZinke obj's underlying member method code with example usage: obj.__call__(datasets) and returns: dnb_data