def create_ctffind_4_v4_1_8_command(ctf_name, file_sum, file_input,
    file_output, settings):
    """Create the ctffind command"""
    ctf_settings = settings[ctf_name]
    ctffind_command = []
    if ctf_settings['Use movies'] == 'True':
        pass
    else:
        file_input = file_sum
    ctffind_command.append('{0}'.format(file_input))
    if ctf_settings['Use movies'] == 'True':
        ctffind_command.append('{0}'.format('yes'))
        ctffind_command.append('{0}'.format(ctf_settings['Combine frames']))
    else:
        pass
    ctffind_command.append('{0}'.format(file_output))
    ctffind_command.append('{0}'.format(ctf_settings['Pixel size']))
    ctffind_command.append('{0}'.format(ctf_settings['Acceleration voltage']))
    ctffind_command.append('{0}'.format(ctf_settings['Spherical aberration']))
    ctffind_command.append('{0}'.format(ctf_settings['Amplitude contrast']))
    ctffind_command.append('{0}'.format(ctf_settings['Amplitude spectrum']))
    ctffind_command.append('{0}'.format(ctf_settings['Min resolution(A)']))
    ctffind_command.append('{0}'.format(ctf_settings['Max resolution(A)']))
    ctffind_command.append('{0}'.format(ctf_settings['Min defocus(A)']))
    ctffind_command.append('{0}'.format(ctf_settings['Max defocus(A)']))
    ctffind_command.append('{0}'.format(ctf_settings['Step defocus(A)']))
    if ctf_settings['Know astigmatism'] == 'True':
        ctffind_command.append('{0}'.format('yes'))
    else:
        ctffind_command.append('{0}'.format('no'))
    if ctf_settings['High accuracy'] == 'True':
        ctffind_command.append('{0}'.format('yes'))
    else:
        ctffind_command.append('{0}'.format('no'))
    if ctf_settings['Know astigmatism'] == 'True':
        ctffind_command.append('{0}'.format(ctf_settings['Astigmatism']))
        ctffind_command.append('{0}'.format(ctf_settings['Astigmatism angle']))
    elif ctf_settings['Restrain astigmatism'] == 'True':
        ctffind_command.append('{0}'.format('yes'))
        ctffind_command.append('{0}'.format(ctf_settings[
            'Expected astigmatism']))
    else:
        ctffind_command.append('{0}'.format('no'))
    if ctf_settings['Phase shift'] == 'True':
        ctffind_command.append('{0}'.format('yes'))
        ctffind_command.append('{0}'.format(ctf_settings['Min phase(rad)']))
        ctffind_command.append('{0}'.format(ctf_settings['Max phase(rad)']))
        ctffind_command.append('{0}'.format(ctf_settings['Step phase(rad)']))
    else:
        ctffind_command.append('{0}'.format('no'))
    ctffind_command.append('{0}'.format('yes'))
    if ctf_settings['Resample micrographs'] == 'True':
        ctffind_command.append('{0}'.format('yes'))
    else:
        ctffind_command.append('{0}'.format('no'))
    if ctf_settings['Use movies'] == 'True':
        if ctf_settings['Movie is gain-corrected?'] == 'True':
            ctffind_command.append('{0}'.format('yes'))
        else:
            ctffind_command.append('{0}'.format('no'))
            ctffind_command.append('{0}'.format(ctf_settings['Gain file']))
        if ctf_settings['Correct mag. distort.'] == 'True':
            ctffind_command.append('{0}'.format('yes'))
            ctffind_command.append('{0}'.format(ctf_settings[
                'Mag. dist. angle']))
            ctffind_command.append('{0}'.format(ctf_settings[
                'Mag. dist. major scale']))
            ctffind_command.append('{0}'.format(ctf_settings[
                'Mag. dist. minor scale']))
        else:
            ctffind_command.append('{0}'.format('no'))
    else:
        pass
    command = 'echo "{0}" | {1}'.format('\n'.join(ctffind_command),
        settings['Path'][ctf_name])
    return command
