% Jon Newman
% 2014.01.19

%% Optical power at fiber tip using the LED
% INPUT MODULATION: DC voltage from power supply 
% MEASUREMENT: Newport 1830-C meter using a Newport 818-SL photodiode.
% K_fac accounts for distance and OD2 neutral density filter correction for
% higher laser powers

% 125 um diameter fiber
fiber_area = pi*(0.125/2)^2; 
p_offset = 0.129;
optimal_spot_factor = 1.1;

% LED (when the experiment room's lights were on, which adds a DC offset to
% the PD input and causes a dead zone at low command voltages)
v_cmd = [0      0.22       0.23    0.3     0.4     0.5     0.6     0.7     0.8     0.9     1.0     2       3       4       5];
p_raw = [0.129  0.129      0.132   0.134   0.138   0.143   0.147   0.152   0.156   0.160   0.165   0.208   0.249   0.293   0.3367];
v_pd  = [0      0.0335     0.044   0.057   0.077   0.095   0.114   0.134   0.152   0.172   0.191   0.381   0.571   0.761   0.952];     
K_fac = [1      1          1       1       1       1       1       1       1       1       1       1       1       1       1];

p_tip = optimal_spot_factor*((p_raw - p_offset) .* K_fac)/fiber_area;

cftool
