class_docstr: Class to collect NinJo tags.
  
  This class is used by :class:`NinJoGeoTIFFWriter` to collect NinJo tags.
  Most end-users will not need to create instances of this class directly.
  
  Tags are gathered from three sources:
  
  - Fixed tags, contained in the attribute ``fixed_tags``.  The value of
    those tags is hardcoded and never changes.
  - Tags passed by the user, contained in the attribute ``passed_tags``.
    Those tags must be passed by the user as arguments to the writer, which
    will pass them on when instantiating this class.
  - Tags calculated from data and metadata.  Those tags are defined in the
    attribute ``dynamic_tags``.  They are either calculated from image data,
    from image metadata, or from arguments passed by the user to the writer.
  
  Some tags are mandatory (defined in ``mandatory_tags``).  All tags that are
  not mandatory are optional.  By default, optional tags are generated if and
  only if the required information is available.
class_docstr_tok: ["Class","to","collect","NinJo","tags",".","This","class","is","used","by",":","class",":","`","NinJoGeoTIFFWriter","`","to","collect","NinJo","tags",".","Most","end-users","will","not","need","to","create","instances","of","this","class","directly",".","Tags","are","gathered","from","three","sources",":","-","Fixed","tags",",","contained","in","the","attribute","``","fixed_tags","``",".","The","value","of","those","tags","is","hardcoded","and","never","changes",".","-","Tags","passed","by","the","user",",","contained","in","the","attribute","``","passed_tags","``",".","Those","tags","must","be","passed","by","the","user","as","arguments","to","the","writer",",","which","will","pass","them","on","when","instantiating","this","class",".","-","Tags","calculated","from","data","and","metadata",".","Those","tags","are","defined","in","the","attribute","``","dynamic_tags","``",".","They","are","either","calculated","from","image","data",",","from","image","metadata",",","or","from","arguments","passed","by","the","user","to","the","writer",".","Some","tags","are","mandatory","(","defined","in","``","mandatory_tags","``",")",".","All","tags","that","are","not","mandatory","are","optional",".","By","default",",","optional","tags","are","generated","if","and","only","if","the","required","information","is","available","."]
docstr: Initialise tag generator.
  
  Args:
      image (:class:`trollimage.xrimage.XRImage`): XRImage for which
          NinJo tags should be calculated.
      fill_value (int): Fill value corresponding to image.
      filename (str): Filename to be written.
      **kwargs: Any additional tags to be included as-is.
docstr_tok: ["Initialise","tag","generator",".","Args",":","image","(",":","class",":","`","trollimage.xrimage.XRImage","`",")",":","XRImage","for","which","NinJo","tags","should","be","calculated",".","fill_value","(","int",")",":","Fill","value","corresponding","to","image",".","filename","(","str",")",":","Filename","to","be","written",".","*","*","kwargs",":","Any","additional","tags","to","be","included","as-is","."]
code: def __init__(self, image, fill_value, filename, **kwargs):
      """Initialise tag generator.
  
      Args:
          image (:class:`trollimage.xrimage.XRImage`): XRImage for which
              NinJo tags should be calculated.
          fill_value (int): Fill value corresponding to image.
          filename (str): Filename to be written.
          **kwargs: Any additional tags to be included as-is.
      """
      self.image = image
      self.dataset = image.data
      self.fill_value = fill_value
      self.filename = filename
      self.args = kwargs
      self.tag_names = (
          self.fixed_tags.keys()
          | self.passed_tags
          | self.dynamic_tags.keys()
          | (self.args.keys() & self.optional_tags)
      )
      if self.args.keys() - self.tag_names:
          raise ValueError(
              "The following tags were not recognised: "
              + " ".join(self.args.keys() - self.tag_names)
          )
  
imports: import copy
  import datetime
  import logging
  import numpy
  from .geotiff import GeoTIFFWriter
label_desc: Use image node_id 1 to create a new NinJoTagGenerator object  with example: obj = NinJoTagGenerator(image, fill_value, filename)