code: def loader(filepath, logger=None, **kwargs):
      
      # see ginga.util.loader module
      # TODO: return an AstroTable if loading a table, etc.
      #   for now, assume always an image
      from ginga import AstroImage
      image = AstroImage.AstroImage(logger=logger)
  
      with asdf.open(filepath) as asdf_f:
          #image.load_asdf(asdf_f, **kwargs)
          image.load_asdf(asdf_f)
  
      return image
docs: Load an object from an ASDF file.
      See :func:`ginga.util.loader` for more info.
  
      TODO: kwargs may contain info about what part of the file to load