%%
clear
A = load( 'IPlasma_25285.dat' );
tI = A(3:end,1);
I = A(3:end,2);
B = load( 'IntDensity03_25285.dat' );
tn = B(:,1);
n = B(:,2);

%%
figure
plot( tI, I*1e-3, '-b', tn, n*1e-20, '-r' )
xlim( [25 160] )
ylim( [0 0.2] )
ylabel( 'I_P (MA), n_e (10^{20}m^{-3})', 'fontsize', 16 )
xlabel( 'time (ms)', 'fontsize', 16 )
legend( 'I_P', 'n_e', 'fontsize', 14 )
title( 'TCABR #25285', 'fontsize', 16 )
set( gca, 'fontsize', 14, 'tickdir', 'out' )

%%
clear
DISP = 25293;
[ tI, yI ] = leia_TCABR( DISP, 'IP' );
[ tn, yn ] = leia_TCABR( DISP, 'ne' );
[ tM, yM ] = leia_TCABR( DISP, 'Mref' );

figure
plot( tI, yI*1e-3, '-b', tn, yn*1e-20, '-r', tM, yM/10, '-k' )
xlim( [25 160] )
ylim( [-0.1 0.2] )
ylabel( 'I_P (MA), n_e (10^{20}m^{-3}), Mirnov (a.u.)', 'fontsize', 16 )
xlabel( 'time (ms)', 'fontsize', 16 )
legend( 'I_P', 'n_e', 'Mirnov', 'fontsize', 14 )
title( sprintf( 'TCABR #%d', DISP ), 'fontsize', 16 )
set( gca, 'fontsize', 14, 'tickdir', 'out' )
%%
clear
DISP = 25292;
[ tI, yI ] = leia_TCABR( DISP, 'IP' );
[ tn, yn ] = leia_TCABR( DISP, 'ne' );
[ tM, yM ] = leia_TCABR( DISP, 'Mref' );

figure
plot( tn, 20*((yn*1e-20)-.123), '.-r', tM, yM/10, '.-k' )
xlim( [88 89] )
