This notebook illustrates the WEST pulses made the 27/11/2018, during the dedictated ICRH coupling experiments (2nd day)

Q1 and Q2 antenna position scan -- BROKEN

Up to this experiment, Q1 always show a higher coupling resistance than Q2. The goal of the experiment was to determine the optimal radial gap to locate Q1 and Q2 in order that they have the same coupling resistance.
Reference pulses have same radial positions of Q1 and Q2, at R=3010 mm. Then Q2 is moved forward Q1 at 3003 mm then 2995mm (+15mm than Q1).


In [2]:
# pulse numbers
pulses = [53772, 53773, # reference pulses, Q1 and Q2@3010mm
         53774, 53775, # Q2@3003 mm 
         53777 ] # Q2@2995 mm

In [3]:
from control_room import signals
from pulse_database import PulseDB
%matplotlib widget

In [9]:
db=PulseDB('WEST_C3b_ICRH_pulse_data.hdf5')

In [11]:
Rc_Q1_avg, t_Q1_avg = db.get_signal(pulses[0], 'IC_Rc_Q1_avg')
Rc_Q2_avg, t_Q2_avg = db.get_signal(pulses[0], 'IC_Rc_Q2_avg')

In [ ]:
for pulse in [pulses[1], pulses[3], pulses[4]]:

    Rc_Q1_left, t_Q1_left = get_filtered_sig(pulse, signames['Rc_Q1_left'], thres_min=0.15, thres_max=2)
    Rc_Q1_right, t_Q1_right = get_filtered_sig(pulse, signames['Rc_Q1_right'], thres_min=0.15, thres_max=2)

    Rc_Q2_left, t_Q2_left = get_filtered_sig(pulse, signames['Rc_Q2_left'], thres_min=0.15, thres_max=2)
    Rc_Q2_right, t_Q2_right = get_filtered_sig(pulse, signames['Rc_Q2_right'], thres_min=0.15, thres_max=2)

    fig, ax = subplots(1, 2, sharey=True, sharex=True)
    ax[0].fill_between(t_Q1_left, 
                    Rc_Q1_left - (Rc_Q1_left - smooth(Rc_Q1_left)),
                    Rc_Q1_left + (Rc_Q1_left - smooth(Rc_Q1_left)) )
    ax[0].plot(t_Q1_left, smooth(Rc_Q1_left))

    ax[0].fill_between(t_Q1_right, 
                    Rc_Q1_right - (Rc_Q1_right - smooth(Rc_Q1_right)),
                    Rc_Q1_right + (Rc_Q1_right - smooth(Rc_Q1_right)) )
    ax[0].plot(t_Q1_right, smooth(Rc_Q1_right))
    fig.suptitle(f'WEST pulse #{pulse}', fontsize=12)
    ax[0].set_ylabel('Coupling Resistance [$\Omega$]', fontsize=12)
    ax[0].set_title('Q1', fontsize=12)
    ax[0].set_xlabel('t [s]', fontsize=12)

    ax[1].fill_between(t_Q2_left, 
                    Rc_Q2_left - (Rc_Q2_left - smooth(Rc_Q2_left)),
                    Rc_Q2_left + (Rc_Q2_left - smooth(Rc_Q2_left)) )
    ax[1].plot(t_Q2_left, smooth(Rc_Q2_left))

    ax[1].fill_between(t_Q2_right, 
                    Rc_Q2_right - (Rc_Q2_right - smooth(Rc_Q2_right)),
                    Rc_Q2_right + (Rc_Q2_right - smooth(Rc_Q2_right)) )
    ax[1].plot(t_Q2_right, smooth(Rc_Q2_right))
    ax[1].set_title('Q2', fontsize=12)
    ax[1].set_xlabel('t [s]', fontsize=12)
    ax[1].set_ylim(0, 0.65)

In [ ]:
fig, ax = subplots()
# average left/right Rc
for pulse in [pulses[3], pulses[4]]:

    Rc_Q1_left, t_Q1_left = get_filtered_sig(pulse, signames['Rc_Q1_left'], thres_min=0.15, thres_max=2)
    Rc_Q1_right, t_Q1_right = get_filtered_sig(pulse, signames['Rc_Q1_right'], thres_min=0.15, thres_max=2)
    Rc_Q1_right = interp(t_Q1_left, t_Q1_right, Rc_Q1_right)
    
    Rc_Q2_left, t_Q2_left = get_filtered_sig(pulse, signames['Rc_Q2_left'], thres_min=0.15, thres_max=2)
    Rc_Q2_right, t_Q2_right = get_filtered_sig(pulse, signames['Rc_Q2_right'], thres_min=0.15, thres_max=2)
    Rc_Q2_right = interp(t_Q2_left, t_Q2_right, Rc_Q2_right)
    
    Rc_Q1 =  mean(array([Rc_Q1_left, Rc_Q1_right]), axis=0)
    Rc_Q2 =  mean(array([Rc_Q2_left, Rc_Q2_right]), axis=0)
    

    
    ax.fill_between(t_Q1_left, 
                    Rc_Q1 - (Rc_Q1 - smooth(Rc_Q1)),
                    Rc_Q1 + (Rc_Q1 - smooth(Rc_Q1)), alpha=0.2 )
    ax.plot(t_Q1_left, smooth(Rc_Q1), label=f'Q1 - #{pulse}')



    ax.fill_between(t_Q2_left, 
                    Rc_Q2 - (Rc_Q2 - smooth(Rc_Q2)),
                    Rc_Q2 + (Rc_Q2 - smooth(Rc_Q2)), alpha=0.2 )
    ax.plot(t_Q2_left, smooth(Rc_Q2), label=f'Q2 - #{pulse}')

    ax.set_title(f'WEST pulse #{pulse}', fontsize=12)
    ax.set_ylabel('Coupling Resistance [$\Omega$]', fontsize=12)
    ax.set_title('Q1', fontsize=12)
    ax.set_xlabel('t [s]', fontsize=12)
    ax.legend()
    ax.set_ylim(0, 0.65)

In [ ]:
mean(array([Rc_Q1_left, Rc_Q1_right]), axis=0)

In [ ]:
fig, ax = subplots()
# difference of the average left/right Rc
for pulse in [pulses[0], pulses[3], pulses[4]]:

    Rc_Q1_left, t_Q1_left = get_filtered_sig(pulse, signames['Rc_Q1_left'], thres_min=0.15, thres_max=2)
    Rc_Q1_right, t_Q1_right = get_filtered_sig(pulse, signames['Rc_Q1_right'], thres_min=0.15, thres_max=2)
    Rc_Q1_right = interp(t_Q1_left, t_Q1_right, Rc_Q1_right)
    
    Rc_Q2_left, t_Q2_left = get_filtered_sig(pulse, signames['Rc_Q2_left'], thres_min=0.15, thres_max=2)
    Rc_Q2_right, t_Q2_right = get_filtered_sig(pulse, signames['Rc_Q2_right'], thres_min=0.15, thres_max=2)
    Rc_Q2_right = interp(t_Q2_left, t_Q2_right, Rc_Q2_right)
    
    
    Rc_Q1 =  mean(array([Rc_Q1_left, Rc_Q1_right]), axis=0)
    Rc_Q2 =  mean(array([Rc_Q2_left, Rc_Q2_right]), axis=0)
    Rc_Q2 = interp(t_Q1_left, t_Q2_left, Rc_Q2)
    

    ax.plot(t_Q1_left, smooth(abs(Rc_Q1 - Rc_Q2)), label=f'#{pulse}')

    ax.set_title('Coupling Resistance Difference \n btw Q1 and Q2', fontsize=12)
    ax.set_ylabel('<$R_{c,Q1}$> - <$R_{c,Q2}$> [$\Omega$]', fontsize=12)
    ax.set_xlabel('t [s]', fontsize=12)
    ax.legend()
    
fig.tight_layout()
#fig.savefig('2018-11-27_coupling_resistance_differences.png')

In [ ]: