class_docstr: Base file handler.
class_docstr_tok: ["Base","file","handler","."]
docstr: Get information of available datasets in this file.
  
  This is used for dynamically specifying what datasets are available
  from a file in addition to what's configured in a YAML configuration
  file. Note that this method is called for each file handler for each
  file type; care should be taken when possible to reduce the amount
  of redundant datasets produced.
  
  This method should **not** update values of the dataset information
  dictionary **unless** this file handler has a matching file type
  (the data could be loaded from this object in the future) and at least
  **one** :class:`satpy.dataset.DataID` key is also modified.
  Otherwise, this file type may override the information provided by
  a more preferred file type (as specified in the YAML file).
  It is recommended that any non-ID metadata be updated during the
  :meth:`BaseFileHandler.get_dataset` part of loading.
  This method is not guaranteed that it will be called before any
  other file type's handler.
  The availability "boolean" not being ``None`` does not mean that a
  file handler called later can't provide an additional dataset, but
  it must provide more identifying (DataID) information to do so
  and should yield its new dataset in addition to the previous one.
  
  Args:
      configured_datasets (list): Series of (bool or None, dict) in the
          same way as is returned by this method (see below). The bool
          is whether the dataset is available from at least one
          of the current file handlers. It can also be ``None`` if
          no file handler before us knows how to handle it.
          The dictionary is existing dataset metadata. The dictionaries
          are typically provided from a YAML configuration file and may
          be modified, updated, or used as a "template" for additional
          available datasets. This argument could be the result of a
          previous file handler's implementation of this method.
  
  Returns:
      Iterator of (bool or None, dict) pairs where dict is the
      dataset's metadata. If the dataset is available in the current
      file type then the boolean value should be ``True``, ``False``
      if we **know** about the dataset but it is unavailable, or
      ``None`` if this file object is not responsible for it.
  
  Example 1 - Supplement existing configured information::
  
      def available_datasets(self, configured_datasets=None):
          "Add information to configured datasets."
          # we know the actual resolution
          res = self.resolution
  
          # update previously configured datasets
          for is_avail, ds_info in (configured_datasets or []):
              # some other file handler knows how to load this
              # don't override what they've done
              if is_avail is not None:
                  yield is_avail, ds_info
  
              matches = self.file_type_matches(ds_info['file_type'])
              if matches and ds_info.get('resolution') != res:
                  # we are meant to handle this dataset (file type matches)
                  # and the information we can provide isn't available yet
                  new_info = ds_info.copy()
                  new_info['resolution'] = res
                  yield True, new_info
              elif is_avail is None:
                  # we don't know what to do with this
                  # see if another future file handler does
                  yield is_avail, ds_info
  
  Example 2 - Add dynamic datasets from the file::
  
      def available_datasets(self, configured_datasets=None):
          "Add information to configured datasets."
          # pass along existing datasets
          for is_avail, ds_info in (configured_datasets or []):
              yield is_avail, ds_info
  
          # get dynamic variables known to this file (that we created)
          for var_name, val in self.dynamic_variables.items():
              ds_info = {
                  'file_type': self.filetype_info['file_type'],
                  'resolution': 1000,
                  'name': var_name,
              }
              yield True, ds_info
docstr_tok: ["Get","information","of","available","datasets","in","this","file",".","This","is","used","for","dynamically","specifying","what","datasets","are","available","from","a","file","in","addition","to","what","'s","configured","in","a","YAML","configuration","file",".","Note","that","this","method","is","called","for","each","file","handler","for","each","file","type",";","care","should","be","taken","when","possible","to","reduce","the","amount","of","redundant","datasets","produced",".","This","method","should","*","*","not","*","*","update","values","of","the","dataset","information","dictionary","*","*","unless","*","*","this","file","handler","has","a","matching","file","type","(","the","data","could","be","loaded","from","this","object","in","the","future",")","and","at","least","*","*","one","*","*",":","class",":","`","satpy.dataset.DataID","`","key","is","also","modified",".","Otherwise",",","this","file","type","may","override","the","information","provided","by","a","more","preferred","file","type","(","as","specified","in","the","YAML","file",")",".","It","is","recommended","that","any","non-ID","metadata","be","updated","during","the",":","meth",":","`","BaseFileHandler.get_dataset","`","part","of","loading",".","This","method","is","not","guaranteed","that","it","will","be","called","before","any","other","file","type","'s","handler",".","The","availability","``","boolean","''","not","being","``","None","``","does","not","mean","that","a","file","handler","called","later","ca","n't","provide","an","additional","dataset",",","but","it","must","provide","more","identifying","(","DataID",")","information","to","do","so","and","should","yield","its","new","dataset","in","addition","to","the","previous","one",".","Args",":","configured_datasets","(","list",")",":","Series","of","(","bool","or","None",",","dict",")","in","the","same","way","as","is","returned","by","this","method","(","see","below",")",".","The","bool","is","whether","the","dataset","is","available","from","at","least","one","of","the","current","file","handlers",".","It","can","also","be","``","None","``","if","no","file","handler","before","us","knows","how","to","handle","it",".","The","dictionary","is","existing","dataset","metadata",".","The","dictionaries","are","typically","provided","from","a","YAML","configuration","file","and","may","be","modified",",","updated",",","or","used","as","a","``","template","''","for","additional","available","datasets",".","This","argument","could","be","the","result","of","a","previous","file","handler","'s","implementation","of","this","method",".","Returns",":","Iterator","of","(","bool","or","None",",","dict",")","pairs","where","dict","is","the","dataset","'s","metadata",".","If","the","dataset","is","available","in","the","current","file","type","then","the","boolean","value","should","be","``","True","``",",","``","False","``","if","we","*","*","know","*","*","about","the","dataset","but","it","is","unavailable",",","or","``","None","``","if","this","file","object","is","not","responsible","for","it",".","Example","1","-","Supplement","existing","configured","information",":",":","def","available_datasets","(","self",",","configured_datasets=None",")",":","``","Add","information","to","configured","datasets",".","''","#","we","know","the","actual","resolution","res","=","self.resolution","#","update","previously","configured","datasets","for","is_avail",",","ds_info","in","(","configured_datasets","or","[","]",")",":","#","some","other","file","handler","knows","how","to","load","this","#","do","n't","override","what","they","'ve","done","if","is_avail","is","not","None",":","yield","is_avail",",","ds_info","matches","=","self.file_type_matches","(","ds_info","[","'file_type","'","]",")","if","matches","and","ds_info.get","(","'resolution","'",")","!","=","res",":","#","we","are","meant","to","handle","this","dataset","(","file","type","matches",")","#","and","the","information","we","can","provide","is","n't","available","yet","new_info","=","ds_info.copy","(",")","new_info","[","'resolution","'","]","=","res","yield","True",",","new_info","elif","is_avail","is","None",":","#","we","do","n't","know","what","to","do","with","this","#","see","if","another","future","file","handler","does","yield","is_avail",",","ds_info","Example","2","-","Add","dynamic","datasets","from","the","file",":",":","def","available_datasets","(","self",",","configured_datasets=None",")",":","``","Add","information","to","configured","datasets",".","''","#","pass","along","existing","datasets","for","is_avail",",","ds_info","in","(","configured_datasets","or","[","]",")",":","yield","is_avail",",","ds_info","#","get","dynamic","variables","known","to","this","file","(","that","we","created",")","for","var_name",",","val","in","self.dynamic_variables.items","(",")",":","ds_info","=","{","'file_type","'",":","self.filetype_info","[","'file_type","'","]",",","'resolution","'",":","1000",",","'name","'",":","var_name",",","}","yield","True",",","ds_info"]
code: def available_datasets(self, configured_datasets=None):
      """Get information of available datasets in this file.
  
      This is used for dynamically specifying what datasets are available
      from a file in addition to what's configured in a YAML configuration
      file. Note that this method is called for each file handler for each
      file type; care should be taken when possible to reduce the amount
      of redundant datasets produced.
  
      This method should **not** update values of the dataset information
      dictionary **unless** this file handler has a matching file type
      (the data could be loaded from this object in the future) and at least
      **one** :class:`satpy.dataset.DataID` key is also modified.
      Otherwise, this file type may override the information provided by
      a more preferred file type (as specified in the YAML file).
      It is recommended that any non-ID metadata be updated during the
      :meth:`BaseFileHandler.get_dataset` part of loading.
      This method is not guaranteed that it will be called before any
      other file type's handler.
      The availability "boolean" not being ``None`` does not mean that a
      file handler called later can't provide an additional dataset, but
      it must provide more identifying (DataID) information to do so
      and should yield its new dataset in addition to the previous one.
  
      Args:
          configured_datasets (list): Series of (bool or None, dict) in the
              same way as is returned by this method (see below). The bool
              is whether the dataset is available from at least one
              of the current file handlers. It can also be ``None`` if
              no file handler before us knows how to handle it.
              The dictionary is existing dataset metadata. The dictionaries
              are typically provided from a YAML configuration file and may
              be modified, updated, or used as a "template" for additional
              available datasets. This argument could be the result of a
              previous file handler's implementation of this method.
  
      Returns:
          Iterator of (bool or None, dict) pairs where dict is the
          dataset's metadata. If the dataset is available in the current
          file type then the boolean value should be ``True``, ``False``
          if we **know** about the dataset but it is unavailable, or
          ``None`` if this file object is not responsible for it.
  
      Example 1 - Supplement existing configured information::
  
          def available_datasets(self, configured_datasets=None):
              "Add information to configured datasets."
              # we know the actual resolution
              res = self.resolution
  
              # update previously configured datasets
              for is_avail, ds_info in (configured_datasets or []):
                  # some other file handler knows how to load this
                  # don't override what they've done
                  if is_avail is not None:
                      yield is_avail, ds_info
  
                  matches = self.file_type_matches(ds_info['file_type'])
                  if matches and ds_info.get('resolution') != res:
                      # we are meant to handle this dataset (file type matches)
                      # and the information we can provide isn't available yet
                      new_info = ds_info.copy()
                      new_info['resolution'] = res
                      yield True, new_info
                  elif is_avail is None:
                      # we don't know what to do with this
                      # see if another future file handler does
                      yield is_avail, ds_info
  
      Example 2 - Add dynamic datasets from the file::
  
          def available_datasets(self, configured_datasets=None):
              "Add information to configured datasets."
              # pass along existing datasets
              for is_avail, ds_info in (configured_datasets or []):
                  yield is_avail, ds_info
  
              # get dynamic variables known to this file (that we created)
              for var_name, val in self.dynamic_variables.items():
                  ds_info = {
                      'file_type': self.filetype_info['file_type'],
                      'resolution': 1000,
                      'name': var_name,
                  }
                  yield True, ds_info
  
      """
      for is_avail, ds_info in configured_datasets or []:
          if is_avail is not None:
              # some other file handler said it has this dataset
              # we don't know any more information than the previous
              # file handler so let's yield early
              yield is_avail, ds_info
              continue
          yield self.file_type_matches(ds_info["file_type"]), ds_info
  
imports: import numpy
  import xarray
  from pyresample.geometry import SwathDefinition
  from satpy.dataset import combine_metadata
  from satpy.readers import open_file_or_filename
label_desc: Use image node_id 15 for calling the BaseFileHandler obj's underlying member method code with example usage: obj.available_datasets(configured_datasets) without return types