%SIMULATION
clear all;
close all;
clc;

set(0,'DefaultFigureWindowStyle','docked');

do_nx = 1;
lambdaL_solid = 1.3e-3;
para.db_scale = 20;

figure_options.powerpoint_figure.size_in_cm = [11,11];
figure_options.powerpoint_figure.fontname = 'Times New Roman';
figure_options.powerpoint_figure.fontsize_pts = 24;
figure_options.powerpoint_figure.linewidth_pts = 2;
figure_options.powerpoint_figure.axis_linewidth_pts = 2;
figure_options.powerpoint_figure.marker_size_pts = 10;

xoff1 = [-0.5 0.1 -2 0]*1e-3;
xoff1n = [0.3 0.5 0.5 0.5]*1e-3;
zoff1n = [-0.5 -0.5 -1.5 -1.5]*1e-3;
xoff2 = [0.5 0.7 -2.1 0.4]*1e-3;

%%%%------------new DC
load tfm_exp_DC_n1;
mesh0 = mesh;
image_a_DCn = image_a;
jj = [1:4];
for ii = 1:4
% for ii = 1 : size(image_a_DC,1)
    tmp = squeeze(image_a_DCn(jj(ii),:,:));
        
    if do_nx
        mesh.x = (mesh0.x + xoff1n(ii)) ./ lambdaL_solid .*1e-3;
        mesh.z = (mesh0.z + + zoff1n(ii)) ./ lambdaL_solid .*1e-3;
    else
        mesh.x = (mesh0.x + xoff1n(ii));
        mesh.z = mesh0.z + zoff1n(ii);
    end
    [tmp1] = fn_figure_tmp1(tmp,mesh,db_scale,label_options);
    if do_nx
        xlim([-12 12]*1e-3./lambdaL_solid);
        ylim([8 32]*1e-3./lambdaL_solid);
        xlabel('x (\lambda)','FontAngle','Italic');
        ylabel('z (\lambda)','FontAngle','Italic');
    else
        xlim([-12 12]);
        ylim([8 32]);
        xlabel('x (mm)');
        ylabel('z (mm)');
    end
    
    box on;    
    caxis([-para.db_scale 0]);
    fn_make_figure_for_presentation(gcf, figure_options);
end


%%%%%%%%--------------normal incident immersion

load tfm_exp_NI_n1;
image_a_NI = image_a;
exp_data = [];
mesh0 = mesh;

% for ii = [2 5 12 13 24 29 33]
% jj = [2 5 14 11];
jj = 1:4;
for ii = 1:4
% for ii = 1 : size(image_a_NI,1)
    tmp = squeeze(image_a_NI(jj(ii),:,:));
    if do_nx
        mesh.x = (mesh0.x + xoff2(ii)) ./ lambdaL_solid .*1e-3;
        mesh.z = mesh0.z ./ lambdaL_solid .*1e-3;
    else
        mesh.x = (mesh0.x + xoff2(ii));
        mesh.z = mesh0.z;
    end
    [tmp1] = fn_figure_tmp_NI(tmp,mesh,db_scale,label_options,exp_data);
    if do_nx
        xlim([-12 12]*1e-3./lambdaL_solid);
        ylim([8 32]*1e-3./lambdaL_solid);
        xlabel('x (\lambda)','FontAngle','Italic');
        ylabel('z (\lambda)','FontAngle','Italic');
    else
        xlim([-12 12]);
        ylim([8 32]);
        xlabel('x (mm)');
        ylabel('z (mm)');
    end
    caxis([-para.db_scale 0]);
    fn_make_figure_for_presentation(gcf, figure_options);
end