code: def extract_input_filenames(drzfile):
      
      data_kws = fits.getval(drzfile, 'd*data', ext=0, memmap=False)
      if len(data_kws) == 0:
          return None
      fnames = []
      for kw in data_kws.cards:
          f = kw.value.split('[')[0]
          if f not in fnames:
              fnames.append(f)
  
      return fnames
docs: Generate a list of filenames from a drizzled image's header