code: def make_day_night_masks(solarZenithAngle,
                           good_mask,
                           highAngleCutoff,
                           lowAngleCutoff,
                           stepsDegrees=None):
      
      # if the caller passes None, we're only doing one step
      stepsDegrees = highAngleCutoff - lowAngleCutoff if stepsDegrees is None else stepsDegrees
  
      night_mask = (solarZenithAngle > highAngleCutoff) & good_mask
      day_mask = (solarZenithAngle <= lowAngleCutoff) & good_mask
      mixed_mask = []
      steps = list(range(lowAngleCutoff, highAngleCutoff + 1, stepsDegrees))
      if steps[-1] >= highAngleCutoff:
          steps[-1] = highAngleCutoff
      steps = zip(steps, steps[1:])
      for i, j in steps:
          LOG.debug("Processing step %d to %d" % (i, j))
          tmp = (solarZenithAngle > i) & (solarZenithAngle <= j) & good_mask
          if tmp.any():
              LOG.debug("Adding step %d to %d" % (i, j))
              # log.debug("Points to process in this range: " + str(np.sum(tmp)))
              mixed_mask.append(tmp)
          del tmp
  
      return day_mask, mixed_mask, night_mask
docs: given information on the solarZenithAngle for each point,
      generate masks defining where the day, night, and mixed regions are
  
      optionally provide the highAngleCutoff and lowAngleCutoff that define
      the limits of the terminator region (if no cutoffs are given the
      DEFAULT_HIGH_ANGLE and DEFAULT_LOW_ANGLE will be used)
  
      optionally provide the stepsDegrees that define how many degrees each
      "mixed" mask in the terminator region should be (if no stepsDegrees is
      given, the whole terminator region will be one mask)