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","`"]
code: def _gain_factor(theta):
      gain = np.empty_like(theta)
  
      mask = theta <= 87.541
      gain[mask] = (58 + 4 / np.cos(np.deg2rad(theta[mask]))) / 5
  
      mask = np.logical_and(theta <= 96, 87.541 < theta)
      gain[mask] = (
          123
          * np.exp(1.06 * (theta[mask] - 89.589))
          * ((theta[mask] - 93) ** 2 / 18 + 0.5)
      )
  
      mask = np.logical_and(96 < theta, theta <= 101)
      gain[mask] = 123 * np.exp(1.06 * (theta[mask] - 89.589))
  
      mask = np.logical_and(101 < theta, theta <= 103.49)
      gain[mask] = (
          123
          * np.exp(1.06 * (101 - 89.589))
          * np.log(theta[mask] - (101 - np.e)) ** 2
      )
  
      gain[theta > 103.49] = 6.0e7
  
      return gain
  
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 3 for calling the NCCZinke obj's underlying member method code with example usage: obj._gain_factor(theta) and returns: gain