% Try out ff and invert_ft on lightning image. 

test_setup

figure(1)
hold off
imagesc(image.^contrast)
colormap(gray)
title('Incident intensity')

% Now produce and display the smeared version.
smeared = ft(image, T, f);

figure(2)
hold off
imagesc(smeared.^contrast)
colormap(gray)
title('Smeared CCD readout')

% Attempt to invert, and reconstruct the original image
reconstructed = invert_ft(smeared, T, f);
max_diff_reconstructed_smeared = max(max(abs(reconstructed-smeared)))
max_error_reconstructed = max(max(abs(reconstructed - image*T)))

figure(3)
hold off
imagesc(real(reconstructed.^contrast))
colormap(gray)
title('Reconstructed CCD readout')
