lib/App/SeismicUnixGui/sunix/migration/sudatumfd.pm untested

filter: Statementstmt 0.0% 0 / 133 Branchbran 0.0% 0 / 28 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 22 Podpod 0.0% 0 / 18 totaltotal 0.0% 0 / 201 CC 15 SCAR 16.3
CC
15
Cov
0%
buff
6.0
dt
6.0
dx
6.0
CRAP 5.1
1 package App::SeismicUnixGui::sunix::migration::sudatumfd;
2  
3 =head2 SYNOPSIS
4  
5 PERL PROGRAM NAME:
6  
7 AUTHOR: Juan Lorenzo (Perl module only)
8  
9 DATE:
10  
11 DESCRIPTION:
12  
13 Version:
14  
15 =head2 USE
16  
17 =head3 NOTES
18  
19 =head4 Examples
20  
21 =head2 SYNOPSIS
22  
23 =head3 SEISMIC UNIX NOTES
24 SUDATUMFD - 2D zero-offset Finite Difference acoustic wave-equation
25  
26 DATUMing
27  
28  
29  
30 sudatumfd <stdin > stdout [optional parameters]
31  
32  
33  
34 Required parameters:
35  
36  
37  
38 nt= number of time samples on each trace
39  
40 nx= number of receivers per shot gather
41  
42 nsx= number of shot gathers
43  
44 nz= number of downward continuation depth steps
45  
46 dz= depth sampling interval (in meters)
47  
48 mx= number of horizontal samples in the velocity model
49  
50 mz= number of vertical samples in the velocity model
51  
52 vfile1= velocity file used for thin-lens term
53  
54 vfile2= velocity file used for diffraction term
55  
56 dx= horizontal sampling interval (in meters)
57  
58  
59  
60 Optional parameters:
61  
62  
63  
64 dt=.004 time sampling interval (in seconds)
65  
66 buff=5 number of zero traces added to each side of each
67  
68 shot gather as a pad
69  
70 tap_len=5 taper length (in number of traces)
71  
72 x_0=0.0 x coordinate of leftmost position in velocity model
73  
74  
75  
76 Notes:
77  
78 The algorithm is a 45-degree implicit-finite-difference scheme based
79  
80 on the one-way wave equation. It works on poststack (zero-offset)
81  
82 data only. The two velocity files, vfile1 and vfile2, are binary
83  
84 files containing floats with the format v[ix][iz]. There are two
85  
86 potentially different velocity files for the thin-lens and
87  
88 diffraction terms to allow for the use of a zero-velocity layer
89  
90 which allows for datuming from an irregular surface.
91  
92  
93  
94 Source and receiver locations must be set in the header values in
95  
96 order for the datuming to work properly. The leftmost position of
97  
98 of the velocity models given in vfile1 and vfile2 must also be given.
99  
100  
101  
102  
103  
104  
105  
106
107  
108 Author: Chris Robinson, 10/16/00, CWP, Colorado School of Mines
109  
110  
111  
112  
113  
114 References:
115  
116 Beasley, C., and Lynn, W., 1992, The zero-velocity layer: migration
117  
118 from irregular surfaces: Geophysics, 57, 1435-1443.
119  
120  
121  
122 Claerbout, J. F., 1985, Imaging the earth's interior: Blackwell
123  
124 Scientific Publications.
125  
126  
127  
128  
129  
130  
131  
132 =head2 User's notes (Juan Lorenzo)
133 untested
134  
135 =cut
136  
137  
138 =head2 CHANGES and their DATES
139  
140 =cut
141  
142 use Moose;
143 our $VERSION = '0.0.1';
144  
145  
146 =head2 Import packages
147  
148 =cut
149  
150 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
151  
152 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
153 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
154  
155  
156 =head2 instantiation of packages
157  
158 =cut
159  
160 my $get = L_SU_global_constants->new();
161 my $Project = Project_config->new();
162 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
163 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
164 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
165  
166 my $PS_SEISMIC = $Project->PS_SEISMIC();
167  
168 my $var = $get->var();
169 my $on = $var->{_on};
170 my $off = $var->{_off};
171 my $true = $var->{_true};
172 my $false = $var->{_false};
173 my $empty_string = $var->{_empty_string};
174  
175 =head2 Encapsulated
176 hash of private variables
177  
178 =cut
179  
180 my $sudatumfd = {
181 _buff => '',
182 _dt => '',
183 _dx => '',
184 _dz => '',
185 _mx => '',
186 _mz => '',
187 _nsx => '',
188 _nt => '',
189 _nx => '',
190 _nz => '',
191 _tap_len => '',
192 _vfile1 => '',
193 _vfile2 => '',
194 _x_0 => '',
195 _Step => '',
196 _note => '',
197  
198 };
199  
200 =head2 sub Step
201  
202 collects switches and assembles bash instructions
203 by adding the program name
204  
205 =cut
206  
207 sub Step {
208  
209 $sudatumfd->{_Step} = 'sudatumfd'.$sudatumfd->{_Step};
210 return ( $sudatumfd->{_Step} );
211  
212 }
213  
214  
215 =head2 sub note
216  
217 collects switches and assembles bash instructions
218 by adding the program name
219  
220 =cut
221  
222 sub note {
223  
224 $sudatumfd->{_note} = 'sudatumfd'.$sudatumfd->{_note};
225 return ( $sudatumfd->{_note} );
226  
227 }
228  
229  
230  
231 =head2 sub clear
232  
233 =cut
234  
235 sub clear {
236  
237 $sudatumfd->{_buff} = '';
238 $sudatumfd->{_dt} = '';
239 $sudatumfd->{_dx} = '';
240 $sudatumfd->{_dz} = '';
241 $sudatumfd->{_mx} = '';
242 $sudatumfd->{_mz} = '';
243 $sudatumfd->{_nsx} = '';
244 $sudatumfd->{_nt} = '';
245 $sudatumfd->{_nx} = '';
246 $sudatumfd->{_nz} = '';
247 $sudatumfd->{_tap_len} = '';
248 $sudatumfd->{_vfile1} = '';
249 $sudatumfd->{_vfile2} = '';
250 $sudatumfd->{_x_0} = '';
251 $sudatumfd->{_Step} = '';
252 $sudatumfd->{_note} = '';
253 }
254  
255  
256 =head2 sub buff
257  
258  
259 =cut
260  
261 sub buff {
262  
263 my ( $self,$buff ) = @_;
264 if ( $buff ne $empty_string ) {
265  
266 $sudatumfd->{_buff} = $buff;
267 $sudatumfd->{_note} = $sudatumfd->{_note}.' buff='.$sudatumfd->{_buff};
268 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' buff='.$sudatumfd->{_buff};
269  
270 } else {
271 print("sudatumfd, buff, missing buff,\n");
272 }
273 }
274  
275  
276 =head2 sub dt
277  
278  
279 =cut
280  
281 sub dt {
282  
283 my ( $self,$dt ) = @_;
284 if ( $dt ne $empty_string ) {
285  
286 $sudatumfd->{_dt} = $dt;
287 $sudatumfd->{_note} = $sudatumfd->{_note}.' dt='.$sudatumfd->{_dt};
288 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' dt='.$sudatumfd->{_dt};
289  
290 } else {
291 print("sudatumfd, dt, missing dt,\n");
292 }
293 }
294  
295  
296 =head2 sub dx
297  
298  
299 =cut
300  
301 sub dx {
302  
303 my ( $self,$dx ) = @_;
304 if ( $dx ne $empty_string ) {
305  
306 $sudatumfd->{_dx} = $dx;
307 $sudatumfd->{_note} = $sudatumfd->{_note}.' dx='.$sudatumfd->{_dx};
308 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' dx='.$sudatumfd->{_dx};
309  
310 } else {
311 print("sudatumfd, dx, missing dx,\n");
312 }
313 }
314  
315  
316 =head2 sub dz
317  
318  
319 =cut
320  
321 sub dz {
322  
323 my ( $self,$dz ) = @_;
324 if ( $dz ne $empty_string ) {
325  
326 $sudatumfd->{_dz} = $dz;
327 $sudatumfd->{_note} = $sudatumfd->{_note}.' dz='.$sudatumfd->{_dz};
328 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' dz='.$sudatumfd->{_dz};
329  
330 } else {
331 print("sudatumfd, dz, missing dz,\n");
332 }
333 }
334  
335  
336 =head2 sub mx
337  
338  
339 =cut
340  
341 sub mx {
342  
343 my ( $self,$mx ) = @_;
344 if ( $mx ne $empty_string ) {
345  
346 $sudatumfd->{_mx} = $mx;
347 $sudatumfd->{_note} = $sudatumfd->{_note}.' mx='.$sudatumfd->{_mx};
348 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' mx='.$sudatumfd->{_mx};
349  
350 } else {
351 print("sudatumfd, mx, missing mx,\n");
352 }
353 }
354  
355  
356 =head2 sub mz
357  
358  
359 =cut
360  
361 sub mz {
362  
363 my ( $self,$mz ) = @_;
364 if ( $mz ne $empty_string ) {
365  
366 $sudatumfd->{_mz} = $mz;
367 $sudatumfd->{_note} = $sudatumfd->{_note}.' mz='.$sudatumfd->{_mz};
368 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' mz='.$sudatumfd->{_mz};
369  
370 } else {
371 print("sudatumfd, mz, missing mz,\n");
372 }
373 }
374  
375  
376 =head2 sub nsx
377  
378  
379 =cut
380  
381 sub nsx {
382  
383 my ( $self,$nsx ) = @_;
384 if ( $nsx ne $empty_string ) {
385  
386 $sudatumfd->{_nsx} = $nsx;
387 $sudatumfd->{_note} = $sudatumfd->{_note}.' nsx='.$sudatumfd->{_nsx};
388 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' nsx='.$sudatumfd->{_nsx};
389  
390 } else {
391 print("sudatumfd, nsx, missing nsx,\n");
392 }
393 }
394  
395  
396 =head2 sub nt
397  
398  
399 =cut
400  
401 sub nt {
402  
403 my ( $self,$nt ) = @_;
404 if ( $nt ne $empty_string ) {
405  
406 $sudatumfd->{_nt} = $nt;
407 $sudatumfd->{_note} = $sudatumfd->{_note}.' nt='.$sudatumfd->{_nt};
408 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' nt='.$sudatumfd->{_nt};
409  
410 } else {
411 print("sudatumfd, nt, missing nt,\n");
412 }
413 }
414  
415  
416 =head2 sub nx
417  
418  
419 =cut
420  
421 sub nx {
422  
423 my ( $self,$nx ) = @_;
424 if ( $nx ne $empty_string ) {
425  
426 $sudatumfd->{_nx} = $nx;
427 $sudatumfd->{_note} = $sudatumfd->{_note}.' nx='.$sudatumfd->{_nx};
428 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' nx='.$sudatumfd->{_nx};
429  
430 } else {
431 print("sudatumfd, nx, missing nx,\n");
432 }
433 }
434  
435  
436 =head2 sub nz
437  
438  
439 =cut
440  
441 sub nz {
442  
443 my ( $self,$nz ) = @_;
444 if ( $nz ne $empty_string ) {
445  
446 $sudatumfd->{_nz} = $nz;
447 $sudatumfd->{_note} = $sudatumfd->{_note}.' nz='.$sudatumfd->{_nz};
448 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' nz='.$sudatumfd->{_nz};
449  
450 } else {
451 print("sudatumfd, nz, missing nz,\n");
452 }
453 }
454  
455  
456 =head2 sub tap_len
457  
458  
459 =cut
460  
461 sub tap_len {
462  
463 my ( $self,$tap_len ) = @_;
464 if ( $tap_len ne $empty_string ) {
465  
466 $sudatumfd->{_tap_len} = $tap_len;
467 $sudatumfd->{_note} = $sudatumfd->{_note}.' tap_len='.$sudatumfd->{_tap_len};
468 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' tap_len='.$sudatumfd->{_tap_len};
469  
470 } else {
471 print("sudatumfd, tap_len, missing tap_len,\n");
472 }
473 }
474  
475  
476 =head2 sub vfile1
477  
478  
479 =cut
480  
481 sub vfile1 {
482  
483 my ( $self,$vfile1 ) = @_;
484 if ( $vfile1 ne $empty_string ) {
485  
486 $sudatumfd->{_vfile1} = $vfile1;
487 $sudatumfd->{_note} = $sudatumfd->{_note}.' vfile1='.$sudatumfd->{_vfile1};
488 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' vfile1='.$sudatumfd->{_vfile1};
489  
490 } else {
491 print("sudatumfd, vfile1, missing vfile1,\n");
492 }
493 }
494  
495  
496 =head2 sub vfile2
497  
498  
499 =cut
500  
501 sub vfile2 {
502  
503 my ( $self,$vfile2 ) = @_;
504 if ( $vfile2 ne $empty_string ) {
505  
506 $sudatumfd->{_vfile2} = $vfile2;
507 $sudatumfd->{_note} = $sudatumfd->{_note}.' vfile2='.$sudatumfd->{_vfile2};
508 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' vfile2='.$sudatumfd->{_vfile2};
509  
510 } else {
511 print("sudatumfd, vfile2, missing vfile2,\n");
512 }
513 }
514  
515  
516 =head2 sub x_0
517  
518  
519 =cut
520  
521 sub x_0 {
522  
523 my ( $self,$x_0 ) = @_;
524 if ( $x_0 ne $empty_string ) {
525  
526 $sudatumfd->{_x_0} = $x_0;
527 $sudatumfd->{_note} = $sudatumfd->{_note}.' x_0='.$sudatumfd->{_x_0};
528 $sudatumfd->{_Step} = $sudatumfd->{_Step}.' x_0='.$sudatumfd->{_x_0};
529  
530 } else {
531 print("sudatumfd, x_0, missing x_0,\n");
532 }
533 }
534  
535  
536 =head2 sub get_max_index
537  
538 max index = number of input variables -1
539
540 =cut
541
542 sub get_max_index {
543 my ($self) = @_;
544 my $max_index = 13;
545  
546 return($max_index);
547 }
548
549
550 1;