-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_fwi.m
179 lines (169 loc) · 5.2 KB
/
plot_fwi.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
clear all
close all
clc
format long g
cd ../
cd D:\KEEZ\PhD_Momoh_MC\Tomography\OBS_Data\Data_Preparation_for_FWI\Ek
fid=fopen('winv.mp00', 'r');
v=fread(fid, Inf,'float');
fclose(fid);
vv=reshape(v,[667,1467]);
figure
imagesc(vv)
caxis([1500 8000])
title('mp00')
fid=fopen('winv.mp01', 'r');
v=fread(fid, Inf,'float');
fclose(fid);
vv=reshape(v,[667,1467]);
figure
imagesc(vv)
caxis([1500 8000])
title('mp01')
fid=fopen('winv.mp02', 'r');
v=fread(fid, Inf,'float');
fclose(fid);
vv=reshape(v,[667,1467]);
figure
imagesc(vv)
caxis([1500 8000])
title('mp02')
fid=fopen('winv.mp03', 'r');
v=fread(fid, Inf,'float');
fclose(fid);
vv=reshape(v,[667,1467]);
figure
imagesc(vv)
caxis([1500 8000])
title('mp03')
% fid=fopen('winv.mp04', 'r');
% v=fread(fid, Inf,'float');
% fclose(fid);
% vv=reshape(v,[667,1467]);
% figure
% imagesc(vv)
% caxis([1500 8000])
% title('mp04')
%%
% A=read_segy_file('eswir_ffid_5hydr.segy');
% Distance=A.headers(4,:)/1000;
% time=linspace(0,16,8001);
sca=zeros([10,2]);
for I=1:10
if I<10
lab=strcat('dmod.hydr.s00', num2str(I),'.ite001');
elseif I>=10
lab=strcat('dmod.hydr.s0', num2str(I),'.ite001');
end
lab2=strcat('obs', num2str(I), '_decon_filtered_resampled.segy');
A=read_segy_file(lab2);
Distance=A.headers(4,:)/1000;
time=linspace(0,16,8001);
fid=fopen(lab, 'r');
v=fread(fid,inf,'float');
fclose(fid);
vv=reshape(v,[182,8001]).';
scaler=max(abs(A.traces(:))/max(abs(vv(:))));
sca(I,2)=scaler;
sca(I,1)=I;
figure
set(0,'defaultfigurecolor',[1 1 1])
mwigb((vv),1,(Distance(1,:))/1,time)
set(gcf, 'Units', 'centimeters', 'Position', [0, 0, 24, 15], ...
'PaperUnits', 'centimeters', 'PaperSize', [18, 9])
set(gca,'TickDir','out');
set(gca,'xaxislocation','top');
set(gca,'TickDir','out');
fs=16;
ylim([2.5 12])
set(gca,'fontsize', fs)
set(gca,'FontName','Times New Roman')
xlabel('Trace number', 'FontName','Times New Roman','FontSize', fs)
ylabel('Time [s]', 'FontName','Times New Roman','FontSize', fs)
set(gcf, 'PaperPositionMode', 'auto' );
title('output')
lab=strcat('data_mod', num2str(I));
print(gcf,'-r300','-dpng',lab)
figure
set(0,'defaultfigurecolor',[1 1 1])
mwigb((A.traces),1,(Distance(1,:))/1,time)
set(gcf, 'Units', 'centimeters', 'Position', [0, 0, 24, 15], ...
'PaperUnits', 'centimeters', 'PaperSize', [18, 9])
set(gca,'TickDir','out');
set(gca,'xaxislocation','top');
set(gca,'TickDir','out');
fs=16;
ylim([2.5 12])
set(gca,'fontsize', fs)
set(gca,'FontName','Times New Roman')
xlabel('Trace number', 'FontName','Times New Roman','FontSize', fs)
ylabel('Time [s]', 'FontName','Times New Roman','FontSize', fs)
set(gcf, 'PaperPositionMode', 'auto' );
title('input')
lab=strcat('data_real', num2str(I));
print(gcf,'-r300','-dpng',lab)
end
savefile = 'shot_norm_file';
fid=fopen(savefile,'wt');
for ll=1:10
fprintf(fid, '%5d\t%10f\n',sca(ll,:));
end
fclose(fid);
type shot_norm_file
system('copy D:\KEEZ\PhD_Momoh_MC\Tomography\OBS_Data\Data_Preparation_for_FWI\Ek\shot_norm_file D:\KEEZ\PhD_Momoh_MC\Tomography\OBS_Data\Data_Preparation_for_FWI\Preprocessed_files')
% fid=fopen('eswi_ffid_0005hydr', 'r');
% v=fread(fid,inf,'float');
% fclose(fid);
% vv2=reshape(v,[182,8001]);
figure
set(0,'defaultfigurecolor',[1 1 1])
mwigb(fliplr(A.traces),1,(Distance(1,:))/1,time)
set(gcf, 'Units', 'centimeters', 'Position', [0, 0, 24, 15], ...
'PaperUnits', 'centimeters', 'PaperSize', [18, 9])
set(gca,'TickDir','out');
set(gca,'xaxislocation','top');
set(gca,'TickDir','out');
fs=16;
ylim([2.5 12])
set(gca,'fontsize', fs)
set(gca,'FontName','Times New Roman')
xlabel('Trace number', 'FontName','Times New Roman','FontSize', fs)
ylabel('Time [s]', 'FontName','Times New Roman','FontSize', fs)
set(gcf, 'PaperPositionMode', 'auto' );
title('input')
figure
hold on
plot(A.traces(:,110))
plot(vv(:,110), 'r')
plot(vv(:,110)*-scaler, 'g')
% dlmwrite('eswir_water_bottom_grid', wat_depth, 'precision', 6, 'delimiter', '\t')
% type eswir_water_bottom_grid
% for I=5
% if I<10
% lab=strcat('dres.mplx.hydr.s00', num2str(I));
% % elseif I>=10
% % lab=strcat('dmod.mplx.hydr.s0', num2str(I));
% end
% fid=fopen(lab, 'r');
% v=fread(fid,inf,'float');
% fclose(fid);
% vv3=reshape(v,[182,8001]).';
% figure
% set(0,'defaultfigurecolor',[1 1 1])
% mwigb(fliplr(vv3),1,(Distance(1,:))/1,time)
% set(gcf, 'Units', 'centimeters', 'Position', [0, 0, 24, 15], ...
% 'PaperUnits', 'centimeters', 'PaperSize', [18, 9])
% set(gca,'TickDir','out');
% set(gca,'xaxislocation','top');
% set(gca,'TickDir','out');
% fs=16;
% ylim([2.5 12])
% set(gca,'fontsize', fs)
% set(gca,'FontName','Times New Roman')
% xlabel('Trace number', 'FontName','Times New Roman','FontSize', fs)
% ylabel('Time [s]', 'FontName','Times New Roman','FontSize', fs)
% set(gcf, 'PaperPositionMode', 'auto' );
% labs=strcat('dmod');
% title('output')
% % print(gcf,'-r300','-dpng',labs)
% end