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

filter: Statementstmt 0.0% 0 / 153 Branchbran 0.0% 0 / 38 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 25 Podpod 0.0% 0 / 23 totaltotal 0.0% 0 / 239 CC 20 SCAR 17.0
CC
20
Cov
0%
ct1
6.0
ct2
6.0
ct3
6.0
CRAP 5.5
1 package App::SeismicUnixGui::sunix::model::suplane;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PROGRAM NAME: SUPLANE - create common offset data file with up to 3 planes
8 AUTHOR: Juan Lorenzo (Perl module only)
9 DATE:
10 DESCRIPTION:
11 Version:
12  
13 =head2 USE
14  
15 =head3 NOTES
16  
17 =head4 Examples
18  
19 =head3 SEISMIC UNIX NOTES
20 SUPLANE - create common offset data file suplane
21 with up to 3 planes
22  
23  
24 suplane [optional parameters] >stdout
25  
26  
27 Optional Parameters:
28
29 npl=3 number of planes
30
31 nt=64 number of time samples
32
33 ntr=32 number of traces
34
35 taper=0 no end-of-plane taper
36 = 1 taper planes to zero at the end
37
38 offset=400 offset
39
40 dt=0.004 time sample interval in seconds
41
42 ...plane 1 ...
43  
44 dip1=0 dip of plane #1 (ms/trace)
45
46 len1= 3*ntr/4 HORIZONTAL extent of plane (traces)
47
48 ct1= nt/2 time sample for center pivot
49
50 cx1= ntr/2 trace for center pivot
51
52 ...plane 2 ...
53  
54 dip2=4 dip of plane #2 (ms/trace)
55
56 len2= 3*ntr/4 HORIZONTAL extent of plane (traces)
57  
58 ct2= nt/2 time sample for center pivot
59
60 cx2= ntr/2 trace for center pivot
61
62 ...plane 3 ...
63  
64 dip3=8 dip of plane #3 (ms/trace)
65
66 len3= 3*ntr/4 HORIZONTAL extent of plane (traces)
67
68 ct3= nt/2 time sample for center pivot
69
70 cx3= ntr/2 trace for center pivot
71  
72 liner=0 use parameters
73
74 = 1 parameters set for 64x64 data set
75
76 with separated dipping planes.
77  
78 Credits:
79 CWP: Chris Liner
80  
81 Trace header fields set: ns, dt, offset, tracl
82  
83 =head2 CHANGES and their DATES
84  
85 =cut
86  
87 use Moose;
88 our $VERSION = '0.0.1';
89 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
90  
91 my $get = L_SU_global_constants->new();
92  
93 my $var = $get->var();
94 my $empty_string = $var->{_empty_string};
95  
96 my $suplane = {
97 _ct1 => '',
98 _ct2 => '',
99 _ct3 => '',
100 _cx1 => '',
101 _cx2 => '',
102 _cx3 => '',
103 _dip1 => '',
104 _dip2 => '',
105 _dip3 => '',
106 _dt => '',
107 _len1 => '',
108 _len2 => '',
109 _len3 => '',
110 _liner => '',
111 _npl => '',
112 _nt => '',
113 _ntr => '',
114 _offset => '',
115 _taper => '',
116 _Step => '',
117 _note => '',
118 };
119  
120 =head2 sub Step
121  
122 collects switches and assembles bash instructions
123 by adding the program name
124  
125 =cut
126  
127 sub Step {
128  
129 $suplane->{_Step} = 'suplane' . $suplane->{_Step};
130 return ( $suplane->{_Step} );
131  
132 }
133  
134 =head2 sub note
135  
136 collects switches and assembles bash instructions
137 by adding the program name
138  
139 =cut
140  
141 sub note {
142  
143 $suplane->{_note} = 'suplane' . $suplane->{_note};
144 return ( $suplane->{_note} );
145  
146 }
147  
148 =head2 sub clear
149  
150 =cut
151  
152 sub clear {
153  
154 $suplane->{_ct1} = '';
155 $suplane->{_ct2} = '';
156 $suplane->{_ct3} = '';
157 $suplane->{_cx1} = '';
158 $suplane->{_cx2} = '';
159 $suplane->{_cx3} = '';
160 $suplane->{_dip1} = '';
161 $suplane->{_dip2} = '';
162 $suplane->{_dip3} = '';
163 $suplane->{_dt} = '';
164 $suplane->{_len1} = '';
165 $suplane->{_len2} = '';
166 $suplane->{_len3} = '';
167 $suplane->{_liner} = '';
168 $suplane->{_npl} = '';
169 $suplane->{_nt} = '';
170 $suplane->{_ntr} = '';
171 $suplane->{_offset} = '';
172 $suplane->{_taper} = '';
173 $suplane->{_Step} = '';
174 $suplane->{_note} = '';
175 }
176  
177 =head2 sub ct1
178  
179  
180 =cut
181  
182 sub ct1 {
183  
184 my ( $self, $ct1 ) = @_;
185 if ( $ct1 ne $empty_string ) {
186  
187 $suplane->{_ct1} = $ct1;
188 $suplane->{_note} = $suplane->{_note} . ' ct1=' . $suplane->{_ct1};
189 $suplane->{_Step} = $suplane->{_Step} . ' ct1=' . $suplane->{_ct1};
190  
191 }
192 else {
193 print("suplane, ct1, missing ct1,\n");
194 }
195 }
196  
197 =head2 sub ct2
198  
199  
200 =cut
201  
202 sub ct2 {
203  
204 my ( $self, $ct2 ) = @_;
205 if ( $ct2 ne $empty_string ) {
206  
207 $suplane->{_ct2} = $ct2;
208 $suplane->{_note} = $suplane->{_note} . ' ct2=' . $suplane->{_ct2};
209 $suplane->{_Step} = $suplane->{_Step} . ' ct2=' . $suplane->{_ct2};
210  
211 }
212 else {
213 print("suplane, ct2, missing ct2,\n");
214 }
215 }
216  
217 =head2 sub ct3
218  
219  
220 =cut
221  
222 sub ct3 {
223  
224 my ( $self, $ct3 ) = @_;
225 if ( $ct3 ne $empty_string ) {
226  
227 $suplane->{_ct3} = $ct3;
228 $suplane->{_note} = $suplane->{_note} . ' ct3=' . $suplane->{_ct3};
229 $suplane->{_Step} = $suplane->{_Step} . ' ct3=' . $suplane->{_ct3};
230  
231 }
232 else {
233 print("suplane, ct3, missing ct3,\n");
234 }
235 }
236  
237 =head2 sub cx1
238  
239  
240 =cut
241  
242 sub cx1 {
243  
244 my ( $self, $cx1 ) = @_;
245 if ( $cx1 ne $empty_string ) {
246  
247 $suplane->{_cx1} = $cx1;
248 $suplane->{_note} = $suplane->{_note} . ' cx1=' . $suplane->{_cx1};
249 $suplane->{_Step} = $suplane->{_Step} . ' cx1=' . $suplane->{_cx1};
250  
251 }
252 else {
253 print("suplane, cx1, missing cx1,\n");
254 }
255 }
256  
257 =head2 sub cx2
258  
259  
260 =cut
261  
262 sub cx2 {
263  
264 my ( $self, $cx2 ) = @_;
265 if ( $cx2 ne $empty_string ) {
266  
267 $suplane->{_cx2} = $cx2;
268 $suplane->{_note} = $suplane->{_note} . ' cx2=' . $suplane->{_cx2};
269 $suplane->{_Step} = $suplane->{_Step} . ' cx2=' . $suplane->{_cx2};
270  
271 }
272 else {
273 print("suplane, cx2, missing cx2,\n");
274 }
275 }
276  
277 =head2 sub cx3
278  
279  
280 =cut
281  
282 sub cx3 {
283  
284 my ( $self, $cx3 ) = @_;
285 if ( $cx3 ne $empty_string ) {
286  
287 $suplane->{_cx3} = $cx3;
288 $suplane->{_note} = $suplane->{_note} . ' cx3=' . $suplane->{_cx3};
289 $suplane->{_Step} = $suplane->{_Step} . ' cx3=' . $suplane->{_cx3};
290  
291 }
292 else {
293 print("suplane, cx3, missing cx3,\n");
294 }
295 }
296  
297 =head2 sub dip1
298  
299  
300 =cut
301  
302 sub dip1 {
303  
304 my ( $self, $dip1 ) = @_;
305 if ( $dip1 ne $empty_string ) {
306  
307 $suplane->{_dip1} = $dip1;
308 $suplane->{_note} = $suplane->{_note} . ' dip1=' . $suplane->{_dip1};
309 $suplane->{_Step} = $suplane->{_Step} . ' dip1=' . $suplane->{_dip1};
310  
311 }
312 else {
313 print("suplane, dip1, missing dip1,\n");
314 }
315 }
316  
317 =head2 sub dip2
318  
319  
320 =cut
321  
322 sub dip2 {
323  
324 my ( $self, $dip2 ) = @_;
325 if ( $dip2 ne $empty_string ) {
326  
327 $suplane->{_dip2} = $dip2;
328 $suplane->{_note} = $suplane->{_note} . ' dip2=' . $suplane->{_dip2};
329 $suplane->{_Step} = $suplane->{_Step} . ' dip2=' . $suplane->{_dip2};
330  
331 }
332 else {
333 print("suplane, dip2, missing dip2,\n");
334 }
335 }
336  
337 =head2 sub dip3
338  
339  
340 =cut
341  
342 sub dip3 {
343  
344 my ( $self, $dip3 ) = @_;
345 if ( $dip3 ne $empty_string ) {
346  
347 $suplane->{_dip3} = $dip3;
348 $suplane->{_note} = $suplane->{_note} . ' dip3=' . $suplane->{_dip3};
349 $suplane->{_Step} = $suplane->{_Step} . ' dip3=' . $suplane->{_dip3};
350  
351 }
352 else {
353 print("suplane, dip3, missing dip3,\n");
354 }
355 }
356  
357 =head2 sub dt
358  
359  
360 =cut
361  
362 sub dt {
363  
364 my ( $self, $dt ) = @_;
365 if ( $dt ne $empty_string ) {
366  
367 $suplane->{_dt} = $dt;
368 $suplane->{_note} = $suplane->{_note} . ' dt=' . $suplane->{_dt};
369 $suplane->{_Step} = $suplane->{_Step} . ' dt=' . $suplane->{_dt};
370  
371 }
372 else {
373 print("suplane, dt, missing dt,\n");
374 }
375 }
376  
377 =head2 sub len1
378  
379  
380 =cut
381  
382 sub len1 {
383  
384 my ( $self, $len1 ) = @_;
385 if ( $len1 ne $empty_string ) {
386  
387 $suplane->{_len1} = $len1;
388 $suplane->{_note} = $suplane->{_note} . ' len1=' . $suplane->{_len1};
389 $suplane->{_Step} = $suplane->{_Step} . ' len1=' . $suplane->{_len1};
390  
391 }
392 else {
393 print("suplane, len1, missing len1,\n");
394 }
395 }
396  
397 =head2 sub len2
398  
399  
400 =cut
401  
402 sub len2 {
403  
404 my ( $self, $len2 ) = @_;
405 if ( $len2 ne $empty_string ) {
406  
407 $suplane->{_len2} = $len2;
408 $suplane->{_note} = $suplane->{_note} . ' len2=' . $suplane->{_len2};
409 $suplane->{_Step} = $suplane->{_Step} . ' len2=' . $suplane->{_len2};
410  
411 }
412 else {
413 print("suplane, len2, missing len2,\n");
414 }
415 }
416  
417 =head2 sub len3
418  
419  
420 =cut
421  
422 sub len3 {
423  
424 my ( $self, $len3 ) = @_;
425 if ( $len3 ne $empty_string ) {
426  
427 $suplane->{_len3} = $len3;
428 $suplane->{_note} = $suplane->{_note} . ' len3=' . $suplane->{_len3};
429 $suplane->{_Step} = $suplane->{_Step} . ' len3=' . $suplane->{_len3};
430  
431 }
432 else {
433 print("suplane, len3, missing len3,\n");
434 }
435 }
436  
437 =head2 sub liner
438  
439  
440 =cut
441  
442 sub liner {
443  
444 my ( $self, $liner ) = @_;
445 if ( $liner ne $empty_string ) {
446  
447 $suplane->{_liner} = $liner;
448 $suplane->{_note} =
449 $suplane->{_note} . ' liner=' . $suplane->{_liner};
450 $suplane->{_Step} =
451 $suplane->{_Step} . ' liner=' . $suplane->{_liner};
452  
453 }
454 else {
455 print("suplane, liner, missing liner,\n");
456 }
457 }
458  
459 =head2 sub npl
460  
461  
462 =cut
463  
464 sub npl {
465  
466 my ( $self, $npl ) = @_;
467 if ( $npl ne $empty_string ) {
468  
469 $suplane->{_npl} = $npl;
470 $suplane->{_note} = $suplane->{_note} . ' npl=' . $suplane->{_npl};
471 $suplane->{_Step} = $suplane->{_Step} . ' npl=' . $suplane->{_npl};
472  
473 }
474 else {
475 print("suplane, npl, missing npl,\n");
476 }
477 }
478  
479 =head2 sub nt
480  
481  
482 =cut
483  
484 sub nt {
485  
486 my ( $self, $nt ) = @_;
487 if ( $nt ne $empty_string ) {
488  
489 $suplane->{_nt} = $nt;
490 $suplane->{_note} = $suplane->{_note} . ' nt=' . $suplane->{_nt};
491 $suplane->{_Step} = $suplane->{_Step} . ' nt=' . $suplane->{_nt};
492  
493 }
494 else {
495 print("suplane, nt, missing nt,\n");
496 }
497 }
498  
499 =head2 sub ntr
500  
501  
502 =cut
503  
504 sub ntr {
505  
506 my ( $self, $ntr ) = @_;
507 if ( $ntr ne $empty_string ) {
508  
509 $suplane->{_ntr} = $ntr;
510 $suplane->{_note} = $suplane->{_note} . ' ntr=' . $suplane->{_ntr};
511 $suplane->{_Step} = $suplane->{_Step} . ' ntr=' . $suplane->{_ntr};
512  
513 }
514 else {
515 print("suplane, ntr, missing ntr,\n");
516 }
517 }
518  
519 =head2 sub offset
520  
521  
522 =cut
523  
524 sub offset {
525  
526 my ( $self, $offset ) = @_;
527 if ( $offset ne $empty_string ) {
528  
529 $suplane->{_offset} = $offset;
530 $suplane->{_note} =
531 $suplane->{_note} . ' offset=' . $suplane->{_offset};
532 $suplane->{_Step} =
533 $suplane->{_Step} . ' offset=' . $suplane->{_offset};
534  
535 }
536 else {
537 print("suplane, offset, missing offset,\n");
538 }
539 }
540  
541 =head2 sub taper
542  
543  
544 =cut
545  
546 sub taper {
547  
548 my ( $self, $taper ) = @_;
549 if ( $taper ne $empty_string ) {
550  
551 $suplane->{_taper} = $taper;
552 $suplane->{_note} =
553 $suplane->{_note} . ' taper=' . $suplane->{_taper};
554 $suplane->{_Step} =
555 $suplane->{_Step} . ' taper=' . $suplane->{_taper};
556  
557 }
558 else {
559 print("suplane, taper, missing taper,\n");
560 }
561 }
562  
563 =head2 sub get_max_index
564
565 max index = number of input variables -1
566
567 =cut
568  
569 sub get_max_index {
570 my ($self) = @_;
571 my $max_index = 18;
572  
573 return ($max_index);
574 }
575  
576 1;