docs: def elixir_decode(elixir_filename):
      """
      Takes an elixir style file name and decodes it's content.
  
      Values returned as a dictionary.  Elixir filenames have the format
      RUNID.TYPE.FILTER/EXPTIME.CHIPID.VERSION.fits
      """
      import re, pyfits
      
      parts_RE=re.compile(r'([^\.\s]+)')
      dataset_name = parts_RE.findall(elixir_filename)
  
      ### check that this was a valid elixir_filename
      if not dataset_name or len(dataset_name)<5 :
          raise ValueError('String %s does not parse as elixir filename'
                           % elixir_filename )
          
      comments={'exptime': 'Integration time (seconds)',
                'filter': 'Name of filter in position  ',
                'crunid': 'CFHT Q RunID',
                'obstype': 'Observation or Exposure type',
                'imageid': 'CCD chip number',
                'filename': 'file name at creation of this MEF file'
                }
          
      keywords={}
      keywords['filename']=elixir_filename
      keywords['runid']=dataset_name[0]
      keywords['obstype']=dataset_name[1]
      keywords['exptime']=None
      keywords['filter']=None
  
      ### if the third part of the name is all numbers we assume exposure time
      if re.match(r'\d+',dataset_name[2]):
          keyword['exptime']=int(dataset_name[2])
      else:
          keyword['filter']=dataset_name[2]
      
      keywords['imageid']=dataset_name[3]
      keywords['version']=dataset_name[4]
  
      header=pyfits.Header()
      for keyword in keywords.keys():
          if keywords[keyword]:
              header.update(keyword,keywords[keyword],comment=comment[keyword])
  
      return header