code: def set_wts_get_npred_wt(gta, maskname):
      
      if is_null(maskname):
          maskname = None
  
      gta.set_weights_map(maskname)
      for name in gta.like.sourceNames():
          gta._init_source(name)
      gta._update_roi()
      return build_srcdict(gta, 'npred_wt')
docs: Set a weights file and get the weighted npred for all the sources
  
      Parameters
      ----------
  
      gta : `fermipy.GTAnalysis`
          The analysis object
  
      maskname : str
          The path to the file with the mask
  
  
      Returns
      -------
  
      odict : dict
          Dictionary mapping from source name to weighted npred