code: def delete_source_map(srcmap_file, names, logger=None):
      
      with fits.open(srcmap_file) as hdulist:
          hdunames = [hdu.name.upper() for hdu in hdulist]
  
          if not isinstance(names, list):
              names = [names]
  
          for name in names:
              if not name.upper() in hdunames:
                  continue
              del hdulist[name.upper()]
  
          hdulist.writeto(srcmap_file, overwrite=True)
docs: Delete a map from a binned analysis source map file if it exists.
  
      Parameters
      ----------
      srcmap_file : str
         Path to the source map file.
  
      names : list
         List of HDU keys of source maps to be deleted.