
%%%%% start times

% 5 exposures A-F
tLow = '2016-07-16-06-34-55'; %  2.0 W (TRX_NORM ~1260)
%tHigh  = '2016-07-16-06-High-29'; %  9.8 W
%tHigh = '2016-07-16-06-43-38'; % 17.7 W
%tHigh = '2016-07-16-06-46-03'; % 30 W
%tHigh = '2016-07-16-06-50-25'; % 52 W

tHigh = '2016-07-16-07-19-01'; % 44 W (TRX_NORM ~1000)

% ITMX
[ixLow, ixLow_data] = make_HDR_image('ITMX', tLow);
[ixHigh, ixHigh_data] = make_HDR_image('ITMX', tHigh);
rITMX = get_power_ratio(ixLow, ixHigh)

figure(1)
subplot(2, 2, 1)
surf(ixHigh - ixLow * rITMX)
shading interp; view(2); axis equal; caxis([-10 10])
title('ITMX diff')

% ITMY
[iyLow, iyLow_data] = make_HDR_image('ITMY', tLow);
[iyHigh, iyHigh_data] = make_HDR_image('ITMY', tHigh);
rITMY = get_power_ratio(iyLow, iyHigh)

subplot(2, 2, 2)
surf(iyHigh - iyLow * rITMY)
shading interp; view(2); axis equal; caxis([-10 10])
title('ITMY diff')

% ITMY
[exLow, exLow_data] = make_HDR_image('ETMX', tLow);
[exHigh, exHigh_data] = make_HDR_image('ETMX', tHigh);
rETMX = get_power_ratio(exLow, exHigh)

subplot(2, 2, 3)
surf(exHigh - exLow * rETMX)
shading interp; view(2); axis equal; caxis([-10 10])
title('ETMX diff')

% ETMY
[eyLow, eyLow_data] = make_HDR_image('ETMY', tLow);
[eyHigh, eyHigh_data] = make_HDR_image('ETMY', tHigh);
rETMY = get_power_ratio(eyLow, eyHigh)

subplot(2, 2, 4)
surf(eyHigh - eyLow * rETMY)
shading interp; view(2); axis equal; caxis([-10 10])
title('ETMY diff')

% average observed power ratio
rAvg = mean([rITMX, rITMY, rETMX, rETMY])

% HDR images at high power
hdr_offset = 1e-3;
figure(2)

subplot(2, 2, 1)
surf(log(ixHigh + hdr_offset));
shading interp; view(2); axis equal; colormap hot
title('ITMX')

subplot(2, 2, 2)
surf(log(iyHigh + hdr_offset));
shading interp; view(2); axis equal; colormap hot
title('ITMY')

subplot(2, 2, 3)
surf(log(exHigh + hdr_offset));
shading interp; view(2); axis equal; colormap hot
title('ETMX')

subplot(2, 2, 4)
surf(log(eyHigh + hdr_offset));
shading interp; view(2); axis equal; colormap hot
title('ETMY')

