%% First Measurement
% v = 0:10;
% p =  [0
%     0.0003;
%     0.5059;
%     0.8210;
%     0.9239;
%     0.9830;
%     1.0000;
%     0.9995;
%     0.9993;
%     0.9987;
%     0.9974];
% p = p';
% cftool('laser_lookup.sfit')

%% Second measurement
% v = [0.5 1:0.2:5 6 8 10];
% p = [0.0002    0.0003    0.0003    0.0004    0.0013    0.0264    0.1194    0.3220    0.5998    0.7061    0.7630    0.7970    0.8342    0.8729    0.9065    0.9348    0.9548    0.9739    0.9902    1.0000    0.9986    0.9967    0.9952    0.9949    0.9952];
% cftool('laser_lookup.sfit')


%% Third measurement (2013/7/2, 'fixed-power')
area = pi*(0.0625)^2;
pulse_dc_ratio = 5/14.9;

v =     2*[0 3.0 3.5 4.0 4.5 5.0 2.2 2.3 2.4 2.5 1     1.1   1.2   1.3   1.4  1.5 1.6  1.7  1.8  1.9  2.0];     
p = pulse_dc_ratio*[0 15  15  15  15  15  8   9   11  13  0.186 0.248 0.437 0.733 1.12 1.7 2.07 2.92 3.67 5.03 6.09]/area;  
[v,  idx] = sort(v);
p = p(idx); 

%% Make a figure 
max_power = max(p); % mW mm^-2

figure
axes('Units','Centimeters','Position',[3 3 6 3])
hold on
plot(v,p,'ko','MarkerSize',4)

set(gca,'Xlim',[0 8],'Ylim',[0-max_power/20 max_power+max_power/20],'TickDir','out','Box','off','FontSize',8,'FontName','Arial')
xlabel('Control voltage (V)','FontSize',8)
ylabel('Optical power (mW \cdot mm^{-2})','FontSize',8,'FontName','Arial')

load('volt2power_03.mat')
plot(0:0.1:10,volt2power_sig(0:0.1:10),'k-')

export_fig -pdf -transparent 'laser-power_03'
