docs: def inputs(header):
      """Read through the HISTORY cards in an image header looking for detrend
      input lines.
  
      Detrend inputs are given on lines like:
      HISTORY imcombred: file_id
  
      We require that the value in file_id be store in the CADC archive before
      adding to the inputs list.
      """
      import string, re
  
      inputs=[]
      for h in header.ascardlist():
          if h.key=="HISTORY":
              g=h.value
              result=re.search('imcombred: (\d{6}[bfopd])\d{2} .*',g)
              if not result:
                  continue
              file_id=result.group(1)
              import os
              status=os.system("adInfo -a CFHT -s "+file_id)
              if status==0:
                  result=re.search('(\d{6}).*',file_id)
                  if not result:
                      continue
                  expnum=result.group(1)
                  inputs.append(expnum)
  
      if len(inputs)==0:
          ### try using the new FLIPS 2.0 keywords
          nit = header.get('IMCMB_NI',0)
          if nit==0:
              return(inputs)
          for nin in range(nit):        
              kwd='IMCMB_'+str(nin).zfill(2)
              file=(header.get(kwd,''))
              result=re.search('.*(\d{6}[bfopd]).*',g)
              if not result:
                  continue
              file_id=result.group(1)
              import os
              status=os.system("adInfo -a CFHT -s "+file_id)
              if status==0:
                  result=re.search('(\d{6}).*',file_id)
                  if not result:
                      continue
                  expnum=result.group(1)
                  inputs.append(expnum)
                  
      return inputs