 clear all;
 clc;
% close all

%% plot history data created by ewsp2d.x
HD_DIR_l='D:\Makunyu\2DFWI_GPU\2DFWI_INVERSION_GET\2DFWI_INVERSION_EXE\2DFWI_INVERSION\2DFWI_INVERSION\output';
cod= '';                                                    
HD_DIR=strcat(HD_DIR_l,num2str(cod));     

% clim = [-0.10,0.1];
% clim = [2400,2800];
 
for i = 1:1
sourceindx = i;
var='txx';       % variable(vx, vz, p, txx, tzz, tyy, txz, txy, tyz)

% display options
disply_time_sr  = 5;          % display every disply_time_sr time points
disply_trace_sr = 2;          % display every disply_trace_sr traces

% scale factor of the data
scal = 1;
%====================================================%
tsr  = disply_time_sr;
trsr = disply_trace_sr;
str=strcat('1Gradient_receivers.dat');

str = strcat(HD_DIR,'/',str);

fid=fopen(str,'rb');

if fid~=-1
    
    
        ye =341;
        xe =541;

    HD = fread(fid,ye*xe,'float32');
    fclose(fid);
    
    HD = reshape(HD,ye,xe,1);
    HD = HD';
    
    
%     figure('Units','centimeter','Position',[10 7  25 25]);

   % HD(:,505:525) = 0;
    figure;
    imagesc(HD);
    colorbar;
     
else
    disp('ERROR! No input file found');
end
end
% save('result.mat','HD')
% HD_X = HD;
% save('3dhd.mat','HD')
