lib/App/SeismicUnixGui/big_streams/Synseis.pm untested

filter: Statementstmt 0.0% 0 / 96 Branchbran 0.0% 0 / 28 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 18 Podpod 0.0% 0 / 17 totaltotal 0.0% 0 / 159 CC 15 SCAR 17.0
CC
15
Cov
0%
input_source_filename
6.0
reflec_coef_depth
6.0
reflec_coef_time
6.0
CRAP 5.5
1 package App::SeismicUnixGui::big_streams::Synseis;
2  
3 =pod
4  
5 This script creates the synthetic seismogram in an ascii file
6 usage synseis.sh Site number
7 #
8 ***** SETTING SITE WATER DEPTHS******* NOTE 1 ***************************
9 #water_depth=1123. # water depth at site 904 delay = 370 ms
10 water_depth=1; #1123. #wqter depth incurrent zrhov model
11 #
12  
13 ********SETTING PATHS ******* NOTE 2 ***************************
14
15 zrhov is the only file that Synseis reads on input
16 zrhov contains depth versus density and velosity in three columns
17 values versus depth DO NOT HAVE to be at regular intervals but
18 commonly are.
19  
20 ----
21 #
22 # Setting paths
23 path=./
24 zrhov_filename=./zrhov.904 # input filename
25 zrhov_filename=./zrhov # input filename
26 output_source=./source.out
27 reflec_coef_time=./rc_t
28 reflec_coef_depth=./rc_z
29 reg_density_file=./zrho.reg
30 reg_velocity_file=./zv.reg
31 #
32 # *********** OPTIONS ************* NOTE 3 *************************
33 # The program has various options, e.g.
34 # 1) variable sampling rate
35 # 2) synthetic Ricker source
36 # 3A) real MCS source ready to roll!
37 # 3B) sources that need to be resampled at a finer sampling rate
38 #
39 # For each option several parameters must be turned off and others turned
40 # on. At present this program works using an MCS source wavelet with
41 # a 2ms sampling interval taken from EW Line 1027 at CDP 1377 1.106-1.166ms
42 # (1027.source) found in /projects/projects5/Geol4068/Synseis_class/sources
43 # Be careful with the units as SUnix uses microseconds and you may
44 # like to think in terms of milliseconds or just seconds!
45 #
46 # ---------------- uncomment before next line if using resampled source
47 # OTHER OPTIONAL SOURCES with DIFFERENT (!!!) sampling intervals
48 #
49 # 1ms SI; first source used, fromCDP 1400, line2, SCS
50 # input_source_filename=$path/sources/CDP1400.source
51 # time_sampling_interval=0.001 # in seconds
52 #
53 # 1ms SI; CDP 1210 1086-1173ms
54 # input_source_filename=$path/sources/line2.source
55 # time_sampling_interval=0.001 # in seconds
56 #
57 # ******************************************************
58 # WE USE THE FOLLOWING SOURCE IN THIS EXAMPLE
59 # *******************************************************
60 # 2ms SI CDP 1377 1.106-1.166ms
61 input_source_filename=./1027.source
62 time_sampling_interval=0.002 # in seconds
63 #
64 depth_sampling_interval=0.4 # in meters
65 #
66 # Remember that you can't use an MCS source AND a Ricker wavelet
67 # and a seismic source wavelet you would like to change within Synseis
68 # SIMLUTANEOUSLY. Therefore, if you want to use on eof these options
69 # other options MUST be set off. I advise you to not use the following
70 # options for the time being without help.
71  
72 # If you want to use the following options
73 # ----------------- uncomment before next line for source for sampling
74 # source_resampling_interval=0.004
75 ## tmin_resampled_source=0.004
76 # xstart4resampling_source=0.0
77 # -X0$xstart4resampling_source \
78 #-S$input_source_filename
79 #
80 # --------------- uncomment below this line if using Ricker --------
81 # Ricker_endtime=0.15 # s
82 # Ricker_file=$path2/Geol4068/users/$1/modeling/output/ricker.out
83 # Ricker_frequency=40. # Hz
84 # -AF$Ricker_frequency \
85 # -AE$Ricker_endtime \
86 # -Ao$Ricker_file
87 # -----------------------------------------------------------------
88 # ************* Running the program *********** NOTE ***************
89 # -V allows output of all values during run time : not recommended
90 # unless you desire to inspect the gizzards of the beast
91 #
92 # -X0$xstart4resampling_source \
93 Synseis \
94 -S$input_source_filename \
95 -CZ$reflec_coef_depth \
96 -CT$reflec_coef_time \
97 -I$time_sampling_interval \
98 -IZ$depth_sampling_interval \
99 -LD$reg_density_file \
100 -LV$reg_velocity_file \
101 -Ro$output_source \
102 -Z$zrhov_filename \
103 -W$water_depth
104 # -V
105  
106 =head4 Examples
107  
108  
109 =head3 SEISMIC UNIX NOTES
110  
111  
112 =head2 CHANGES and their DATES
113
114  
115 =cut
116  
117 use Moose;
118 our $VERSION = '0.0.1';
119  
120 my $Synseis = {
121 _input_source_filename => '',
122 _reflec_coef_depth => '',
123 _reflec_coef_time => '',
124 _time_sampling_interval => '',
125 _depth_sampling_interval => '',
126 _reg_density_file => '',
127 _reg_velocity_file => '',
128 _output_source => '',
129 _zrhov_filename => '',
130 _water_depth => '',
131 _Ricker_frequency => '',
132 _Ricker_endtime => '',
133 _Ricker_file => '',
134 _verbose => '',
135 _Step => '',
136 _note => ''
137 };
138  
139 # define a value
140 my $on = 1;
141  
142 =head2 sub clear
143  
144 clear global variables from the memory
145  
146 =cut
147  
148 sub clear {
149 $Synseis->{_input_source_filename} = '';
150 $Synseis->{_reflec_coef_depth} = '';
151 $Synseis->{_reflec_coef_time} = '';
152 $Synseis->{_time_sampling_interval} = '';
153 $Synseis->{_depth_sampling_interval} = '';
154 $Synseis->{_reg_density_file} = '';
155 $Synseis->{_reg_velocity_file} = '';
156 $Synseis->{_output_source} = '';
157 $Synseis->{_zrhov_filename} = '';
158 $Synseis->{_water_depth} = '';
159 $Synseis->{_verbose} = '';
160 $Synseis->{_Step} = '';
161 $Synseis->{_note} = '';
162 }
163  
164 =head2 sub input_source_filename
165  
166  
167 =cut
168  
169 sub input_source_filename {
170 my ( $variable, $input_source_filename ) = @_;
171 if ($input_source_filename) {
172 $Synseis->{_input_source_filename} = $input_source_filename;
173 $Synseis->{_Step} =
174 $Synseis->{_Step} . ' -S' . $Synseis->{_input_source_filename};
175 $Synseis->{_note} =
176 $Synseis->{_note} . ' -S' . $Synseis->{_input_source_filename};
177 }
178 }
179  
180 =head2 sub reflec_coef_depth
181  
182  
183 =cut
184  
185 sub reflec_coef_depth {
186 my ( $variable, $reflec_coef_depth ) = @_;
187 if ($reflec_coef_depth) {
188 $Synseis->{_reflec_coef_depth} = $reflec_coef_depth;
189 $Synseis->{_Step} =
190 $Synseis->{_Step} . ' -CZ' . $Synseis->{_reflec_coef_depth};
191 $Synseis->{_note} =
192 $Synseis->{_note} . ' -CZ' . $Synseis->{_reflec_coef_depth};
193 }
194 }
195  
196 =head2 sub reflec_coef_time
197  
198 =cut
199  
200 sub reflec_coef_time {
201 my ( $variable, $reflec_coef_time ) = @_;
202 if ($reflec_coef_time) {
203 $Synseis->{_reflec_coef_time} = $reflec_coef_time;
204 $Synseis->{_Step} =
205 $Synseis->{_Step} . ' -CT' . $Synseis->{_reflec_coef_time};
206 $Synseis->{_note} =
207 $Synseis->{_note} . ' -CT' . $Synseis->{_reflec_coef_time};
208 }
209 }
210  
211 =head2 sub time_sampling_interval
212  
213  
214 =cut
215  
216 sub time_sampling_interval {
217 my ( $variable, $time_sampling_interval ) = @_;
218 if ($time_sampling_interval) {
219 $Synseis->{_time_sampling_interval} = $time_sampling_interval;
220 $Synseis->{_Step} =
221 $Synseis->{_Step} . ' -I' . $Synseis->{_time_sampling_interval};
222 $Synseis->{_note} =
223 $Synseis->{_note} . ' -I' . $Synseis->{_time_sampling_interval};
224 }
225 }
226  
227 =head2 sub depth_sampling_interval
228  
229  
230 =cut
231  
232 sub depth_sampling_interval {
233 my ( $variable, $depth_sampling_interval ) = @_;
234 if ($depth_sampling_interval) {
235 $Synseis->{_depth_sampling_interval} = $depth_sampling_interval;
236 $Synseis->{_Step} =
237 $Synseis->{_Step} . ' -IZ' . $Synseis->{_depth_sampling_interval};
238 $Synseis->{_note} =
239 $Synseis->{_note} . ' -IZ' . $Synseis->{_depth_sampling_interval};
240 }
241 }
242  
243 =head2 sub reg_density_file
244  
245  
246 =cut
247  
248 sub reg_density_file {
249 my ( $variable, $reg_density_file ) = @_;
250 if ($reg_density_file) {
251 $Synseis->{_reg_density_file} = $reg_density_file;
252 $Synseis->{_Step} =
253 $Synseis->{_Step} . ' -LD' . $Synseis->{_reg_density_file};
254 $Synseis->{_note} =
255 $Synseis->{_note} . ' -LD' . $Synseis->{_reg_density_file};
256 }
257 }
258  
259 =head2 sub reg_velocity_file
260  
261  
262 =cut
263  
264 sub reg_velocity_file {
265 my ( $variable, $reg_velocity_file ) = @_;
266 if ($reg_velocity_file) {
267 $Synseis->{_reg_velocity_file} = $reg_velocity_file;
268 $Synseis->{_Step} =
269 $Synseis->{_Step} . ' -LV' . $Synseis->{_reg_velocity_file};
270 $Synseis->{_note} =
271 $Synseis->{_note} . ' -LV' . $Synseis->{_reg_velocity_file};
272 }
273 }
274  
275 =head2 sub output_source
276  
277  
278 =cut
279  
280 sub output_source {
281 my ( $variable, $output_source ) = @_;
282 if ($output_source) {
283 $Synseis->{_output_source} = $output_source;
284 $Synseis->{_Step} =
285 $Synseis->{_Step} . ' -Ro' . $Synseis->{_output_source};
286 $Synseis->{_note} =
287 $Synseis->{_note} . ' -Ro' . $Synseis->{_output_source};
288 }
289 }
290  
291 =head2 sub zrhov_filename
292  
293  
294 =cut
295  
296 sub zrhov_filename {
297 my ( $variable, $zrhov_filename ) = @_;
298 if ($zrhov_filename) {
299 $Synseis->{_zrhov_filename} = $zrhov_filename;
300 $Synseis->{_Step} =
301 $Synseis->{_Step} . ' -Z' . $Synseis->{_zrhov_filename};
302 $Synseis->{_note} =
303 $Synseis->{_note} . ' -Z' . $Synseis->{_zrhov_filename};
304 }
305 }
306  
307 =head2 sub water_depth
308  
309  
310 =cut
311  
312 sub water_depth {
313 my ( $variable, $water_depth ) = @_;
314 if ($water_depth) {
315 $Synseis->{_water_depth} = $water_depth;
316 $Synseis->{_Step} =
317 $Synseis->{_Step} . ' -W' . $Synseis->{_water_depth};
318 $Synseis->{_note} =
319 $Synseis->{_note} . ' -W' . $Synseis->{_water_depth};
320 }
321 }
322  
323 =head2 sub Ricker_file
324  
325  
326 =cut
327  
328 sub Ricker_file {
329 my ( $variable, $Ricker_file ) = @_;
330 if ($Ricker_file) {
331 $Synseis->{_Ricker_file} = $Ricker_file;
332 $Synseis->{_Step} =
333 $Synseis->{_Step} . ' -Ao' . $Synseis->{_Ricker_file};
334 $Synseis->{_note} =
335 $Synseis->{_note} . ' -Ao' . $Synseis->{_Ricker_file};
336 }
337 }
338  
339 =head2 sub Ricker_endtime
340  
341  
342 =cut
343  
344 sub Ricker_endtime {
345 my ( $variable, $Ricker_endtime ) = @_;
346 if ($Ricker_endtime) {
347 $Synseis->{_Ricker_endtime} = $Ricker_endtime;
348 $Synseis->{_Step} =
349 $Synseis->{_Step} . ' -AE' . $Synseis->{_Ricker_endtime};
350 $Synseis->{_note} =
351 $Synseis->{_note} . ' -AE' . $Synseis->{_Ricker_endtime};
352 }
353 }
354  
355 =head2 sub Ricker_frequency
356  
357  
358 =cut
359  
360 sub Ricker_frequency {
361 my ( $variable, $Ricker_frequency ) = @_;
362 if ($Ricker_frequency) {
363 $Synseis->{_Ricker_frequency} = $Ricker_frequency;
364 $Synseis->{_Step} =
365 $Synseis->{_Step} . ' -AF' . $Synseis->{_Ricker_frequency};
366 $Synseis->{_note} =
367 $Synseis->{_note} . ' -AF' . $Synseis->{_Ricker_frequency};
368 }
369 }
370  
371 =head2 sub verbose
372  
373  
374 =cut
375  
376 sub verbose {
377 my ( $self, $verbose ) = @_;
378 if ($verbose) {
379 $Synseis->{_verbose} = '';
380 $Synseis->{_Step} =
381 $Synseis->{_Step} . ' -V' . $Synseis->{_verbose};
382 $Synseis->{_note} =
383 $Synseis->{_note} . ' -V' . $Synseis->{_verbose};
384 }
385 }
386  
387 =head2 sub note
388  
389 =cut
390  
391 sub note {
392 my ( $variable, $note ) = @_;
393 $Synseis->{_note} = $Synseis->{_note};
394 return $Synseis->{_note};
395 }
396  
397 =head2 sub Step
398  
399 =cut
400  
401 sub Step {
402 my ( $variable, $Step ) = @_;
403 $Synseis->{_Step} = 'synseis ' . $Synseis->{_Step};
404 $Synseis->{_note} = 'synseis ' . $Synseis->{_note};
405 return $Synseis->{_Step};
406 }
407  
408 1;