code: def load_image(self, filespec, idx=None, show_error=True):
          
          inherit_prihdr = self.settings.get('inherit_primary_header',
                                             False)
          try:
              data_obj = loader.load_data(filespec, logger=self.logger,
                                          idx=idx,
                                          inherit_primary_header=inherit_prihdr)
          except Exception as e:
              errmsg = "Failed to load file '%s': %s" % (
                  filespec, str(e))
              self.logger.error(errmsg)
              try:
                  (type, value, tb) = sys.exc_info()
                  tb_str = "\n".join(traceback.format_tb(tb))
              except Exception as e:
                  tb_str = "Traceback information unavailable."
              if show_error:
                  self.gui_do(self.show_error, errmsg + '\n' + tb_str)
              raise ControlError(errmsg)
  
          self.logger.debug("Successfully loaded file into object.")
          return data_obj
docs: A wrapper around ginga.util.loader.load_data()
  
          Parameters
          ----------
          filespec : str
              The path of the file to load (must reference a single file).
  
          idx : str, int or tuple; optional, defaults to None
              The index of the image to open within the file.
  
          show_error : bool, optional, defaults to True
              If `True`, then display an error in the GUI if the file
              loading process fails.
  
          Returns
          -------
          data_obj : data object named by filespec