def getconfig(configfile='analysis.conf'):
    """
Reads config file and gets parameters.
    """
    import configobj
    config = configobj.ConfigObj(configfile)
    folder = config['out']
    cmapfile = folder + '/' + config['target']['name'] + '_' + config['file'][
        'tag'] + '_CountMap.fits'
    modelmap = folder + '/' + config['target']['name'] + '_' + config['file'][
        'tag'] + '_ModelMap.fits'
    residuals = folder + '/' + config['target']['name'
        ] + '_Residual_Model_cmap.fits'
    images = [residuals, modelmap, cmapfile]
    tsdir = folder + '/TSMap/'
    tsfits = folder + '/' + config['target']['name'] + '_' + config['file'][
        'tag'] + '_TSMap.npz'
    useful = {'folder': folder, 'cmapfile': cmapfile, 'modelmap': modelmap,
        'residuals': residuals, 'images': images, 'tsdir': tsdir, 'tsfits':
        tsfits}
    return config, useful
