lib/App/SeismicUnixGui/sunix/model/susyncz.pm untested

filter: Statementstmt 0.0% 0 / 118 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 20 Podpod 0.0% 0 / 16 totaltotal 0.0% 0 / 178 CC 13 SCAR 16.1
CC
13
Cov
0%
dip
6.0
dt
6.0
dx
6.0
CRAP 5.0
1 package App::SeismicUnixGui::sunix::model::susyncz;
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 SUSYNCZ - SYNthetic seismograms for piecewise constant V(Z) function
25  
26 True amplitude (primaries only) modeling for 2.5D
27  
28  
29  
30 susyncz > outfile [parameters]
31  
32  
33  
34 Required parameters:
35  
36 none
37  
38  
39  
40 Optional Parameters:
41  
42 ninf=4 number of interfaces (not including upper surface)
43  
44 dip=5*i dips of interfaces in degrees (i=1,2,3,4)
45  
46 zint=100*i z-intercepts of interfaces at x=0 (i=1,2,3,4)
47  
48 v=1500+ 500*i velocities below surface & interfaces (i=0,1,2,3,4)
49  
50 rho=1,1,1,1,1 densities below surface & interfaces (i=0,1,2,3,4)
51  
52 nline=1 number of (identical) lines
53  
54 ntr=32 number of traces
55  
56 dx=10 trace interval
57  
58 tdelay=0 delay in recording time after source initiation
59  
60 dt=0.004 time interval
61  
62 nt=128 number of time samples
63  
64  
65  
66 Notes:
67  
68 The original purpose of this code was to create some nontrivial
69  
70 data for Brian Sumner's CZ suite.
71  
72  
73  
74 The program produces zero-offset data over dipping reflectors.
75  
76  
77  
78 In the original fortran code, some arrays had the index
79  
80 interval 1:ninf, as a natural way to index over the subsurface
81  
82 reflectors. This indexing was preserved in this C translation.
83  
84 Consequently, some arrays in the code do not use the 0 "slot".
85  
86  
87  
88 Example:
89  
90 susyncz | sufilter | sugain tpow=1 | display_program
91  
92  
93  
94 Trace header fields set: tracl, ns, dt, delrt, ntr, sx, gx
95  
96  
97  
98  
99  
100 Credits:
101  
102 CWP: Brian Sumner, 1983, 1985, Fortran design and code
103  
104 CWP: Stockwell & Cohen, 1995, translation to C
105  
106  
107  
108  
109  
110  
111  
112 =head2 User's notes (Juan Lorenzo)
113 untested
114  
115 =cut
116  
117  
118 =head2 CHANGES and their DATES
119  
120 =cut
121  
122 use Moose;
123 our $VERSION = '0.0.1';
124  
125  
126 =head2 Import packages
127  
128 =cut
129  
130 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
131  
132 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
133 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
134  
135  
136 =head2 instantiation of packages
137  
138 =cut
139  
140 my $get = L_SU_global_constants->new();
141 my $Project = Project_config->new();
142 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
143 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
144 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
145  
146 my $var = $get->var();
147 my $on = $var->{_on};
148 my $off = $var->{_off};
149 my $true = $var->{_true};
150 my $false = $var->{_false};
151 my $empty_string = $var->{_empty_string};
152  
153 =head2 Encapsulated
154 hash of private variables
155  
156 =cut
157  
158 my $susyncz = {
159 _dip => '',
160 _dt => '',
161 _dx => '',
162 _ninf => '',
163 _nline => '',
164 _nt => '',
165 _ntr => '',
166 _rho => '',
167 _tdelay => '',
168 _tpow => '',
169 _v => '',
170 _zint => '',
171 _Step => '',
172 _note => '',
173  
174 };
175  
176 =head2 sub Step
177  
178 collects switches and assembles bash instructions
179 by adding the program name
180  
181 =cut
182  
183 sub Step {
184  
185 $susyncz->{_Step} = 'susyncz'.$susyncz->{_Step};
186 return ( $susyncz->{_Step} );
187  
188 }
189  
190  
191 =head2 sub note
192  
193 collects switches and assembles bash instructions
194 by adding the program name
195  
196 =cut
197  
198 sub note {
199  
200 $susyncz->{_note} = 'susyncz'.$susyncz->{_note};
201 return ( $susyncz->{_note} );
202  
203 }
204  
205  
206  
207 =head2 sub clear
208  
209 =cut
210  
211 sub clear {
212  
213 $susyncz->{_dip} = '';
214 $susyncz->{_dt} = '';
215 $susyncz->{_dx} = '';
216 $susyncz->{_ninf} = '';
217 $susyncz->{_nline} = '';
218 $susyncz->{_nt} = '';
219 $susyncz->{_ntr} = '';
220 $susyncz->{_rho} = '';
221 $susyncz->{_tdelay} = '';
222 $susyncz->{_tpow} = '';
223 $susyncz->{_v} = '';
224 $susyncz->{_zint} = '';
225 $susyncz->{_Step} = '';
226 $susyncz->{_note} = '';
227 }
228  
229  
230 =head2 sub dip
231  
232  
233 =cut
234  
235 sub dip {
236  
237 my ( $self,$dip ) = @_;
238 if ( $dip ne $empty_string ) {
239  
240 $susyncz->{_dip} = $dip;
241 $susyncz->{_note} = $susyncz->{_note}.' dip='.$susyncz->{_dip};
242 $susyncz->{_Step} = $susyncz->{_Step}.' dip='.$susyncz->{_dip};
243  
244 } else {
245 print("susyncz, dip, missing dip,\n");
246 }
247 }
248  
249  
250 =head2 sub dt
251  
252  
253 =cut
254  
255 sub dt {
256  
257 my ( $self,$dt ) = @_;
258 if ( $dt ne $empty_string ) {
259  
260 $susyncz->{_dt} = $dt;
261 $susyncz->{_note} = $susyncz->{_note}.' dt='.$susyncz->{_dt};
262 $susyncz->{_Step} = $susyncz->{_Step}.' dt='.$susyncz->{_dt};
263  
264 } else {
265 print("susyncz, dt, missing dt,\n");
266 }
267 }
268  
269  
270 =head2 sub dx
271  
272  
273 =cut
274  
275 sub dx {
276  
277 my ( $self,$dx ) = @_;
278 if ( $dx ne $empty_string ) {
279  
280 $susyncz->{_dx} = $dx;
281 $susyncz->{_note} = $susyncz->{_note}.' dx='.$susyncz->{_dx};
282 $susyncz->{_Step} = $susyncz->{_Step}.' dx='.$susyncz->{_dx};
283  
284 } else {
285 print("susyncz, dx, missing dx,\n");
286 }
287 }
288  
289  
290 =head2 sub ninf
291  
292  
293 =cut
294  
295 sub ninf {
296  
297 my ( $self,$ninf ) = @_;
298 if ( $ninf ne $empty_string ) {
299  
300 $susyncz->{_ninf} = $ninf;
301 $susyncz->{_note} = $susyncz->{_note}.' ninf='.$susyncz->{_ninf};
302 $susyncz->{_Step} = $susyncz->{_Step}.' ninf='.$susyncz->{_ninf};
303  
304 } else {
305 print("susyncz, ninf, missing ninf,\n");
306 }
307 }
308  
309  
310 =head2 sub nline
311  
312  
313 =cut
314  
315 sub nline {
316  
317 my ( $self,$nline ) = @_;
318 if ( $nline ne $empty_string ) {
319  
320 $susyncz->{_nline} = $nline;
321 $susyncz->{_note} = $susyncz->{_note}.' nline='.$susyncz->{_nline};
322 $susyncz->{_Step} = $susyncz->{_Step}.' nline='.$susyncz->{_nline};
323  
324 } else {
325 print("susyncz, nline, missing nline,\n");
326 }
327 }
328  
329  
330 =head2 sub nt
331  
332  
333 =cut
334  
335 sub nt {
336  
337 my ( $self,$nt ) = @_;
338 if ( $nt ne $empty_string ) {
339  
340 $susyncz->{_nt} = $nt;
341 $susyncz->{_note} = $susyncz->{_note}.' nt='.$susyncz->{_nt};
342 $susyncz->{_Step} = $susyncz->{_Step}.' nt='.$susyncz->{_nt};
343  
344 } else {
345 print("susyncz, nt, missing nt,\n");
346 }
347 }
348  
349  
350 =head2 sub ntr
351  
352  
353 =cut
354  
355 sub ntr {
356  
357 my ( $self,$ntr ) = @_;
358 if ( $ntr ne $empty_string ) {
359  
360 $susyncz->{_ntr} = $ntr;
361 $susyncz->{_note} = $susyncz->{_note}.' ntr='.$susyncz->{_ntr};
362 $susyncz->{_Step} = $susyncz->{_Step}.' ntr='.$susyncz->{_ntr};
363  
364 } else {
365 print("susyncz, ntr, missing ntr,\n");
366 }
367 }
368  
369  
370 =head2 sub rho
371  
372  
373 =cut
374  
375 sub rho {
376  
377 my ( $self,$rho ) = @_;
378 if ( $rho ne $empty_string ) {
379  
380 $susyncz->{_rho} = $rho;
381 $susyncz->{_note} = $susyncz->{_note}.' rho='.$susyncz->{_rho};
382 $susyncz->{_Step} = $susyncz->{_Step}.' rho='.$susyncz->{_rho};
383  
384 } else {
385 print("susyncz, rho, missing rho,\n");
386 }
387 }
388  
389  
390 =head2 sub tdelay
391  
392  
393 =cut
394  
395 sub tdelay {
396  
397 my ( $self,$tdelay ) = @_;
398 if ( $tdelay ne $empty_string ) {
399  
400 $susyncz->{_tdelay} = $tdelay;
401 $susyncz->{_note} = $susyncz->{_note}.' tdelay='.$susyncz->{_tdelay};
402 $susyncz->{_Step} = $susyncz->{_Step}.' tdelay='.$susyncz->{_tdelay};
403  
404 } else {
405 print("susyncz, tdelay, missing tdelay,\n");
406 }
407 }
408  
409  
410 =head2 sub tpow
411  
412  
413 =cut
414  
415 sub tpow {
416  
417 my ( $self,$tpow ) = @_;
418 if ( $tpow ne $empty_string ) {
419  
420 $susyncz->{_tpow} = $tpow;
421 $susyncz->{_note} = $susyncz->{_note}.' tpow='.$susyncz->{_tpow};
422 $susyncz->{_Step} = $susyncz->{_Step}.' tpow='.$susyncz->{_tpow};
423  
424 } else {
425 print("susyncz, tpow, missing tpow,\n");
426 }
427 }
428  
429  
430 =head2 sub v
431  
432  
433 =cut
434  
435 sub v {
436  
437 my ( $self,$v ) = @_;
438 if ( $v ne $empty_string ) {
439  
440 $susyncz->{_v} = $v;
441 $susyncz->{_note} = $susyncz->{_note}.' v='.$susyncz->{_v};
442 $susyncz->{_Step} = $susyncz->{_Step}.' v='.$susyncz->{_v};
443  
444 } else {
445 print("susyncz, v, missing v,\n");
446 }
447 }
448  
449  
450 =head2 sub zint
451  
452  
453 =cut
454  
455 sub zint {
456  
457 my ( $self,$zint ) = @_;
458 if ( $zint ne $empty_string ) {
459  
460 $susyncz->{_zint} = $zint;
461 $susyncz->{_note} = $susyncz->{_note}.' zint='.$susyncz->{_zint};
462 $susyncz->{_Step} = $susyncz->{_Step}.' zint='.$susyncz->{_zint};
463  
464 } else {
465 print("susyncz, zint, missing zint,\n");
466 }
467 }
468  
469  
470 =head2 sub get_max_index
471  
472 max index = number of input variables -1
473
474 =cut
475
476 sub get_max_index {
477 my ($self) = @_;
478 my $max_index = 11;
479  
480 return($max_index);
481 }
482
483
484 1;