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

filter: Statementstmt 0.0% 0 / 112 Branchbran 0.0% 0 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 19 Podpod 0.0% 0 / 15 totaltotal 0.0% 0 / 168 CC 12 SCAR 16.0
CC
12
Cov
0%
amax
6.0
amin
6.0
bwh
6.0
CRAP 4.9
1 package App::SeismicUnixGui::sunix::migration::sumiggbzo;
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 SUMIGGBZO - MIGration via Gaussian Beams of Zero-Offset SU data
25  
26  
27  
28 sumiggbzo <infile >outfile vfile= nz= [optional parameters]
29  
30  
31  
32 Required Parameters:
33  
34 vfile= name of file containing v(z,x)
35  
36 nz= number of depth samples
37  
38  
39  
40 Optional Parameters:
41  
42 dt=from header time sampling interval
43  
44 dx=from header(d2) or 1.0 spatial sampling interval
45  
46 dz=1.0 depth sampling interval
47  
48 fmin=0.025/dt minimum frequency
49  
50 fmax=10*fmin maximum frequency
51  
52 amin=-amax minimum emergence angle; must be > -90 degrees
53  
54 amax=60 maximum emergence angle; must be < 90 degrees
55  
56 bwh=0.5*vavg/fmin beam half-width; vavg denotes average velocity
57  
58 verbose=0 =0 silent; =1 chatty
59  
60  
61  
62 Note: spatial units of v(z,x) must be the same as those of dx.
63  
64 v(z,x) is represented numerically in C-style binary floats v[x][z],
65  
66 where the depth direction is the fast direction in the data. Such
67  
68 models can be created with unif2 or makevel.
69  
70  
71  
72 (In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
73  
74 denotes a v(z,x) array, the opposite of what Matlab and Fortran
75  
76 programmers may expect.) ",
77  
78  
79  
80 Caveat:
81  
82 In the event of a "Segmentation Violation" try reducing the value of
83  
84 the "bwh" parameter. Run program with verbose=1 do see the default
85  
86 value.
87  
88  
89  
90 Credits:
91  
92  
93  
94 CWP: Dave Hale (algorithm), Jack K. Cohen, and John Stockwell
95  
96 (reformatting for SU)
97  
98  
99  
100  
101  
102 =head2 User's notes (Juan Lorenzo)
103 untested
104  
105 =cut
106  
107  
108 =head2 CHANGES and their DATES
109  
110 =cut
111  
112 use Moose;
113 our $VERSION = '0.0.1';
114  
115  
116 =head2 Import packages
117  
118 =cut
119  
120 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
121  
122 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
123 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
124  
125  
126 =head2 instantiation of packages
127  
128 =cut
129  
130 my $get = L_SU_global_constants->new();
131 my $Project = Project_config->new();
132 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
133 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
134 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
135  
136 my $PS_SEISMIC = $Project->PS_SEISMIC();
137  
138 my $var = $get->var();
139 my $on = $var->{_on};
140 my $off = $var->{_off};
141 my $true = $var->{_true};
142 my $false = $var->{_false};
143 my $empty_string = $var->{_empty_string};
144  
145 =head2 Encapsulated
146 hash of private variables
147  
148 =cut
149  
150 my $sumiggbzo = {
151 _amax => '',
152 _amin => '',
153 _bwh => '',
154 _dt => '',
155 _dx => '',
156 _dz => '',
157 _fmax => '',
158 _fmin => '',
159 _nz => '',
160 _verbose => '',
161 _vfile => '',
162 _Step => '',
163 _note => '',
164  
165 };
166  
167 =head2 sub Step
168  
169 collects switches and assembles bash instructions
170 by adding the program name
171  
172 =cut
173  
174 sub Step {
175  
176 $sumiggbzo->{_Step} = 'sumiggbzo'.$sumiggbzo->{_Step};
177 return ( $sumiggbzo->{_Step} );
178  
179 }
180  
181  
182 =head2 sub note
183  
184 collects switches and assembles bash instructions
185 by adding the program name
186  
187 =cut
188  
189 sub note {
190  
191 $sumiggbzo->{_note} = 'sumiggbzo'.$sumiggbzo->{_note};
192 return ( $sumiggbzo->{_note} );
193  
194 }
195  
196  
197  
198 =head2 sub clear
199  
200 =cut
201  
202 sub clear {
203  
204 $sumiggbzo->{_amax} = '';
205 $sumiggbzo->{_amin} = '';
206 $sumiggbzo->{_bwh} = '';
207 $sumiggbzo->{_dt} = '';
208 $sumiggbzo->{_dx} = '';
209 $sumiggbzo->{_dz} = '';
210 $sumiggbzo->{_fmax} = '';
211 $sumiggbzo->{_fmin} = '';
212 $sumiggbzo->{_nz} = '';
213 $sumiggbzo->{_verbose} = '';
214 $sumiggbzo->{_vfile} = '';
215 $sumiggbzo->{_Step} = '';
216 $sumiggbzo->{_note} = '';
217 }
218  
219  
220 =head2 sub amax
221  
222  
223 =cut
224  
225 sub amax {
226  
227 my ( $self,$amax ) = @_;
228 if ( $amax ne $empty_string ) {
229  
230 $sumiggbzo->{_amax} = $amax;
231 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' amax='.$sumiggbzo->{_amax};
232 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' amax='.$sumiggbzo->{_amax};
233  
234 } else {
235 print("sumiggbzo, amax, missing amax,\n");
236 }
237 }
238  
239  
240 =head2 sub amin
241  
242  
243 =cut
244  
245 sub amin {
246  
247 my ( $self,$amin ) = @_;
248 if ( $amin ne $empty_string ) {
249  
250 $sumiggbzo->{_amin} = $amin;
251 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' amin='.$sumiggbzo->{_amin};
252 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' amin='.$sumiggbzo->{_amin};
253  
254 } else {
255 print("sumiggbzo, amin, missing amin,\n");
256 }
257 }
258  
259  
260 =head2 sub bwh
261  
262  
263 =cut
264  
265 sub bwh {
266  
267 my ( $self,$bwh ) = @_;
268 if ( $bwh ne $empty_string ) {
269  
270 $sumiggbzo->{_bwh} = $bwh;
271 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' bwh='.$sumiggbzo->{_bwh};
272 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' bwh='.$sumiggbzo->{_bwh};
273  
274 } else {
275 print("sumiggbzo, bwh, missing bwh,\n");
276 }
277 }
278  
279  
280 =head2 sub dt
281  
282  
283 =cut
284  
285 sub dt {
286  
287 my ( $self,$dt ) = @_;
288 if ( $dt ne $empty_string ) {
289  
290 $sumiggbzo->{_dt} = $dt;
291 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' dt='.$sumiggbzo->{_dt};
292 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' dt='.$sumiggbzo->{_dt};
293  
294 } else {
295 print("sumiggbzo, dt, missing dt,\n");
296 }
297 }
298  
299  
300 =head2 sub dx
301  
302  
303 =cut
304  
305 sub dx {
306  
307 my ( $self,$dx ) = @_;
308 if ( $dx ne $empty_string ) {
309  
310 $sumiggbzo->{_dx} = $dx;
311 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' dx='.$sumiggbzo->{_dx};
312 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' dx='.$sumiggbzo->{_dx};
313  
314 } else {
315 print("sumiggbzo, dx, missing dx,\n");
316 }
317 }
318  
319  
320 =head2 sub dz
321  
322  
323 =cut
324  
325 sub dz {
326  
327 my ( $self,$dz ) = @_;
328 if ( $dz ne $empty_string ) {
329  
330 $sumiggbzo->{_dz} = $dz;
331 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' dz='.$sumiggbzo->{_dz};
332 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' dz='.$sumiggbzo->{_dz};
333  
334 } else {
335 print("sumiggbzo, dz, missing dz,\n");
336 }
337 }
338  
339  
340 =head2 sub fmax
341  
342  
343 =cut
344  
345 sub fmax {
346  
347 my ( $self,$fmax ) = @_;
348 if ( $fmax ne $empty_string ) {
349  
350 $sumiggbzo->{_fmax} = $fmax;
351 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' fmax='.$sumiggbzo->{_fmax};
352 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' fmax='.$sumiggbzo->{_fmax};
353  
354 } else {
355 print("sumiggbzo, fmax, missing fmax,\n");
356 }
357 }
358  
359  
360 =head2 sub fmin
361  
362  
363 =cut
364  
365 sub fmin {
366  
367 my ( $self,$fmin ) = @_;
368 if ( $fmin ne $empty_string ) {
369  
370 $sumiggbzo->{_fmin} = $fmin;
371 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' fmin='.$sumiggbzo->{_fmin};
372 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' fmin='.$sumiggbzo->{_fmin};
373  
374 } else {
375 print("sumiggbzo, fmin, missing fmin,\n");
376 }
377 }
378  
379  
380 =head2 sub nz
381  
382  
383 =cut
384  
385 sub nz {
386  
387 my ( $self,$nz ) = @_;
388 if ( $nz ne $empty_string ) {
389  
390 $sumiggbzo->{_nz} = $nz;
391 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' nz='.$sumiggbzo->{_nz};
392 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' nz='.$sumiggbzo->{_nz};
393  
394 } else {
395 print("sumiggbzo, nz, missing nz,\n");
396 }
397 }
398  
399  
400 =head2 sub verbose
401  
402  
403 =cut
404  
405 sub verbose {
406  
407 my ( $self,$verbose ) = @_;
408 if ( $verbose ne $empty_string ) {
409  
410 $sumiggbzo->{_verbose} = $verbose;
411 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' verbose='.$sumiggbzo->{_verbose};
412 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' verbose='.$sumiggbzo->{_verbose};
413  
414 } else {
415 print("sumiggbzo, verbose, missing verbose,\n");
416 }
417 }
418  
419  
420 =head2 sub vfile
421  
422  
423 =cut
424  
425 sub vfile {
426  
427 my ( $self,$vfile ) = @_;
428 if ( $vfile ne $empty_string ) {
429  
430 $sumiggbzo->{_vfile} = $vfile;
431 $sumiggbzo->{_note} = $sumiggbzo->{_note}.' vfile='.$sumiggbzo->{_vfile};
432 $sumiggbzo->{_Step} = $sumiggbzo->{_Step}.' vfile='.$sumiggbzo->{_vfile};
433  
434 } else {
435 print("sumiggbzo, vfile, missing vfile,\n");
436 }
437 }
438  
439  
440 =head2 sub get_max_index
441  
442 max index = number of input variables -1
443
444 =cut
445
446 sub get_max_index {
447 my ($self) = @_;
448 my $max_index = 10;
449  
450 return($max_index);
451 }
452
453
454 1;