def name_experiment(experiment_details=None):
    """Generate a unique name for the experiment."""
    if experiment_details is None:
        experiment_details = dict()
    if 'name' in experiment_details:
        name = experiment_details['name'].strip().replace(' ', '_')
    else:
        exp_type = experiment_details['type'].replace('.', '_')
        h_larmor_frq = float(experiment_details['h_larmor_frq'])
        temperature = float(experiment_details['temperature'])
        b1_frq = float(experiment_details['b1_frq'])
        time_t1 = float(experiment_details['time_t1'])
        name = '{:s}_{:.0f}Hz_{:.0f}ms_{:.0f}MHz_{:.0f}C'.format(exp_type,
            b1_frq, time_t1 * 1000.0, h_larmor_frq, temperature).lower()
    return name
