@@ -17,12 +17,12 @@ using SlimPlotting, SegyIO, JLD2
17
17
SlimPlotting. PyPlot. close (:all )
18
18
19
19
# ' Path to the files and data used for these examples
20
- data_path = dirname (pathof (SlimPlotting))* " /../data/" ;
20
+ data_path = dirname (pathof (SlimPlotting)) * " /../data/" ;
21
21
22
22
# ' Read the data
23
23
# Pure array
24
24
vp = Float32 .(segy_read (" $(data_path) 2dVP.sgy" ). data);
25
- dm = diff (vp, dims= 1 );
25
+ dm = diff (vp, dims = 1 );
26
26
shot = Float32 .(segy_read (" $(data_path) 2dshot.segy" ). data);
27
27
xloc = get_header (segy_read (" $(data_path) 2dshot.segy" ), " GroupX" )
28
28
fslice = JLD2. load (" $(data_path) 2dfslice.jld" );
@@ -32,18 +32,18 @@ fslice = JLD2.load("$(data_path)2dfslice.jld");
32
32
33
33
# Dummy structures to check plot with metadata
34
34
struct geometry
35
- xloc
35
+ xloc:: Any
36
36
end
37
37
38
38
struct shotrec
39
- data
40
- dt
41
- geometry
39
+ data:: Any
40
+ dt :: Any
41
+ geometry:: Any
42
42
end
43
43
44
44
struct Phys
45
- data
46
- d
45
+ data:: Any
46
+ d:: Any
47
47
end
48
48
49
49
# # Make physical objects
@@ -58,14 +58,15 @@ shotp = shotrec([shot], 0.008, geometry([xloc]));
58
58
# ' - The standard matplotlib `Greys` colormap
59
59
# ' - The perceptually accurate `Greys` colormap from colorcet
60
60
61
- figure (figsize= (10 , 10 ))
61
+ figure (figsize = (10 , 10 ))
62
62
subplot (311 )
63
- plot_simage (dmp; new_fig= false , name= " Seismic" )
63
+ plot_simage (dmp; new_fig = false , name = " Seismic" )
64
64
subplot (312 )
65
- plot_simage (dm, (10 , 20 ); cmap= " Greys" , new_fig= false , name= " Greys" )
65
+ plot_simage (dm, (10 , 20 ); cmap = " Greys" , new_fig = false , name = " Greys" )
66
66
subplot (313 )
67
- plot_simage (dm, (10 , 20 ); cmap= :cet_CET_L1 , new_fig= false , name= " Colorcet Greys" )
68
- tight_layout ();display (gcf ())
67
+ plot_simage (dm, (10 , 20 ); cmap = :cet_CET_L1 , new_fig = false , name = " Colorcet Greys" )
68
+ tight_layout ();
69
+ display (gcf ());
69
70
70
71
71
72
# ' # Velocity
@@ -74,14 +75,15 @@ tight_layout();display(gcf())
74
75
# ' - The ColorSchemes `vik` colormap
75
76
# ' - The perceptually accurate `jet` colormap from colorcet named `cet_rainbow4`
76
77
77
- figure (figsize= (10 , 10 ))
78
+ figure (figsize = (10 , 10 ))
78
79
subplot (311 )
79
- plot_velocity (vpp; new_fig= false , name= " colorcet jet" , cmap= " cet_rainbow4" )
80
+ plot_velocity (vpp; new_fig = false , name = " colorcet jet" , cmap = " cet_rainbow4" )
80
81
subplot (312 )
81
- plot_velocity (vp, (10 , 20 ); cmap= :vik , new_fig= false , name= " ColorSchemes's vik" )
82
+ plot_velocity (vp, (10 , 20 ); cmap = :vik , new_fig = false , name = " ColorSchemes's vik" )
82
83
subplot (313 )
83
- plot_velocity (vp, (10 , 20 ); cmap= seiscm (:frequency ), new_fig= false , name= " Seiscm" )
84
- tight_layout ();display (gcf ())
84
+ plot_velocity (vp, (10 , 20 ); cmap = seiscm (:frequency ), new_fig = false , name = " Seiscm" )
85
+ tight_layout ();
86
+ display (gcf ());
85
87
86
88
87
89
# ' # Frequency slice
@@ -91,14 +93,15 @@ tight_layout();display(gcf())
91
93
# ' - The perceptually accurate `bwr` colormap from colorcet named `cet_CET_D1A`
92
94
93
95
# Frequency slice
94
- figure (figsize= (10 , 5 ))
96
+ figure (figsize = (10 , 5 ))
95
97
subplot (131 )
96
- plot_fslice (fslice[" Freq" ][1 , :, :], (12.5 , 12.5 ); new_fig= false , name= " colorcet bwr" )
98
+ plot_fslice (fslice[" Freq" ][1 , :, :], (12.5 , 12.5 ); new_fig = false , name = " colorcet bwr" )
97
99
subplot (132 )
98
- plot_fslice (fslicep; cmap= :bwr , new_fig= false , name= " bwr" )
100
+ plot_fslice (fslicep; cmap = :bwr , new_fig = false , name = " bwr" )
99
101
subplot (133 )
100
- plot_fslice (fslicep; cmap= seiscm (:bwr ), new_fig= false , name= " Seiscm bwr" )
101
- tight_layout ();display (gcf ())
102
+ plot_fslice (fslicep; cmap = seiscm (:bwr ), new_fig = false , name = " Seiscm bwr" )
103
+ tight_layout ();
104
+ display (gcf ());
102
105
103
106
104
107
@@ -111,14 +114,15 @@ tight_layout();display(gcf())
111
114
# ' - The perceptually accurate `bwr` colormap from colorcet named `cet_CET_D1A`
112
115
113
116
# Shot record
114
- figure (figsize= (10 , 5 ))
117
+ figure (figsize = (10 , 5 ))
115
118
subplot (131 )
116
- plot_sdata (shotp; new_fig= false , name= " matplotlib seismic" , cmap= " bwr" )
119
+ plot_sdata (shotp; new_fig = false , name = " matplotlib seismic" , cmap = " bwr" )
117
120
subplot (132 )
118
- plot_sdata (shot, (12.5 , 0.008 ); cmap= :cet_CET_D1A , new_fig= false , name= " Colorcet bwr" )
121
+ plot_sdata (shot, (12.5 , 0.008 ); cmap = :cet_CET_D1A , new_fig = false , name = " Colorcet bwr" )
119
122
subplot (133 )
120
- plot_sdata (shot, (12.5 , 0.008 ); cmap= seiscm (:bwr ), new_fig= false , name= " Seismic bwr" )
121
- tight_layout ();display (gcf ())
123
+ plot_sdata (shot, (12.5 , 0.008 ); cmap = seiscm (:bwr ), new_fig = false , name = " Seismic bwr" )
124
+ tight_layout ();
125
+ display (gcf ());
122
126
123
127
124
128
# ' ## Seismic greys
@@ -127,27 +131,41 @@ tight_layout();display(gcf())
127
131
# ' - The perceptually accurate `greys` colormap from colorcet named `cet_CET_L1`
128
132
129
133
# Shot record
130
- figure (figsize= (10 , 5 ))
134
+ figure (figsize = (10 , 5 ))
131
135
subplot (121 )
132
- plot_sdata (shotp; new_fig= false , name= " colorcet gray" , cmap= " cet_CET_L1" )
136
+ plot_sdata (shotp; new_fig = false , name = " colorcet gray" , cmap = " cet_CET_L1" )
133
137
subplot (122 )
134
- plot_sdata (shot, (12.5 , 0.008 ); cmap= " gray" , new_fig= false , name= " Greys" )
135
- tight_layout ();display (gcf ())
138
+ plot_sdata (shot, (12.5 , 0.008 ); cmap = " gray" , new_fig = false , name = " Greys" )
139
+ tight_layout ();
140
+ display (gcf ());
136
141
137
142
# ' # Compare shot records
138
143
# ' One of the main visual representation of FWI inversion is to compare the true shot record with the synthetic data from
139
144
# ' the current velocity model. A good way to visualize this difference is to overlay the two shot records alternating the traces
140
145
# ' between each shots with a different colormap to check the alignment of the events. We show below how to do this with the
141
146
# ' `compare_shots` function
142
147
143
- figure (figsize= (10 , 5 ))
148
+ figure (figsize = (10 , 5 ))
144
149
subplot (131 )
145
- compare_shots (shotp, shotp; new_fig= false , name= " Overlap compare" )
150
+ compare_shots (shotp, shotp; new_fig = false , name = " Overlap compare" )
146
151
subplot (132 )
147
- compare_shots (shotp, shotp; new_fig= false , cmap= (" bwr" , " RdBu" ), name= " Overlap compare custom cmap" )
152
+ compare_shots (
153
+ shotp,
154
+ shotp;
155
+ new_fig = false ,
156
+ cmap = (" bwr" , " RdBu" ),
157
+ name = " Overlap compare custom cmap" ,
158
+ )
148
159
subplot (133 )
149
- compare_shots (shotp, shotp; side_by_side= true , new_fig= false , name= " Side by side compare" )
150
- tight_layout ();display (gcf ())
160
+ compare_shots (
161
+ shotp,
162
+ shotp;
163
+ side_by_side = true ,
164
+ new_fig = false ,
165
+ name = " Side by side compare" ,
166
+ )
167
+ tight_layout ();
168
+ display (gcf ());
151
169
152
170
153
171
# ' # Wiggle traces
0 commit comments