示例#1
0
for time in times:
    # The file names.
    file1 = 'nu_1kHz_relaxT_%.2f' % time
    file2 = 'nu_2kHz_relaxT_%.2f' % time

    # Calculate the peak intensities.
    heights1 = []
    heights2 = []
    for i in range(len(res_data)):
        # Append the intensities.
        heights1.append(res_data[i][4] * exp(-res_data[i][2] * time))
        heights2.append(res_data[i][5] * exp(-res_data[i][3] * time))

    # Write out the file.
    write_list(file_prefix=file1,
               res_names=res_names,
               res_nums=res_nums,
               atom1_names=atom1_names,
               atom2_names=atom2_names,
               w1=w1,
               w2=w2,
               data_height=heights1)
    write_list(file_prefix=file2,
               res_names=res_names,
               res_nums=res_nums,
               atom1_names=atom1_names,
               atom2_names=atom2_names,
               w1=w1,
               w2=w2,
               data_height=heights2)
示例#2
0
    for time_index in range(len(times)):
        # Loop over the spins.
        intensities = []
        for spin_index in range(len(r1rho_prime)):
            # The rate.
            nomen = pA**2 * (1.0 - pA) * (delta_omega[spin_index] * frq * 2 *
                                          pi)**2 * kex
            denom = kex**2 + pA**2 * (delta_omega[spin_index] * frq * 2 *
                                      pi)**2 + (2 * pi *
                                                spin_lock[spin_lock_index])**2
            rx = r1rho_prime[spin_index] + nomen / denom

            # The peak intensity.
            intensities.append(i0[spin_index] * exp(-rx * times[time_index]))

        # Create a Sparky .list file.
        name = 'nu_%s' % spin_lock[spin_lock_index]
        if time_index == 0:
            name += '_ref'
        else:
            name += '_time_%s' % times[time_index]
        write_list(file_prefix=name,
                   dir=None,
                   res_names=res_names,
                   res_nums=res_nums,
                   atom1_names=atom1_names,
                   atom2_names=atom2_names,
                   w1=w1,
                   w2=w2,
                   data_height=intensities)
示例#3
0
atom1_names = []
atom2_names = []
w1 = []
w2 = []
for i in range(len(res_data)):
    res_names.append(res_data[i][0])
    res_nums.append(res_data[i][1])
    atom1_names.append('N')
    atom2_names.append('H')
    w1.append(0.0)
    w2.append(0.0)

# The relaxation times to use (seconds).
times = [0.01, 0.02, 0.04, 0.06, 0.08, 0.10, 0.12]
for time in times:
    # The file names.
    file1 = 'nu_1kHz_relaxT_%.2f' % time
    file2 = 'nu_2kHz_relaxT_%.2f' % time

    # Calculate the peak intensities.
    heights1 = []
    heights2 = []
    for i in range(len(res_data)):
        # Append the intensities.
        heights1.append(res_data[i][4] * exp(-res_data[i][2] * time))
        heights2.append(res_data[i][5] * exp(-res_data[i][3] * time))

    # Write out the file.
    write_list(file_prefix=file1, res_names=res_names, res_nums=res_nums, atom1_names=atom1_names, atom2_names=atom2_names, w1=w1, w2=w2, data_height=heights1)
    write_list(file_prefix=file2, res_names=res_names, res_nums=res_nums, atom1_names=atom1_names, atom2_names=atom2_names, w1=w1, w2=w2, data_height=heights2)
示例#4
0
# Setup for the Sparky peak list.
res_names = ['Trp', 'Trp']
res_nums = [1, 1]
atom1_names = ['N', 'NE1']
atom2_names = ['HN', 'HE1']
w1 = [122.454, 111.978]
w2 = [8.397, 8.720]

# Loop over the spin-lock fields.
for spin_lock_index in range(len(spin_lock)):
    # Loop over the relaxation times.
    for time_index in range(len(times)):
        # Loop over the spins.
        intensities = []
        for spin_index in range(len(r1rho_prime)):
            # The rate.
            nomen = pA**2 * (1.0 - pA) * (delta_omega[spin_index]*frq*2*pi)**2 * kex
            denom = kex**2 + pA**2 * (delta_omega[spin_index]*frq*2*pi)**2 + (2*pi*spin_lock[spin_lock_index])**2
            rx = r1rho_prime[spin_index] + nomen / denom

            # The peak intensity.
            intensities.append(i0[spin_index] * exp(-rx*times[time_index]))

        # Create a Sparky .list file.
        name = 'nu_%s' % spin_lock[spin_lock_index]
        if time_index == 0:
            name += '_ref'
        else:
            name += '_time_%s' % times[time_index]
        write_list(file_prefix=name, dir=None, res_names=res_names, res_nums=res_nums, atom1_names=atom1_names, atom2_names=atom2_names, w1=w1, w2=w2, data_height=intensities)