lib/App/SeismicUnixGui/misc/cmpcc.pm untested

filter: Statementstmt 0.0% 0 / 899 Branchbran 0.0% 0 / 154 Conditioncond 0.0% 0 / 90 MC/DCmcdc 0.0% 0 / 45 Subroutinesub 0.0% 0 / 80 Podpod 0.0% 0 / 62 totaltotal 0.0% 0 / 1330 CC 78 SCAR 25.7
CC
78
Cov
0%
set_sp_gather_geom_out
72.0
set_shove_geom
72.0
clean
30.0
CRAP 13.1
1 package App::SeismicUnixGui::misc::cmpcc;
2  
3 =head1 DOCUMENTATION
4  
5  
6 =head2 SYNOPSIS
7  
8 ccmpcc Hayashi and Suzuki, 2013
9  
10 PERL PROGRAM NAME: ccmpcc.pm
11 AUTHOR: Juan Lorenzo
12 DATE: Dec. 2021
13  
14 DESCRIPTION
15
16  
17 BASED ON:
18  
19 =cut
20  
21 =head2 USE
22  
23 =head3 NOTES
24  
25 offsets are -1 off their mark so that
26 suaddhead inputs the correct value into the
27 headers... TODO ... don't understand why yet.
28  
29 =head4 Examples
30  
31 =head3 SEISMIC UNIX NOTES
32  
33 =head2 CHANGES and their DATES
34  
35 =cut
36  
37 =head2 Notes from bash
38
39 =cut
40  
41 =head2 declare libraries
42  
43 =cut
44  
45 use Moose;
46 our $VERSION = '0.0.1';
47 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
48 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
49 use App::SeismicUnixGui::misc::SeismicUnix
50 qw($in $out $on $go $to $suffix_ascii $off $append
51 $suffix_segy $suffix_sgy $suffix_segd $suffix_txt $suffix_bin $cdp $gx $txt $offset
52 $su $sx $suffix_su $suffix_txt $tracl);
53  
54 use aliased 'App::SeismicUnixGui::misc::manage_files_by2';
55 use aliased 'App::SeismicUnixGui::misc::array';
56 use aliased 'App::SeismicUnixGui::misc::message';
57 use aliased 'App::SeismicUnixGui::misc::flow';
58 use aliased 'App::SeismicUnixGui::sunix::shell::cat_su';
59 use aliased 'App::SeismicUnixGui::sunix::shell::cat_txt';
60 use aliased 'App::SeismicUnixGui::sunix::data::data_out';
61 use aliased 'App::SeismicUnixGui::sunix::data::data_in';
62 use aliased 'App::SeismicUnixGui::sunix::shapeNcut::suwind';
63 use aliased 'App::SeismicUnixGui::sunix::header::sushw';
64 use aliased 'App::SeismicUnixGui::sunix::header::sulhead';
65 use aliased 'App::SeismicUnixGui::sunix::statsMath::suxcor';
66 use App::SeismicUnixGui::misc::control '0.0.3';
67 use aliased 'App::SeismicUnixGui::misc::control';
68  
69 =head2
70  
71 instantiate modules
72  
73 =cut
74  
75 my $Project = Project_config->new();
76 my $control = control->new();
77 my $get = L_SU_global_constants->new();
78  
79 =head2
80  
81 define local variables
82  
83 =cut
84  
85 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
86 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
87  
88 my $var = $get->var();
89 my $true = $var->{_true};
90 my $false = $var->{_false};
91  
92 =head2 define private hash
93 to share
94  
95 =cut
96  
97 my @array1;
98 my @array2;
99  
100 my $cmpcc = {
101 _appendix => '',
102 _aref4cc_pt1 => '',
103 _aref4cc_pt2 => '',
104 _aref4cc_pt3 => '',
105 _aref4cc_pt4 => '',
106 _aref4cc_pt5 => '',
107 _base_file_name_gx => '',
108 _base_file_name_sx => '',
109 _cat_base_file_name_out => '',
110 _cmpcc_number_of => '',
111 _cmpcc_spread_m => '',
112 _cmpcc_x_inc_m => '',
113  
114 # _cross_correlation_base_file_name_line_in => '',
115 _data_base_file_name_in => '',
116 _data_base_file_name_out => '',
117 _delete_base_file_name => '',
118 _ep_idx => '',
119 _ep_number_of => '',
120 _filter_base_file_name_in => ' filter ',
121 _filter_base_file_name_out => ' filter ',
122 _first_geo_x_inc_m4calc => '',
123 _first_geo_x_m4calc => 7.5,
124 _first_geo_idx => 0,
125 _first_line => 1,
126 _for_loading_base_file_name_line_in => '',
127 _is_aref4cc_pt1 => $false,
128 _is_aref4cc_pt1_trcl => $false,
129 _is_aref4cc_pt2 => $false,
130 _is_aref4cc_pt3 => $false,
131 _is_aref4cc_pt4 => $false,
132 _is_aref4cc_pt5 => $false,
133 _line_geometry_base_file_name => ' line_geometry ',
134 _geo_spread_m4calc => 69,
135 _geo_x_inc_m4calc => 3,
136 _geo_x_m_aref => '',
137 _geo_x_m_aref4cc => \@array1,
138 _geo_number_of => 24,
139 _header_word => $tracl,
140 _last_line => 6,
141 _last_geo_x_m4calc => 76.5,
142 _loaded_w_headers_base_file_name_line_out => '',
143 _shove_line_geom_base_file_name_out => '',
144 _shove_sp_gather_geom_base_file_name_out => '',
145 _shove_sp_gather_geom_outbound => '',
146 _sp_x_m_aref => '',
147 _sp_x_m_aref4cc => \@array2,
148 _suffix_type => '',
149 _suwind_max_header_value => '',
150 _suwind_min_header_value => '',
151 _suwind_skip => 1,
152 _tracl_order_base_file_name_in => '',
153 _tracl_order_base_file_name_out => '',
154 _offset_x_m_aref4cc => '',
155 _vector_pt1_aref => '',
156 _vector_pt2_aref => '',
157 _vector_pt3_aref => '',
158 _vector_pt4_aref => '',
159 _vector_pt5_aref => '',
160 };
161  
162 =head2 sub clean
163  
164 delete a pre-existing file
165 directory of a file
166  
167 =cut
168  
169 sub clean {
170 my ($self) = @_;
171  
172 if ( length $cmpcc->{_delete_base_file_name}
173 and length $cmpcc->{_suffix_type} )
174 {
175  
176 my $Project = Project_config->new();
177 my $file = manage_files_by2->new();
178  
179 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN;
180 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY;
181 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU;
182 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT;
183 my $file_name = $cmpcc->{_delete_base_file_name};
184 my $suffix_type = $cmpcc->{_suffix_type};
185 my $outbound;
186  
187 if ( $suffix_type eq $txt ) {
188  
189 $outbound = $DATA_SEISMIC_TXT . ' / ' . $file_name . $suffix_txt;
190  
191 }
192 elsif ( $suffix_type eq $su ) {
193  
194 $outbound = $DATA_SEISMIC_SU . ' / ' . $file_name . $suffix_su;
195  
196 }
197 else {
198 print("cmpcc, clean, unexpected\n");
199 }
200  
201 my $ans = $file->exists($outbound);
202  
203 # print(
204 # "cmpcc, clean, file_name= $file_name does exist\n"
205 # );
206  
207 if ($ans) {
208  
209 $file->delete($outbound);
210 print("cmpcc, clean, Cleaning for pre-existing $file_name \n");
211  
212 }
213 else {
214 # print("cmpcc, clean, file does not exist NADA\n");
215 }
216  
217 }
218 else {
219 print("cmpcc, set_geom4calc, missing values\n");
220 print(
221 "cmpcc, clean, delete_base_file_name=$cmpcc->{_delete_base_file_name}\n"
222 );
223  
224 }
225  
226 }
227  
228 =head2 sub clear
229 all memory
230  
231 =cut
232  
233 sub clear {
234 my $self = @_;
235 $cmpcc->{_appendix} = '';
236 $cmpcc->{_aref4cc_pt1} = '';
237 $cmpcc->{_aref4cc_pt2} = '';
238 $cmpcc->{_aref4cc_pt3} = '';
239 $cmpcc->{_aref4cc_pt4} = '';
240 $cmpcc->{_aref4cc_pt5} = '';
241 $cmpcc->{_base_file_name_gx} = '';
242 $cmpcc->{_base_file_name_sx} = '';
243 $cmpcc->{_cat_base_file_name_out} = '';
244 $cmpcc->{_delete_base_file_name} = '';
245 $cmpcc->{_cmpcc_number_of} = '';
246 $cmpcc->{_cmpcc_spread_m} = '';
247 $cmpcc->{_cmpcc_x_inc_m} = '';
248  
249 # $cmpcc->{_cross_correlation_base_file_name_line_in} = '';
250 $cmpcc->{_ep_idx} = '';
251 $cmpcc->{_ep_number_of} = '';
252 $cmpcc->{_data_base_file_name_in} = '';
253 $cmpcc->{_data_base_file_name_out} = '';
254 $cmpcc->{_filter_base_file_name_in} = ' filter ';
255 $cmpcc->{_filter_base_file_name_out} = ' filter ';
256 $cmpcc->{_first_geo_x_inc_m4calc} = '';
257 $cmpcc->{_first_geo_x_m4calc} = 7.5;
258 $cmpcc->{_first_geo_idx} = 0;
259 $cmpcc->{_first_line} = 1;
260 $cmpcc->{_for_loading_base_file_name_line_in} = '';
261 $cmpcc->{_geo_spread_m4calc} = 69;
262 $cmpcc->{_geo_x_inc_m4calc} = 3;
263 $cmpcc->{_geo_x_m_aref} = '';
264 $cmpcc->{_geo_x_m_aref4cc} = '';
265 $cmpcc->{_geo_number_of} = 24;
266 $cmpcc->{_header_word} = $tracl;
267 $cmpcc->{_is_aref4cc_pt1} = $false;
268 $cmpcc->{_is_aref4cc_pt1_trcl} = $false;
269 $cmpcc->{_is_aref4cc_pt2} = $false;
270 $cmpcc->{_is_aref4cc_pt3} = $false;
271 $cmpcc->{_is_aref4cc_pt4} = $false;
272 $cmpcc->{_is_aref4cc_pt5} = $false;
273 $cmpcc->{_last_geo_x_m4calc} = ' 76.5 ';
274 $cmpcc->{_last_line} = 6;
275 $cmpcc->{_last_geo_x_m4calc} = 76.5;
276 $cmpcc->{_line_geometry_base_file_name} = '';
277 $cmpcc->{_loaded_w_headers_base_file_name_line_out} = '';
278 $cmpcc->{_shove_line_geom_base_file_name_out} = '';
279 $cmpcc->{_shove_sp_gather_geom_base_file_name_out} = '';
280 $cmpcc->{_shove_sp_gather_geom_outbound} = '';
281 $cmpcc->{_sp_x_m_aref} = '';
282 $cmpcc->{_sp_x_m_aref4cc} = '';
283 $cmpcc->{_suffix_type} = '';
284 $cmpcc->{_suwind_max_header_value} = '';
285 $cmpcc->{_suwind_min_header_value} = '';
286 $cmpcc->{_suwind_skip} = 1;
287 $cmpcc->{_offset_x_m_aref4cc} = '';
288 $cmpcc->{_tracl_order_base_file_name_in} = '';
289 $cmpcc->{_tracl_order_base_file_name_out} = '';
290 $cmpcc->{_vector_pt1_aref} = '';
291 $cmpcc->{_vector_pt2_aref} = '';
292 $cmpcc->{_vector_pt3_aref} = '';
293 $cmpcc->{_vector_pt4_aref} = '';
294 $cmpcc->{_vector_pt5_aref} = '';
295  
296 }
297  
298 =head2 sub get_cmp_x_m_aref4cc
299  
300 For a SINGLE SP gather,
301 build cmp index and value arrays
302 for a correlation of a specific
303 trace against all the rest
304 The specific trace varies so all
305 combinations are estimated
306  
307 print("cmpcc,get_cmp_x_m_aref4cc, cmp_x_m_array2= @{$cmp_x_m_array2[$geo_ref]}\n");
308 print("cmpcc,get_cmp_x_m_aref4cc, geo_ref=$geo_ref \n");
309 print("cmpcc,get_cmp_x_m_aref4cc, every = $every\n");
310 print("cmpcc,get_cmp_x_m_aref4cc, cmp_x_m = $cmp_x_m[$geo_ref][$every]\n");
311  
312 =cut
313  
314 sub get_cmp_x_m_aref4cc {
315 my ($self) = @_;
316  
317 my $result;
318  
319 if ( length $cmpcc->{_geo_number_of}
320 and length $cmpcc->{_first_geo_idx}
321 and length $cmpcc->{_geo_x_m_aref} )
322 {
323  
324 my @cmp_x_m_array2;
325  
326 my $first_geo_idx = $cmpcc->{_first_geo_idx};
327 my $last_geo_idx = $cmpcc->{_geo_number_of};
328 my $geo_number_of = $cmpcc->{_geo_number_of};
329 my @geo_x_m = @{ $cmpcc->{_geo_x_m_aref} };
330
331 # print("geo_number_of=$geo_number_of\n");
332  
333 # combination of all geophones
334 for (
335 my $geo_ref = $first_geo_idx ;
336 $geo_ref < $last_geo_idx ;
337 $geo_ref++
338 )
339 {
340 my @cmp_x_m;
341  
342 # with every geophone,
343 # two at a time
344 for ( my $every = 0 ; $every < $geo_number_of ; $every++ ) {
345  
346 $cmp_x_m[$every] =
347 ( $geo_x_m[$geo_ref] + $geo_x_m[$every] ) / 2.;
348  
349 } # end inner loop
350  
351 $cmp_x_m_array2[$geo_ref] = \@cmp_x_m;
352 } # end outer loop
353  
354 $cmpcc->{_cmp_x_m_aref4cc} = \@cmp_x_m_array2;
355 $result = $cmpcc->{_cmp_x_m_aref4cc};
356 return ($result);
357  
358 }
359 else {
360 print("cmpcc, get_cmp_x_m_aref4cc, missing values\n");
361 print("cmpcc,geo_number_of=$cmpcc->{_geo_number_of}\n");
362 print("cmpcc,first_geo_idx=$cmpcc->{_first_geo_idx}\n");
363 print("cmpcc,cmp_x_m_aref=@{$cmpcc->{_geo_x_m_aref}}\n");
364 return ($result);
365 }
366  
367 }
368  
369 =head2 sub get_cmpcc_spread_m
370  
371 geometry values
372  
373 =cut
374  
375 sub get_cmpcc_spread_m {
376  
377 my ( $self, $cmp_spread_m ) = @_;
378  
379 my $result;
380  
381 if ( length $cmp_spread_m ) {
382  
383 $cmpcc->{_cmpcc_spread_m} = $cmp_spread_m;
384  
385 }
386 else {
387 print("cmpcc, cmp_spread_m=cmp_spread_m\n");
388 }
389  
390 return ($result);
391 }
392  
393 =head2 sub get_cmpcc_x_inc_m
394  
395 geometry values
396  
397 =cut
398  
399 sub get_cmpcc_x_inc_m {
400 my ( $self, $cmp_x_inc_m ) = @_;
401  
402 my $result;
403  
404 if ( length $cmp_x_inc_m ) {
405  
406 $cmpcc->{_cmpcc_x_inc_m} = $cmp_x_inc_m;
407  
408 }
409 else {
410 print("cmpcc, cmp_x_inc_m=cmp_x_inc_m\n");
411 }
412  
413 return ($result);
414 }
415  
416 =head2 sub get_geo_number_of
417  
418 geometry values
419  
420 =cut
421  
422 sub get_geo_number_of {
423 my ($self) = @_;
424  
425 my $result;
426  
427 if ( length $cmpcc->{_geo_number_of} ) {
428  
429 $result = $cmpcc->{_geo_number_of};
430  
431 }
432 else {
433 print("cmpcc, get_geo_number_of, missing value\n");
434 }
435  
436 return ($result);
437 }
438  
439 =head2 sub get_geo_x_m_aref
440  
441 geometry values
442  
443 =cut
444  
445 sub get_geo_x_m_aref {
446 my ($self) = @_;
447  
448 my $result;
449  
450 if ( length $cmpcc->{_geo_x_m_aref} ) {
451  
452 $result = $cmpcc->{_geo_x_m_aref};
453  
454 }
455 else {
456 print("cmpcc, get_geo_x_m_aref, missing value\n");
457 }
458  
459 return ($result);
460 }
461  
462 =head2 sub get_geo_x_m_aref4cc
463  
464 geometry values
465  
466 =cut
467  
468 sub get_geo_x_m_aref4cc {
469 my ($self) = @_;
470  
471 my $result;
472  
473 if ( length $cmpcc->{_geo_x_m_aref4cc} ) {
474  
475 $result = $cmpcc->{_geo_x_m_aref4cc};
476  
477 }
478 else {
479 print("cmpcc, get_geo_x_m_aref4cc, missing value\n");
480 }
481  
482 return ($result);
483 }
484  
485 =head2 sub get_offset_x_m_aref4cc
486  
487 For a single SP gather,
488 build offset for all the following
489 combinations:
490 e.g., 24 geophones, combined 2 at a time
491  
492 print("cmpcc,get_offset_x_m_aref4cc,
493 geo_ref=$geo_ref; every=$every; offset = $offset_x_m[$every]\n");
494 print("cmpcc,get_offset_x_m_aref4cc,geo_ref=0; offset = @{$array_ref2[0]}\n");
495 print("cmpcc,get_offset_x_m_aref4cc,geo_ref=1; offset = @{$array_ref2[1]}\n");
496 print("cmpcc,get_offset_x_m_aref4cc,geo_ref=1; offset = @{@{$cmpcc->{_offset_x_m_aref4cc}}[1]}\n");
497  
498 =cut
499  
500 sub get_offset_x_m_aref4cc {
501  
502 my ($self) = @_;
503  
504 my $result;
505  
506 if ( length $cmpcc->{_geo_number_of}
507 and length $cmpcc->{_geo_x_m_aref}
508 and length $cmpcc->{_sp_x_m_aref}
509 and length $cmpcc->{_first_geo_idx}
510 and length $cmpcc->{_geo_x_m_aref}
511 and length $cmpcc->{_sp_x_m_aref} )
512 {
513  
514 my @array_ref2;
515  
516 my $first_geo_idx = $cmpcc->{_first_geo_idx};
517 my $geo_number_of = $cmpcc->{_geo_number_of};
518  
519 my @geo_x_m = @{ $cmpcc->{_geo_x_m_aref} };
520 my @sp_x_m = @{ $cmpcc->{_sp_x_m_aref} };
521 my $sp_x_m = $sp_x_m[0]; # all values are the same
522  
523 # over every geophone within a shotpoint gather
524 for (
525 my $geo_ref = $first_geo_idx ;
526 $geo_ref < $geo_number_of ;
527 $geo_ref++
528 )
529 {
530  
531 my @offset_x_m;
532  
533 # Offset between 2 geophones at a time
534 # Use successively different first geophone
535 # To make pairs:
536 # fix the first geophone, then consider every geophone in a shot gather
537 for ( my $every = 0 ; $every < $geo_number_of ; $every++ ) {
538  
539 $offset_x_m[$every] =
540 abs( $geo_x_m[$every] - $sp_x_m ) -
541 abs( $geo_x_m[$geo_ref] - $sp_x_m ) - 1; # TODO fudge
542  
543 }
544  
545 $array_ref2[$geo_ref] = \@offset_x_m;
546  
547 # print("cmpcc,get_offset_x_m_aref4cc,geo_ref=$geo_ref; offset = @{$array_ref2[$geo_ref]}\n");
548 }
549  
550 $cmpcc->{_offset_x_m_aref4cc} = \@array_ref2;
551 $result = $cmpcc->{_offset_x_m_aref4cc};
552  
553 return ($result);
554 }
555 else {
556 print("cmpcc,get_offset_x_m_aref4cc, missing variables \n");
557 print(
558 "cmpcc,get_offset_x_m_aref4cc, geo_number_of=$cmpcc->{_geo_number_of} \n"
559 );
560 print(
561 "cmpcc,get_offset_x_m_aref4cc, geo_x_m_aref=@{$cmpcc->{_geo_x_m_aref}} \n"
562 );
563 print(
564 "cmpcc,get_offset_x_m_aref4cc, sp_x_m_aref=$cmpcc->{_sp_x_m_aref} \n"
565 );
566 print(
567 "cmpcc,get_offset_x_m_aref4cc, first_geo_idx=$cmpcc->{_first_geo_idx} \n"
568 );
569  
570 return ($result);
571  
572 }
573  
574 }
575  
576 =head2 sub get_sp_x_m_aref
577  
578 geometry values
579  
580 =cut
581  
582 sub get_sp_x_m_aref {
583 my ($self) = @_;
584  
585 my $result;
586  
587 if ( length $cmpcc->{_sp_x_m_aref} ) {
588  
589 $result = $cmpcc->{_sp_x_m_aref};
590  
591 }
592 else {
593 print("cmpcc, get_sp_x_m_aref, missing value\n");
594 }
595  
596 return ($result);
597 }
598  
599 =head2 sub get_sp_x_m_aref4cc
600  
601 geometry values
602  
603 =cut
604  
605 sub get_sp_x_m_aref4cc {
606 my ($self) = @_;
607  
608 my $result;
609  
610 if ( length $cmpcc->{_sp_x_m_aref4cc} ) {
611  
612 $result = $cmpcc->{_sp_x_m_aref4cc};
613  
614 }
615 else {
616 print("cmpcc, get_sp_x_m_aref4cc, missing value\n");
617 }
618  
619 return ($result);
620 }
621  
622 =head2 sub set_sp_gather_geom
623  
624 write out a single sp gather's
625 geometry values for 24x24=576 possible
626 cross-correlation cases
627  
628 =cut
629  
630 sub set_sp_gather_geom_out {
631  
632 my ($self) = @_;
633  
634 my $result;
635 my $count = 0;
636  
637 if ( length $cmpcc->{_shove_sp_gather_geom_outbound} ) {
638  
639 my $file = manage_files_by2->new();
640  
641 if ( length $cmpcc->{_vector_pt5_aref} ) {
642  
643 $count++;
644  
645 }
646 if ( length $cmpcc->{_vector_pt4_aref} ) {
647  
648 $count++;
649  
650 }
651 if ( length $cmpcc->{_vector_pt3_aref} ) {
652  
653 $count++;
654  
655 }
656 if ( length $cmpcc->{_vector_pt2_aref} ) {
657  
658 $count++;
659  
660 }
661 if ( length $cmpcc->{_vector_pt1_aref} ) {
662  
663 $count++;
664  
665 }
666  
667 if ( $count == 0 ) {
668  
669 print("cmpcc, count, ERROR=$count\n");
670  
671 }
672 else {
673 # print("cmpcc, NADA, count, $count\n");
674 }
675  
676 my $file_name = $cmpcc->{_shove_sp_gather_geom_outbound};
677 my $format = "%d\t%f\t%d\t%d\t%f\n";
678  
679 # print("cmpc,set_sp_gather_geom_out, vector 1 @{$cmpcc->{_vector_pt1_aref}}\n");
680 # print("cmpc,set_sp_gather_geom_out, vector 2 @{$cmpcc->{_vector_pt2_aref}}\n");
681 # print("cmpc,set_sp_gather_geom_out, vector 3 @{$cmpcc->{_vector_pt3_aref}}\n");
682 # print("cmpc,set_sp_gather_geom_out, vector 4 @{$cmpcc->{_vector_pt4_aref}}\n");
683 # print("cmpc,set_sp_gather_geom_out, vector 5 @{$cmpcc->{_vector_pt5_aref}}\n");
684 # print("cmpc,set_sp_gather_geom_out, file name $file_name\n");
685 # print("cmpc,set_sp_gather_geom_out, format $format\n");
686
687 $file->write_5cols(
688 $cmpcc->{_vector_pt1_aref}, $cmpcc->{_vector_pt2_aref},
689 $cmpcc->{_vector_pt3_aref}, $cmpcc->{_vector_pt4_aref},
690 $cmpcc->{_vector_pt5_aref}, $file_name,
691 $format
692 );
693  
694 }
695 else {
696 print("cmpcc, set_sp_gather_geom_out, missing value\n");
697 }
698  
699 return ($result);
700 }
701  
702 =head2 sub set_appendix
703  
704 set file for catting
705  
706 =cut
707  
708 sub set_appendix {
709 my ( $self, $appendix ) = @_;
710  
711 if ( length $appendix ) {
712  
713 $cmpcc->{_appendix} = $appendix;
714  
715 # print("cmpcc, set_appendix, base_file_name_out = $appendix\n");
716 }
717 else {
718 print("cmpcc, set_appendix, missing variable\n");
719 }
720  
721 my $result;
722  
723 return ($result);
724  
725 }
726  
727 =head2 sub set_base_file_name_gx
728  
729 =cut
730  
731 sub set_base_file_name_gx {
732 my ( $self, $base_file_name_gx ) = @_;
733  
734 if ( length $base_file_name_gx ) {
735  
736 # print(
737 # "cmpcc, set_base_file_name_gx, base_file_name_gx = $base_file_name_gx\n"
738 # );
739  
740 $cmpcc->{_base_file_name_gx} = $base_file_name_gx;
741 }
742 else {
743 print("cmpcc, set_base_file_name_gx, missing variable\n");
744 }
745  
746 my $result;
747  
748 return ($result);
749  
750 }
751  
752 =head2 sub set_base_file_name_sx
753  
754 =cut
755  
756 sub set_base_file_name_sx {
757 my ( $self, $base_file_name_sx ) = @_;
758  
759 if ( length $base_file_name_sx ) {
760  
761 # print(
762 # "cmpcc, set_base_file_name_sx, base_file_name_sx = $base_file_name_sx\n"
763 # );
764  
765 $cmpcc->{_base_file_name_sx} = $base_file_name_sx;
766 }
767 else {
768 print("cmpcc, set_base_file_name_sx, missing variable\n");
769 }
770  
771 my $result;
772  
773 return ($result);
774  
775 }
776  
777 =head2 sub set_cat_base_file_name_out
778  
779 =cut
780  
781 sub set_cat_base_file_name_out {
782 my ( $self, $base_file_name_out ) = @_;
783  
784 if ( length $base_file_name_out ) {
785  
786 # print(
787 #"cmpcc, set_cat_base_file_name_out, base_file_name_out = $base_file_name_out\n"
788 # );
789  
790 $cmpcc->{_cat_base_file_name_out} = $base_file_name_out;
791 }
792 else {
793 print("cmpcc, set_cat_base_file_name_out, missing variable\n");
794 }
795  
796 my $result;
797  
798 return ($result);
799  
800 }
801  
802 =head2 sub set_delete_base_file_name
803  
804 =cut
805  
806 sub set_delete_base_file_name {
807 my ( $self, $base_file_name ) = @_;
808  
809 if ( length $base_file_name ) {
810  
811 # print(
812 # "cmpcc, set_delete_base_file_name, base_file_name_sx = $base_file_name_sx\n"
813 # );
814  
815 $cmpcc->{_delete_base_file_name} = $base_file_name;
816  
817 }
818 else {
819 print("cmpcc, set_delete_base_file_name, missing variable\n");
820 }
821  
822 my $result;
823 return ($result);
824  
825 }
826  
827 =head2 sub set_cat_su
828  
829 append individual output files to
830 a major product file
831  
832 =cut
833  
834 sub set_cat_su {
835  
836 my ($self) = @_;
837  
838 if ( length $cmpcc->{_cat_base_file_name_out}
839 and length $cmpcc->{_appendix} )
840 {
841  
842 =head2 SYNOPSIS
843  
844 PERL PROGRAM NAME:
845  
846 AUTHOR:
847  
848 DATE:
849  
850 DESCRIPTION:
851  
852 Version:
853  
854 =head2 USE
855  
856 =head3 NOTES
857  
858 =head4 Examples
859  
860 =head2 SYNOPSIS
861  
862 =head3 SEISMIC UNIX NOTES
863  
864 =head2 CHANGES and their DATES
865  
866 =cut
867  
868 my $Project = Project_config->new();
869 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN;
870 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY;
871 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU;
872 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT;
873  
874 my $log = message->new();
875 my $run = flow->new();
876 my $cat_su = cat_su->new();
877 my $data_out = data_out->new();
878  
879 =head2 Declare
880  
881 local variables
882  
883 =cut
884  
885 my (@flow);
886 my (@items);
887 my (@cat_su);
888 my (@data_out);
889  
890 =head2 Set up
891  
892 cat_su parameter values
893  
894 =cut
895  
896 $cat_su->clear();
897 $cat_su->base_file_name1(
898 quotemeta( $DATA_SEISMIC_SU . '/' . $cmpcc->{_appendix} )
899 . $suffix_su );
900  
901 # $cat_su->base_file_name2(
902 # quotemeta( $DATA_SEISMIC_SU . '/' . '00000004' ) . $suffix_su );
903 $cat_su[1] = $cat_su->Step();
904  
905 =head2 Set up
906  
907 data_out parameter values
908  
909 =cut
910  
911 $data_out->clear();
912 $data_out->base_file_name(
913 quotemeta( $cmpcc->{_cat_base_file_name_out} ) );
914 $data_out->suffix_type( quotemeta('su') );
915 $data_out[1] = $data_out->Step();
916  
917 =head2 DEFINE FLOW(s)
918  
919  
920 =cut
921  
922 @items = ( $cat_su[1], $append, $data_out[1], $go );
923 $flow[1] = $run->modules( \@items );
924  
925 =head2 RUN FLOW(s)
926  
927  
928 =cut
929  
930 $run->flow( \$flow[1] );
931  
932 =head2 LOG FLOW(s)
933  
934 to screen and FILE
935  
936 =cut
937  
938 $log->screen( $flow[1] );
939  
940 $log->file(localtime);
941 $log->file( $flow[1] );
942  
943 }
944 else {
945 print(",cmpcc, cat_su, missing variables \n");
946 print(
947 ",cmpcc, cat_su, cmpcc->{_cat_base_file_name_out}=$cmpcc->{_cat_base_file_name_out} \n"
948 );
949 print(",cmpcc, cat_su, cmpcc->{_appendix}=$cmpcc->{_appendix} \n");
950 }
951  
952 } # end set_cat_su
953  
954 =head2 sub set_cat_txt
955  
956 append individual output files to
957 a major product file
958  
959 =cut
960  
961 sub set_cat_txt {
962  
963 my ($self) = @_;
964  
965 if ( length $cmpcc->{_cat_base_file_name_out}
966 and length $cmpcc->{_appendix} )
967 {
968  
969 =head2 SYNOPSIS
970  
971 PERL PROGRAM NAME:
972  
973 AUTHOR:
974  
975 DATE:
976  
977 DESCRIPTION:
978  
979 Version:
980  
981 =head2 USE
982  
983 =head3 NOTES
984  
985 =head4 Examples
986  
987 =head2 SYNOPSIS
988  
989 =head3 SEISMIC UNIX NOTES
990  
991 =head2 CHANGES and their DATES
992  
993 =cut
994  
995 my $Project = Project_config->new();
996 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN;
997 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY;
998 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU;
999 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT;
1000  
1001 my $log = message->new();
1002 my $run = flow->new();
1003 my $cat_txt = cat_txt->new();
1004 my $data_out = data_out->new();
1005  
1006 =head2 Declare
1007  
1008 local variables
1009  
1010 =cut
1011  
1012 my (@flow);
1013 my (@items);
1014 my (@cat_txt);
1015 my (@data_out);
1016  
1017 =head2 Set up
1018  
1019 cat_txt parameter values
1020  
1021 =cut
1022  
1023 $cat_txt->clear();
1024 $cat_txt->base_file_name1(
1025 quotemeta( $DATA_SEISMIC_TXT . '/' . $cmpcc->{_appendix} )
1026 . $suffix_txt );
1027  
1028 $cat_txt[1] = $cat_txt->Step();
1029  
1030 =head2 Set up
1031  
1032 data_out parameter values
1033  
1034 =cut
1035  
1036 $data_out->clear();
1037 $data_out->base_file_name(
1038 quotemeta( $cmpcc->{_cat_base_file_name_out} ) );
1039 $data_out->suffix_type( quotemeta('txt') );
1040 $data_out[1] = $data_out->Step();
1041  
1042 =head2 DEFINE FLOW(s)
1043  
1044  
1045 =cut
1046  
1047 @items = ( $cat_txt[1], $append, $data_out[1], $go );
1048 $flow[1] = $run->modules( \@items );
1049  
1050 =head2 RUN FLOW(s)
1051  
1052  
1053 =cut
1054  
1055 $run->flow( \$flow[1] );
1056  
1057 =head2 LOG FLOW(s)
1058  
1059 to screen and FILE
1060  
1061 =cut
1062  
1063 $log->screen( $flow[1] );
1064  
1065 $log->file(localtime);
1066 $log->file( $flow[1] );
1067  
1068 }
1069 else {
1070 print(",cmpcc, cat_txt, missing variables \n");
1071 print(
1072 ",cmpcc, cat_txt, cmpcc->{_cat_base_file_name_out}=$cmpcc->{_cat_base_file_name_out} \n"
1073 );
1074 print(",cmpcc, cat_txt, cmpcc->{_appendix}=$cmpcc->{_appendix} \n");
1075 }
1076  
1077 } # end set_cat_txt
1078  
1079 #=head2 sub set_cross_correlation_base_file_name_line_in
1080 #
1081 #geometry values
1082 #
1083 #=cut
1084 #
1085 #sub set_cross_correlation_base_file_name_line_in {
1086 # my ($self,$file) = @_;
1087 #
1088 # my $result;
1089 #
1090 # if ( length $file ) {
1091 #
1092 # $cmpcc->{_cross_correlation_base_file_name_line_in} = $file;
1093 #
1094 # }
1095 # else {
1096 # print("cmpcc, set_cross_correlation_base_file_name_line_in, missing value\n");
1097 # }
1098 #
1099 # return ($result);
1100 #}
1101  
1102 =head2 sub set_loaded_w_headers_base_file_name_line_out
1103  
1104 =cut
1105  
1106 sub set_loaded_w_headers_base_file_name_line_out {
1107 my ( $self, $base_file_name_out ) = @_;
1108  
1109 if ( length $base_file_name_out ) {
1110  
1111 # print(
1112 #"cmpcc, set_loaded_w_headers_base_file_name_line_out, base_file_name_out = $base_file_name_out\n"
1113 # );
1114  
1115 $cmpcc->{_loaded_w_headers_base_file_name_line_out} =
1116 $base_file_name_out;
1117 }
1118 else {
1119 print(
1120 "cmpcc, set_loaded_w_headers_base_file_name_line_out, missing variable\n"
1121 );
1122  
1123 }
1124  
1125 my $result;
1126  
1127 return ($result);
1128  
1129 }
1130  
1131 =head2 sub set_data
1132  
1133 =cut
1134  
1135 sub set_data {
1136 my ($self) = @_;
1137  
1138 my $result;
1139  
1140 if ( length $cmpcc->{_data_base_file_name_in}
1141 and length $cmpcc->{_data_base_file_name_out}
1142 and length $cmpcc->{_header_word}
1143 and length $cmpcc->{_suwind_skip}
1144 and length $cmpcc->{_suwind_max_header_value}
1145 and length $cmpcc->{_suwind_min_header_value} )
1146 {
1147  
1148 my $data_base_file_name_in = $cmpcc->{_data_base_file_name_in};
1149 my $data_base_file_name_out = $cmpcc->{_data_base_file_name_out};
1150 my $header_word = $cmpcc->{_header_word};
1151 my $suwind_skip = $cmpcc->{_suwind_skip};
1152 my $suwind_min_header_value = $cmpcc->{_suwind_min_header_value};
1153 my $suwind_max_header_value = $cmpcc->{_suwind_max_header_value};
1154  
1155 =head2 SYNOPSIS
1156  
1157 PERL PROGRAM NAME: set_data.pm
1158  
1159 AUTHOR:
1160  
1161 DATE:
1162  
1163 DESCRIPTION:
1164  
1165 Version:
1166  
1167 =head2 USE
1168  
1169 =head3 NOTES
1170  
1171 =head4 Examples
1172  
1173 =head2 SYNOPSIS
1174  
1175 =head3 SEISMIC UNIX NOTES
1176  
1177 =head2 CHANGES and their DATES
1178  
1179 =cut
1180  
1181 my $Project = Project_config->new();
1182 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN;
1183 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY;
1184 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU;
1185 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT;
1186  
1187 my $log = message->new();
1188 my $run = flow->new();
1189 my $data_in = data_in->new();
1190 my $suwind = suwind->new();
1191 my $data_out = data_out->new();
1192  
1193 =head2 Declare
1194  
1195 local variables
1196  
1197 =cut
1198  
1199 my (@flow);
1200 my (@items);
1201 my (@data_in);
1202 my (@suwind);
1203 my (@data_out);
1204  
1205 =head2 Set up
1206  
1207 data_in parameter values
1208  
1209 =cut
1210  
1211 $data_in->clear();
1212 $data_in->base_file_name( quotemeta($data_base_file_name_in) );
1213 $data_in->suffix_type( quotemeta('su') );
1214 $data_in[1] = $data_in->Step();
1215  
1216 =head2 Set up
1217  
1218 suwind parameter values
1219  
1220 =cut
1221  
1222 $suwind->clear();
1223 $suwind->max( quotemeta($suwind_max_header_value) );
1224 $suwind->min( quotemeta($suwind_min_header_value) );
1225 $suwind->setheaderword( quotemeta($header_word) );
1226 $suwind[1] = $suwind->Step();
1227  
1228 =head2 Set up
1229  
1230 data_out parameter values
1231  
1232 =cut
1233  
1234 $data_out->clear();
1235 $data_out->base_file_name( quotemeta($data_base_file_name_out) );
1236 $data_out->suffix_type( quotemeta('su') );
1237 $data_out[1] = $data_out->Step();
1238  
1239 =head2 DEFINE FLOW(s)
1240  
1241  
1242 =cut
1243  
1244 @items = ( $suwind[1], $in, $data_in[1], $out, $data_out[1], $go );
1245 $flow[1] = $run->modules( \@items );
1246  
1247 =head2 RUN FLOW(s)
1248  
1249  
1250 =cut
1251  
1252 $run->flow( \$flow[1] );
1253  
1254 =head2 LOG FLOW(s)
1255  
1256 to screen and FILE
1257  
1258 =cut
1259  
1260 $log->screen( $flow[1] );
1261  
1262 $log->file(localtime);
1263 $log->file( $flow[1] );
1264  
1265 }
1266 else {
1267 print("cmpcc, set_data, unexpected\n");
1268 }
1269  
1270 return ($result);
1271  
1272 }
1273  
1274 =head2 sub set_data_base_file_name_in
1275  
1276 =cut
1277  
1278 sub set_data_base_file_name_in {
1279 my ( $self, $data_base_file_name_in ) = @_;
1280  
1281 my $result;
1282  
1283 if ( length $data_base_file_name_in ) {
1284  
1285 $cmpcc->{_data_base_file_name_in} = $data_base_file_name_in;
1286  
1287 }
1288 else {
1289 print("cmpcc, data_base_file_name_in=data_base_file_name_in\n");
1290 }
1291  
1292 return ($result);
1293 }
1294  
1295 =head2 sub set_data_base_file_name_out
1296  
1297 =cut
1298  
1299 sub set_data_base_file_name_out {
1300 my ( $self, $data_base_file_name_out ) = @_;
1301  
1302 my $result;
1303  
1304 if ( length $data_base_file_name_out ) {
1305  
1306 $cmpcc->{_data_base_file_name_out} = $data_base_file_name_out;
1307  
1308 }
1309 else {
1310 print("cmpcc, data_base_file_name_out=data_base_file_name_out\n");
1311 }
1312  
1313 return ($result);
1314 }
1315  
1316 =head2 sub set_ep_idx
1317  
1318 =cut
1319  
1320 sub set_ep_idx {
1321 my ( $self, $ep_idx ) = @_;
1322  
1323 if ( length $ep_idx ) {
1324  
1325 $cmpcc->{_ep_idx} = $ep_idx;
1326  
1327 }
1328 else {
1329 print("cmpcc,set_ep_idx-missing value\n");
1330 }
1331  
1332 }
1333  
1334 =head2 sub set_ep_number_of
1335  
1336 =cut
1337  
1338 sub set_ep_number_of {
1339 my ( $self, $ep_number_of ) = @_;
1340  
1341 my $result;
1342  
1343 if ( length $ep_number_of ) {
1344  
1345 $cmpcc->{_ep_number_of} = $ep_number_of;
1346  
1347 }
1348 else {
1349 print("cmpcc, ep_number_of=ep_number_of\n");
1350 }
1351  
1352 return ($result);
1353 }
1354  
1355 =head2 sub set_filter
1356  
1357 =cut
1358  
1359 sub set_filter {
1360 my ($self) = @_;
1361  
1362 my $result;
1363  
1364 if ( length $cmpcc->{_data_base_file_name_in}
1365 and length $cmpcc->{_filter_base_file_name_out}
1366 and length $cmpcc->{_header_word}
1367 and length $cmpcc->{_suwind_max_header_value}
1368 and length $cmpcc->{_suwind_min_header_value} )
1369 {
1370  
1371 my $data_base_file_name_in = $cmpcc->{_data_base_file_name_in};
1372 my $filter_base_file_name_out = $cmpcc->{_filter_base_file_name_out};
1373 my $header_word = $cmpcc->{_header_word};
1374 my $suwind_max_header_value = $cmpcc->{_suwind_max_header_value};
1375 my $suwind_min_header_value = $cmpcc->{_suwind_min_header_value};
1376  
1377 =head2 SYNOPSIS
1378  
1379 PERL PROGRAM NAME: set_filter.pm
1380  
1381 AUTHOR:
1382  
1383 DATE:
1384  
1385 DESCRIPTION:
1386  
1387 Version:
1388  
1389 =head2 USE
1390  
1391 =head3 NOTES
1392  
1393 =head4 Examples
1394  
1395 =head2 SYNOPSIS
1396  
1397 =head3 SEISMIC UNIX NOTES
1398  
1399 =head2 CHANGES and their DATES
1400  
1401 =cut
1402  
1403 my $Project = Project_config->new();
1404 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN;
1405 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY;
1406 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU;
1407 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT;
1408  
1409  
1410 my $log = message->new();
1411 my $run = flow->new();
1412 my $data_in = data_in->new();
1413 my $suwind = suwind->new();
1414 my $data_out = data_out->new();
1415  
1416 =head2 Declare
1417  
1418 local variables
1419  
1420 =cut
1421  
1422 my (@flow);
1423 my (@items);
1424 my (@data_in);
1425 my (@suwind);
1426 my (@data_out);
1427  
1428 =head2 Set up
1429  
1430 data_in parameter values
1431  
1432 =cut
1433  
1434 $data_in->clear();
1435 $data_in->base_file_name( quotemeta($data_base_file_name_in) );
1436 $data_in->suffix_type( quotemeta('su') );
1437 $data_in[1] = $data_in->Step();
1438  
1439 =head2 Set up
1440  
1441 suwind parameter values
1442  
1443 =cut
1444  
1445 $suwind->clear();
1446 $suwind->max( quotemeta($suwind_max_header_value) );
1447 $suwind->min( quotemeta($suwind_min_header_value) );
1448 $suwind->setheaderword( quotemeta($header_word) );
1449 $suwind[1] = $suwind->Step();
1450  
1451 =head2 Set up
1452  
1453 data_out parameter values
1454  
1455 =cut
1456  
1457 $data_out->clear();
1458 $data_out->base_file_name( quotemeta($filter_base_file_name_out) );
1459 $data_out->suffix_type( quotemeta('su') );
1460 $data_out[1] = $data_out->Step();
1461  
1462 =head2 DEFINE FLOW(s)
1463  
1464  
1465 =cut
1466  
1467 @items = ( $suwind[1], $in, $data_in[1], $out, $data_out[1], $go );
1468 $flow[1] = $run->modules( \@items );
1469  
1470 =head2 RUN FLOW(s)
1471  
1472  
1473 =cut
1474  
1475 $run->flow( \$flow[1] );
1476  
1477 =head2 LOG FLOW(s)
1478  
1479 to screen and FILE
1480  
1481 =cut
1482  
1483 # $log->screen( $flow[1] );
1484  
1485 $log->file(localtime);
1486 $log->file( $flow[1] );
1487  
1488 }
1489 else {
1490 print("cmpcc, set_filter, unexpected\n");
1491 }
1492  
1493 return ($result);
1494 }
1495  
1496 =head2 sub set_filter_base_file_name_in
1497  
1498 =cut
1499  
1500 sub set_filter_base_file_name_in {
1501 my ( $self, $filter_base_file_name_in ) = @_;
1502  
1503 my $result;
1504  
1505 if ( length $filter_base_file_name_in ) {
1506  
1507 $cmpcc->{_filter_base_file_name_in} = $filter_base_file_name_in;
1508  
1509 }
1510 else {
1511 print("cmpcc, filter_base_file_name_in=filter_base_file_name_in\n");
1512 }
1513  
1514 return ($result);
1515 }
1516  
1517 =head2 sub set_filter_base_file_name_out
1518  
1519 =cut
1520  
1521 sub set_filter_base_file_name_out {
1522 my ( $self, $filter_base_file_name_out ) = @_;
1523  
1524 my $result;
1525  
1526 if ( length $filter_base_file_name_out ) {
1527  
1528 $cmpcc->{_filter_base_file_name_out} = $filter_base_file_name_out;
1529  
1530 }
1531 else {
1532 print("cmpcc, filter_base_file_name_out=filter_base_file_name_out\n");
1533 }
1534  
1535 return ($result);
1536 }
1537  
1538 =head2 sub set_first_geo_idx
1539  
1540 geometry values
1541  
1542 =cut
1543  
1544 sub set_first_geo_idx {
1545 my ( $self, $first_geo_idx ) = @_;
1546  
1547 my $result;
1548  
1549 if ( length $first_geo_idx ) {
1550  
1551 $cmpcc->{_first_geo_idx} = $first_geo_idx;
1552  
1553 }
1554 else {
1555 print("cmpcc, first_geo_idx=first_geo_idx\n");
1556 }
1557  
1558 return ($result);
1559 }
1560  
1561 =head2 sub set_first_geo_x_m4calc
1562  
1563 geometry values
1564  
1565 =cut
1566  
1567 sub set_first_geo_x_m4calc {
1568 my ( $self, $first_geo_x_m4calc ) = @_;
1569  
1570 my $result;
1571  
1572 if ( length $first_geo_x_m4calc ) {
1573  
1574 $cmpcc->{_first_geo_x_m4calc} = $first_geo_x_m4calc;
1575  
1576 }
1577 else {
1578 print("cmpcc, first_geo_x_m4calc=first_geo_x_m4calc\n");
1579 }
1580  
1581 return ($result);
1582 }
1583  
1584 =head2 sub set_first_line
1585  
1586 geometry values
1587  
1588 =cut
1589  
1590 sub set_first_line {
1591 my ( $self, $first_line ) = @_;
1592  
1593 my $result;
1594  
1595 if ( length $first_line ) {
1596  
1597 $cmpcc->{_first_line} = $first_line;
1598  
1599 }
1600 else {
1601 print("cmpcc, first_line=first_line\n");
1602 }
1603  
1604 return ($result);
1605 }
1606  
1607 =head2 sub set_geo_number_of
1608  
1609 =cut
1610  
1611 sub set_geo_number_of {
1612 my ( $self, $geo_number_of ) = @_;
1613  
1614 if ( length $geo_number_of ) {
1615  
1616 $cmpcc->{_geo_number_of} = $geo_number_of;
1617  
1618 }
1619 else {
1620 print("cmpcc,set_geo_number_of-- missing value\n");
1621 }
1622  
1623 }
1624  
1625 =head2 sub set_geo_x_m_aref
1626  
1627 geometry values
1628  
1629 =cut
1630  
1631 sub set_geo_x_m_aref {
1632 my ( $self, $aref ) = @_;
1633  
1634 my $result;
1635  
1636 if ( length $aref ) {
1637  
1638 $cmpcc->{_geo_x_m_aref} = $aref;
1639  
1640 }
1641 else {
1642 print("cmpcc, set_geo_x_m_aref missing value\n");
1643 }
1644  
1645 return ($result);
1646 }
1647  
1648 =head2 sub set_geo_x_m_aref4cc
1649  
1650 Assemble
1651 gx data
1652 for correlation across a sp
1653 24choose2 = 276 traces
1654 48choose2 = 1128 traces
1655 geophone location does not change but is repeated
1656 24, 48 times ( as many times as there are geophones)
1657  
1658 =cut
1659  
1660 sub set_geo_x_m_aref4cc {
1661 my ( $self, $aref ) = @_;
1662  
1663 if ( length $cmpcc->{_geo_x_m_aref}
1664 and length $cmpcc->{_geo_number_of} )
1665 {
1666 # initialize
1667 my @array;
1668  
1669 my $geo_x_m_aref = $cmpcc->{_geo_x_m_aref};
1670 my $geo_number_of = $cmpcc->{_geo_number_of};
1671  
1672 for ( my $geo_idx = 0 ; $geo_idx < $geo_number_of ; $geo_idx++ ) {
1673  
1674 $array[$geo_idx] = $geo_x_m_aref;
1675 }
1676  
1677 $cmpcc->{_geo_x_m_aref4cc} = \@array;
1678  
1679 # print(
1680 #"cmpcc, set_geo_x_m_aref4cc set_ cmpcc->{_geo_x_m_aref4cc} = @{@{$cmpcc->{_geo_x_m_aref4cc}}[1]}\n"
1681 # );
1682  
1683 }
1684 else {
1685 print("cmpcc, set_geo_x_m_aref--missing value(s)\n");
1686 }
1687  
1688 }
1689  
1690 =head2 sub set_loaded_geometry_headers
1691  
1692 =cut
1693  
1694 sub set_loaded_geometry_headers {
1695 my ($self) = @_;
1696  
1697 if ( length $cmpcc->{_loaded_w_headers_base_file_name_line_out}
1698 and $cmpcc->{_for_loading_base_file_name_line_in}
1699 and $cmpcc->{_line_geometry_base_file_name} )
1700 {
1701  
1702 my $base_file_name_out =
1703 $cmpcc->{_loaded_w_headers_base_file_name_line_out};
1704 my $base_file_name_in = $cmpcc->{_for_loading_base_file_name_line_in};
1705 my $line_geometry = $cmpcc->{_line_geometry_base_file_name};
1706  
1707 =head2 SYNOPSIS
1708  
1709 PERL PROGRAM NAME:
1710  
1711 AUTHOR:
1712  
1713 DATE:
1714  
1715 DESCRIPTION:
1716  
1717 Version:
1718  
1719 =head2 USE
1720  
1721 =head3 NOTES
1722  
1723 =head4 Examples
1724  
1725 =head2 SYNOPSIS
1726  
1727 =head3 SEISMIC UNIX NOTES
1728  
1729 =head2 CHANGES and their DATES
1730  
1731 =cut
1732  
1733  
1734  
1735  
1736 my $Project = Project_config->new();
1737 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN;
1738 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY;
1739 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU;
1740 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT;
1741  
1742  
1743  
1744  
1745 my $log = message->new();
1746 my $run = flow->new();
1747 my $data_in = data_in->new();
1748 my $sulhead = sulhead->new();
1749 my $data_out = data_out->new();
1750  
1751 =head2 Declare
1752  
1753 local variables
1754  
1755 =cut
1756  
1757 my (@flow);
1758 my (@items);
1759 my (@data_in);
1760 my (@sulhead);
1761 my (@data_out);
1762  
1763 =head2 Set up
1764  
1765 data_in parameter values
1766  
1767 =cut
1768  
1769 $data_in->clear();
1770 $data_in->base_file_name( quotemeta($base_file_name_in) );
1771 $data_in->suffix_type( quotemeta('su') );
1772 $data_in[1] = $data_in->Step();
1773  
1774 =head2 Set up
1775  
1776 sulhead parameter values
1777  
1778 =cut
1779  
1780 $sulhead->clear();
1781 $sulhead->cf(
1782 quotemeta( $DATA_SEISMIC_TXT . '/' . $line_geometry )
1783 . $suffix_txt );
1784 my $values = join( ",", $tracl, $gx, $sx, $offset, $cdp );
1785 $sulhead->key( quotemeta($values) );
1786 $sulhead->mc( quotemeta(1) );
1787 $sulhead[1] = $sulhead->Step();
1788  
1789 =head2 Set up
1790  
1791 data_out parameter values
1792  
1793 =cut
1794  
1795 $data_out->clear();
1796 $data_out->base_file_name($base_file_name_out);
1797 $data_out->suffix_type( quotemeta('su') );
1798 $data_out[1] = $data_out->Step();
1799  
1800 =head2 DEFINE FLOW(s)
1801  
1802  
1803 =cut
1804  
1805 @items = ( $sulhead[1], $in, $data_in[1], $out, $data_out[1], $go );
1806 $flow[1] = $run->modules( \@items );
1807  
1808 =head2 RUN FLOW(s)
1809  
1810  
1811 =cut
1812  
1813 $run->flow( \$flow[1] );
1814  
1815 =head2 LOG FLOW(s)
1816  
1817 to screen and FILE
1818  
1819 =cut
1820  
1821 $log->screen( $flow[1] );
1822  
1823 $log->file(localtime);
1824 $log->file( $flow[1] );
1825  
1826 }
1827 else {
1828 print("cmpcc,set_loaded_geometry_headers--missing value(s)\n");
1829 print(
1830 "cmpcc,set_loaded_geometry_headers, loaded_w_headers_base_file_name_line_out: $cmpcc->{_loaded_w_headers_base_file_name_line_out}\n"
1831 );
1832 print(
1833 "cmpcc,set_loaded_geometry_headers, tracl-ordered cross_correlations line: $cmpcc->{_for_loading_base_file_name_line_in}\n"
1834 );
1835 print(
1836 "cmpcc,set_loaded_geometry_headers, line_geometry_base_file_name: $cmpcc->{_line_geometry_base_file_name}\n"
1837 );
1838 }
1839  
1840 }
1841  
1842 =head2 sub set_geom4calc
1843  
1844 Build geophone index and value arrays
1845  
1846 =cut
1847  
1848 sub set_geom4calc {
1849  
1850 my ($self) = @_;
1851  
1852 if ( length $cmpcc->{_first_geo_x_m4calc}
1853 and length $cmpcc->{_last_geo_x_m4calc}
1854 and length $cmpcc->{_geo_x_inc_m4calc} )
1855 {
1856  
1857 my @geo_x_m;
1858 my $geo_number_of;
1859  
1860 my $first_geo_x_m4calc = $cmpcc->{_first_geo_x_m4calc};
1861 my $last_geo_x_m4calc = $cmpcc->{_last_geo_x_m4calc};
1862 my $geo_x_inc_m4calc = $cmpcc->{_geo_x_inc_m4calc};
1863  
1864 for (
1865 my $i = 0, my $geo = $first_geo_x_m4calc ;
1866 $geo <= $last_geo_x_m4calc ;
1867 $i++, $geo = $geo + $geo_x_inc_m4calc
1868 )
1869 {
1870 $geo_x_m[$i] = $geo;
1871  
1872 print("geo_x_m=$geo_x_m[$i]\n");
1873  
1874 }
1875  
1876 $geo_number_of = scalar @geo_x_m;
1877  
1878 $cmpcc->{_geo_number_of} = $geo_number_of;
1879 $cmpcc->{_geo_x_m_aref} = \@geo_x_m;
1880  
1881 print("geo_number_of = $geo_number_of\n");
1882 }
1883 else {
1884 print("cmpcc, set_geom4calc, missing values\n");
1885 print(
1886 "cmpcc, set_geom4calc, first_geo_x_m4calc= $cmpcc->{_first_geo_x_m4calc}\n"
1887 );
1888 print("last_geo_x_m4calc = cmpcc->{_last_geo_x_m4calc}\n");
1889 print("geo_x_inc_m4calc =cmpcc->{_geo_x_inc_m4calc} )\n");
1890 }
1891  
1892 }
1893  
1894 =head2 sub set_geom4data
1895  
1896 Read geophone and shot locations
1897  
1898 =cut
1899  
1900 sub set_geom4data {
1901 my ($self) = @_;
1902  
1903 if ( length $cmpcc->{_base_file_name_gx}
1904 and length $cmpcc->{_base_file_name_sx} )
1905 {
1906  
1907 my $manage_files_by2 = manage_files_by2->new();
1908  
1909 my $base_file_name_gx = $cmpcc->{_base_file_name_gx};
1910 my $base_file_name_sx = $cmpcc->{_base_file_name_sx};
1911  
1912 my $inbound_sx =
1913 $DATA_SEISMIC_TXT . '/' . $base_file_name_sx . $suffix_txt;
1914 my ( $sp_x_m_aref, $num_rows_sx ) =
1915 $manage_files_by2->read_1col($inbound_sx);
1916  
1917 my $inbound_gx =
1918 $DATA_SEISMIC_TXT . '/' . $base_file_name_gx . $suffix_txt;
1919 my ( $geo_x_m_aref, $num_rows_gx ) =
1920 $manage_files_by2->read_1col($inbound_gx);
1921  
1922 my @sx = @$sp_x_m_aref;
1923 # print("sx= @sx\n");
1924 # print("gx= @{$geo_x_m_aref}\n");
1925 # print("num_rows_sx=$num_rows_sx\n");
1926  
1927 $cmpcc->{_geo_number_of} = $num_rows_gx;
1928 $cmpcc->{_geo_x_m_aref} = $geo_x_m_aref;
1929 $cmpcc->{_sp_x_m_aref} = $sp_x_m_aref;
1930  
1931 }
1932 else {
1933 print("cmpcc, set_geom4data, missing values\n");
1934 print(
1935 "cmpcc, set_geom4data, base_file_name_gx= $cmpcc->{_base_file_name_gx} \n"
1936 );
1937 print(
1938 "cmpcc, set_geom4data, base_file_name_sx= $cmpcc->{_base_file_name_sx} \n"
1939 );
1940 }
1941  
1942 }
1943  
1944 =head2 sub set_geo_spread_m4calc
1945  
1946 geometry values
1947  
1948 =cut
1949  
1950 sub set_geo_spread_m4calc {
1951  
1952 my ( $self, $geo_spread_m4calc ) = @_;
1953  
1954 my $result;
1955  
1956 if ( length $geo_spread_m4calc ) {
1957  
1958 $cmpcc->{_geo_spread_m4calc} = $geo_spread_m4calc;
1959  
1960 }
1961 else {
1962 print("cmpcc, missing value,geo_spread_m4calc=$geo_spread_m4calc\n");
1963 }
1964  
1965 return ($result);
1966 }
1967  
1968 =head2 sub set_geo_x_inc_m4calc
1969  
1970 geometry values
1971  
1972 =cut
1973  
1974 sub set_geo_x_inc_m4calc {
1975 my ( $self, $geo_x_inc_m4calc ) = @_;
1976  
1977 my $result;
1978  
1979 if ( length $geo_x_inc_m4calc ) {
1980  
1981 $cmpcc->{_geo_x_inc_m4calc} = $geo_x_inc_m4calc;
1982  
1983 }
1984 else {
1985 print("cmpcc, missinga value,geo_x_inc_m4calc=geo_x_inc_m4calc\n");
1986 }
1987  
1988 return ($result);
1989 }
1990  
1991 =head2 sub set_header_word
1992  
1993 =cut
1994  
1995 sub set_header_word {
1996 my ( $self, $header ) = @_;
1997  
1998 my $result;
1999  
2000 if ( length $header ) {
2001  
2002 $cmpcc->{_header_word} = $header;
2003  
2004 }
2005 else {
2006 print("cmpcc, header=header\n");
2007 }
2008  
2009 return ($result);
2010 }
2011  
2012 =head2 sub set_last_geo_x_m4calc
2013  
2014 geometry values
2015  
2016 =cut
2017  
2018 sub set_last_geo_x_m4calc {
2019 my ( $self, $last_geo_x_m4calc ) = @_;
2020  
2021 my $result;
2022  
2023 if ( length $last_geo_x_m4calc ) {
2024  
2025 $cmpcc->{_last_geo_x_m4calc} = $last_geo_x_m4calc;
2026  
2027 }
2028 else {
2029 print("cmpcc, last_geo_x_m4calc=last_geo_x_m4calc\n");
2030 }
2031  
2032 return ($result);
2033 }
2034  
2035 =head2 sub set_last_line
2036  
2037 geometry values
2038  
2039 =cut
2040  
2041 sub set_last_line {
2042 my ( $self, $last_line ) = @_;
2043  
2044 my $result;
2045 if ( length $last_line ) {
2046  
2047 $cmpcc->{_last_line} = $last_line;
2048  
2049 }
2050 else {
2051 print("cmpcc, last_line=last_line\n");
2052 }
2053  
2054 return ($result);
2055 }
2056  
2057 =head2 sub set_line_geometry_base_file_name
2058  
2059 Name of file to read
2060  
2061 =cut
2062  
2063 sub set_line_geometry_base_file_name {
2064 my ( $self, $geom_file ) = @_;
2065  
2066 if ( length $geom_file ) {
2067  
2068 $cmpcc->{_line_geometry_base_file_name} = $geom_file;
2069  
2070 # print(
2071 #"cmpcc,set_line_geometry_base_file_name,cmpcc->{_line_geometry_base_file_name}=$cmpcc->{_line_geometry_base_file_name}\n"
2072 # );
2073  
2074 }
2075 else {
2076 print("cmpcc, set_line_geometry_base_file_name, missing file name\n");
2077 }
2078  
2079 }
2080  
2081 =head2 sub set_sp_x_m_aref
2082  
2083 geometry values
2084  
2085 =cut
2086  
2087 sub set_sp_x_m_aref {
2088 my ( $self, $aref ) = @_;
2089  
2090 my $result;
2091  
2092 if ( length $aref ) {
2093  
2094 $cmpcc->{_sp_x_m_aref} = $aref;
2095  
2096 }
2097 else {
2098 print("cmpcc, set_sp_x_m_aref missing value\n");
2099 }
2100  
2101 return ($result);
2102 }
2103  
2104 =head2 sub set_sp_x_m_aref4cc
2105  
2106 Assemble
2107 sp data
2108 for correlation across a sp
2109 24choose2 = 276 traces
2110 48choose2 = 1128 traces
2111  
2112 =cut
2113  
2114 sub set_sp_x_m_aref4cc {
2115 my ( $self, $aref ) = @_;
2116  
2117 if ( length $cmpcc->{_sp_x_m_aref}
2118 and length $cmpcc->{_geo_number_of} )
2119 {
2120 # initialize
2121 my @array;
2122  
2123 my $sp_x_m_aref = $cmpcc->{_sp_x_m_aref};
2124 my $geo_number_of = $cmpcc->{_geo_number_of};
2125  
2126 for ( my $geo_idx = 0 ; $geo_idx < $geo_number_of ; $geo_idx++ ) {
2127  
2128 $array[$geo_idx] = $sp_x_m_aref;
2129 }
2130  
2131 $cmpcc->{_sp_x_m_aref4cc} = \@array;
2132 #
2133 # print(
2134 #"cmpcc, set_sp_x_m_aref4cc set_ cmpcc->{_sp_x_m_aref4cc} = @{@{$cmpcc->{_sp_x_m_aref4cc}}[0]}\n"
2135 # );
2136  
2137 }
2138 else {
2139 print("cmpcc, set_sp_x_m_aref--missing value(s)\n");
2140 }
2141  
2142 }
2143  
2144 =head2 sub suffix_type
2145  
2146 geometry values
2147  
2148 =cut
2149  
2150 sub set_suffix_type {
2151 my ( $self, $suffix_type ) = @_;
2152  
2153 my $result;
2154  
2155 if ( length $suffix_type ) {
2156  
2157 $cmpcc->{_suffix_type} = $suffix_type;
2158  
2159 }
2160 else {
2161 print("cmpcc, missing suffix_type=$suffix_type\n");
2162 }
2163  
2164 return ($result);
2165 }
2166  
2167 =head2 sub set_suwind_max_header_value
2168  
2169 geometry values
2170  
2171 =cut
2172  
2173 sub set_suwind_max_header_value {
2174 my ( $self, $suwind_max_header_value ) = @_;
2175  
2176 my $result;
2177  
2178 if ( length $suwind_max_header_value ) {
2179  
2180 $cmpcc->{_suwind_max_header_value} = $suwind_max_header_value;
2181  
2182 }
2183 else {
2184 print("cmpcc, suwind_max_header_value=suwind_max_header_value\n");
2185 }
2186  
2187 return ($result);
2188 }
2189  
2190 =head2 sub set_suwind_min_header_value
2191  
2192 geometry values
2193  
2194 =cut
2195  
2196 sub set_suwind_min_header_value {
2197 my ( $self, $suwind_min_header_value ) = @_;
2198  
2199 my $result;
2200  
2201 if ( length $suwind_min_header_value ) {
2202  
2203 $cmpcc->{_suwind_min_header_value} = $suwind_min_header_value;
2204  
2205 }
2206 else {
2207 print("cmpcc, suwind_min_header_value=suwind_min_header_value\n");
2208 }
2209  
2210 return ($result);
2211 }
2212  
2213 =head2 sub set_suwind_skip
2214  
2215 geometry values
2216  
2217 =cut
2218  
2219 sub set_suwind_skip {
2220 my ( $self, $suwind_skip ) = @_;
2221  
2222 my $result;
2223  
2224 if ( length $suwind_skip ) {
2225  
2226 $cmpcc->{_suwind_skip} = $suwind_skip;
2227  
2228 }
2229 else {
2230 print("cmpcc, suwind_skip=suwind_skip\n");
2231 }
2232  
2233 return ($result);
2234 }
2235  
2236 =head2 sub set_tracl_order
2237  
2238 =cut
2239  
2240 sub set_tracl_order {
2241 my ($self) = @_;
2242  
2243 if ( length $cmpcc->{_tracl_order_base_file_name_in}
2244 and length $cmpcc->{_tracl_order_base_file_name_out} )
2245 {
2246  
2247 my $base_file_name_in = $cmpcc->{_tracl_order_base_file_name_in};
2248  
2249 my $base_file_name_out = $cmpcc->{_tracl_order_base_file_name_out};
2250  
2251 # print("cmpcc, set_tracl_order, cmpcc->{_tracl_order_base_file_name_out = $cmpcc->{_tracl_order_base_file_name_out}\n");
2252  
2253 =head2 SYNOPSIS
2254  
2255 PERL PROGRAM NAME:
2256  
2257 AUTHOR:
2258  
2259 DATE:
2260  
2261 DESCRIPTION:
2262  
2263 Version:
2264  
2265 =head2 USE
2266  
2267 =head3 NOTES
2268  
2269 =head4 Examples
2270  
2271 =head2 SYNOPSIS
2272  
2273 =head3 SEISMIC UNIX NOTES
2274  
2275 =head2 CHANGES and their DATES
2276  
2277 =cut
2278  
2279  
2280 my $Project = Project_config->new();
2281 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN;
2282 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY;
2283 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU;
2284 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT;
2285  
2286 my $log = message->new();
2287 my $run = flow->new();
2288 my $data_in = data_in->new();
2289 my $sushw = sushw->new();
2290 my $data_out = data_out->new();
2291  
2292 =head2 Declare
2293  
2294 local variables
2295  
2296 =cut
2297  
2298 my (@flow);
2299 my (@items);
2300 my (@data_in);
2301 my (@sushw);
2302 my (@data_out);
2303  
2304 =head2 Set up
2305  
2306 data_in parameter values
2307  
2308 =cut
2309  
2310 $data_in->clear();
2311 $data_in->base_file_name( quotemeta($base_file_name_in) );
2312 $data_in->suffix_type( quotemeta('su') );
2313 $data_in[1] = $data_in->Step();
2314  
2315 =head2 Set up
2316  
2317 sushw parameter values
2318  
2319 =cut
2320  
2321 $sushw->clear();
2322 $sushw->first_value( quotemeta('1') );
2323 $sushw->gather_size( quotemeta(0) );
2324 $sushw->header_bias( quotemeta(0) );
2325 $sushw->headerwords( quotemeta($tracl) );
2326 $sushw->intra_gather_inc( quotemeta(1) );
2327 $sushw->inter_gather_inc( quotemeta(0) );
2328 $sushw[1] = $sushw->Step();
2329  
2330 =head2 Set up
2331  
2332 data_out parameter values
2333  
2334 =cut
2335  
2336 $data_out->clear();
2337 $data_out->base_file_name( quotemeta($base_file_name_out) );
2338 $data_out->suffix_type( quotemeta('su') );
2339 $data_out[1] = $data_out->Step();
2340  
2341 =head2 DEFINE FLOW(s)
2342  
2343  
2344 =cut
2345  
2346 @items = ( $sushw[1], $in, $data_in[1], $out, $data_out[1], $go );
2347 $flow[1] = $run->modules( \@items );
2348  
2349 =head2 RUN FLOW(s)
2350  
2351  
2352 =cut
2353  
2354 $run->flow( \$flow[1] );
2355  
2356 =head2 LOG FLOW(s)
2357  
2358 to screen and FILE
2359  
2360 =cut
2361  
2362 $log->screen( $flow[1] );
2363  
2364 $log->file(localtime);
2365 $log->file( $flow[1] );
2366  
2367 }
2368 else {
2369 print("cmpcc, set_tracl_order, missing variable\n");
2370 print(
2371 "cmpcc, set_tracl_order, tracl_order_base_file_name_in = $cmpcc->{_tracl_order_base_file_name_in}\n"
2372 );
2373 print(
2374 "cmpcc, set_tracl_order, tracl_order_base_file_name_out = $cmpcc->{_tracl_order_base_file_name_out}\n"
2375 );
2376 }
2377 }
2378  
2379 =head2 sub set_tracl_order_base_file_name_in
2380  
2381 geometry values
2382  
2383 =cut
2384  
2385 sub set_tracl_order_base_file_name_in {
2386 my ( $self, $file ) = @_;
2387  
2388 my $result;
2389  
2390 if ( length $file ) {
2391  
2392 $cmpcc->{_tracl_order_base_file_name_in} = $file;
2393  
2394 }
2395 else {
2396 print("cmpcc, set_tracl_order_base_file_name_in, missing value\n");
2397 }
2398  
2399 return ($result);
2400 }
2401  
2402 =head2 sub set_tracl_order_base_file_name_out
2403  
2404 geometry values
2405  
2406 =cut
2407  
2408 sub set_tracl_order_base_file_name_out {
2409 my ( $self, $file ) = @_;
2410  
2411 my $result;
2412  
2413 if ( length $file ) {
2414  
2415 $cmpcc->{_tracl_order_base_file_name_out} = $file;
2416  
2417 }
2418 else {
2419 print("cmpcc, set_tracl_order_base_file_name_out, missing value\n");
2420 }
2421  
2422 return ($result);
2423 }
2424  
2425 =head2 sub set_suxcor
2426  
2427 =cut
2428  
2429 sub set_suxcor {
2430 my ($self) = @_;
2431  
2432 my $result;
2433  
2434 if ( length $cmpcc->{_data_base_file_name_in}
2435 and length $cmpcc->{_data_base_file_name_out}
2436 and length $cmpcc->{_filter_base_file_name_in} )
2437 {
2438  
2439 my $data_base_file_name_in = $cmpcc->{_data_base_file_name_in};
2440 my $data_base_file_name_out = $cmpcc->{_data_base_file_name_out};
2441 my $filter_base_file_name_in = $cmpcc->{_filter_base_file_name_in};
2442  
2443 =head2 SYNOPSIS
2444  
2445 PERL PROGRAM NAME: set_suxcor.pm
2446  
2447 AUTHOR:
2448  
2449 DATE:
2450  
2451 DESCRIPTION:
2452  
2453 Version:
2454  
2455 =head2 USE
2456  
2457 =head3 NOTES
2458  
2459 =head4 Examples
2460  
2461 =head2 SYNOPSIS
2462  
2463 =head3 SEISMIC UNIX NOTES
2464  
2465 =head2 CHANGES and their DATES
2466  
2467 =cut
2468  
2469 my $Project = Project_config->new();
2470 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN;
2471 my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY;
2472 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU;
2473 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT;
2474  
2475 my $log = message->new();
2476 my $run = flow->new();
2477 my $data_in = data_in->new();
2478 my $suxcor = suxcor->new();
2479 my $data_out = data_out->new();
2480  
2481 =head2 Declare
2482  
2483 local variables
2484  
2485 =cut
2486  
2487 my (@flow);
2488 my (@items);
2489 my (@data_in);
2490 my (@suxcor);
2491 my (@data_out);
2492  
2493 =head2 Set up
2494  
2495 data_in parameter values
2496  
2497 =cut
2498  
2499 $data_in->clear();
2500 $data_in->base_file_name( quotemeta($data_base_file_name_in) );
2501 $data_in->suffix_type( quotemeta('su') );
2502 $data_in[1] = $data_in->Step();
2503  
2504 =head2 Set up
2505  
2506 suxcor parameter values
2507  
2508 =cut
2509  
2510 $suxcor->clear();
2511 $suxcor->panel( quotemeta(0) );
2512 $suxcor->sufile(
2513 quotemeta( $DATA_SEISMIC_SU . '/' . $filter_base_file_name_in )
2514 . $suffix_su );
2515 $suxcor[1] = $suxcor->Step();
2516  
2517 =head2 Set up
2518  
2519 data_out parameter values
2520  
2521 =cut
2522  
2523 $data_out->clear();
2524 $data_out->base_file_name( quotemeta($data_base_file_name_out) );
2525 $data_out->suffix_type( quotemeta('su') );
2526 $data_out[1] = $data_out->Step();
2527  
2528 =head2 DEFINE FLOW(s)
2529  
2530  
2531 =cut
2532  
2533 @items = ( $suxcor[1], $in, $data_in[1], $out, $data_out[1] );
2534 $flow[1] = $run->modules( \@items );
2535  
2536 =head2 RUN FLOW(s)
2537  
2538  
2539 =cut
2540  
2541 $run->flow( \$flow[1] );
2542  
2543 =head2 LOG FLOW(s)
2544  
2545 to screen and FILE
2546  
2547 =cut
2548  
2549 $log->screen( $flow[1] );
2550  
2551 $log->file(localtime);
2552 $log->file( $flow[1] );
2553  
2554 }
2555 else {
2556 print("cmpcc, set_suxcor, \n");
2557 }
2558  
2559 return ($result);
2560 }
2561  
2562 =head2 sub set_shove_geom
2563  
2564 =cut
2565  
2566 sub set_shove_geom {
2567  
2568 my ($self) = @_;
2569  
2570 my $array = array->new();
2571 my $elements_number_of_pt5 = 0;
2572 my $elements_number_of_pt4 = 0;
2573 my $elements_number_of_pt3 = 0;
2574 my $elements_number_of_pt2 = 0;
2575 my $elements_number_of_pt1 = 0;
2576  
2577 if ( length $cmpcc->{_ep_idx} ) {
2578  
2579 if ( $cmpcc->{_is_aref4cc_pt5} ) {
2580  
2581 $array->clear();
2582 $array->set_ref( $cmpcc->{_aref4cc_pt5} );
2583 $elements_number_of_pt5 = $array->get_elements_number_of();
2584 my $vector_pt5_aref = $array->get_one_row_aref();
2585 $cmpcc->{_vector_pt5_aref} = $vector_pt5_aref;
2586  
2587 print("cmpcc,set_shove_geom,pt5, vector_pt5= @{$cmpcc->{_vector_pt5_aref}}\n");
2588 print("cmpcc,set_shove_geom,pt5, elements_number_of= $elements_number_of_pt5\n");
2589 print("cmpcc,set_shove_geom,pt5, plotting cmp locations\n");
2590 }
2591 else {
2592 print("cmpcc, set2shove_geom,pt5, missing variable \n");
2593 }
2594  
2595 if ( $cmpcc->{_is_aref4cc_pt4} ) {
2596  
2597 $array->clear();
2598 $array->set_ref( $cmpcc->{_aref4cc_pt4} );
2599 $elements_number_of_pt4 = $array->get_elements_number_of();
2600 my $vector_pt4_aref = $array->get_one_row_aref();
2601 $cmpcc->{_vector_pt4_aref} = $vector_pt4_aref;
2602  
2603 print("cmpcc,set_shove_geom,pt4, vector_pt4= @{$cmpcc->{_vector_pt4_aref}}\n");
2604 print("cmpcc,set_shove_geom,pt4, elements_number_of= $elements_number_of_pt4\n");
2605 print("cmpcc,set_shove_geom,pt5, plotting offset values\n");
2606  
2607 }
2608 else {
2609 print("cmpcc, set2shove_geom,pt4, missing variable \n");
2610 }
2611  
2612 if ( $cmpcc->{_is_aref4cc_pt3} ) {
2613  
2614 $array->clear();
2615 $array->set_ref( $cmpcc->{_aref4cc_pt3} );
2616 $elements_number_of_pt3 = $array->get_elements_number_of();
2617 my $vector_pt3_aref = $array->get_one_row_aref();
2618 $cmpcc->{_vector_pt3_aref} = $vector_pt3_aref;
2619  
2620 print("cmpcc,set_shove_geom,pt3, vector_pt3= @{$cmpcc->{_vector_pt3_aref}}\n");
2621 print("cmpcc,set_shove_geom,pt3, elements_number_of= $elements_number_of_pt3\n");
2622 print("cmpcc,set_shove_geom,pt5, plotting sx locations\n");
2623  
2624 }
2625 else {
2626 print("cmpcc, set2shove_geom,pt3, missing variable \n");
2627 }
2628  
2629 if ( $cmpcc->{_is_aref4cc_pt2} ) {
2630  
2631 $array->clear();
2632 $array->set_ref( $cmpcc->{_aref4cc_pt2} );
2633 $elements_number_of_pt2 = $array->get_elements_number_of();
2634 my $vector_pt2_aref = $array->get_one_row_aref();
2635 $cmpcc->{_vector_pt2_aref} = $vector_pt2_aref;
2636  
2637 print("cmpcc,set_shove_geom,pt2, vector_pt2= @{$cmpcc->{_vector_pt2_aref}}\n");
2638 print("cmpcc,set_shove_geom,pt2, elements_number_of= $elements_number_of_pt2\n");
2639 print("cmpcc,set_shove_geom,pt5, plotting gx locations\n");
2640  
2641 }
2642 else {
2643 print("cmpcc, set2shove_geom, pt2, missing variable \n");
2644 }
2645  
2646 if ( $cmpcc->{_is_aref4cc_pt1_tracl} ) {
2647  
2648 my @vector_pt1;
2649  
2650 $array->clear();
2651 $array->set_ref( $cmpcc->{_aref4cc_pt2} );
2652 $elements_number_of_pt2 = $array->get_elements_number_of();
2653  
2654 my $start = $cmpcc->{_ep_idx} * $elements_number_of_pt2 + 1;
2655 $vector_pt1[0] = $start;
2656  
2657 for (
2658 my $i = 1, my $j = 0 ;
2659 $i < $elements_number_of_pt2 ;
2660 $j++, $i++
2661 )
2662 {
2663  
2664 $vector_pt1[$i] = ( $vector_pt1[$j] + 1 );
2665 }
2666  
2667 $cmpcc->{_vector_pt1_aref} = \@vector_pt1;
2668  
2669 print("cmpcc,set_shove_geom,with tracl,pt1(i.e.,2), vector_pt1= @{$cmpcc->{_vector_pt1_aref}}\n");
2670 print("cmpcc,set_shove_geom,with tracl, pt1(i.e.,2), elements_number_of= $elements_number_of_pt2\n");
2671 print("cmpcc,set_shove_geom,pt5, plotting trace sequential numbers\n");
2672  
2673 }
2674 else {
2675 print("cmpcc, set2shove_geom,pt1,tracl,missing variable \n");
2676 }
2677  
2678 if ( $cmpcc->{_is_aref4cc_pt1} ) {
2679  
2680 $array->clear();
2681 $array->set_ref( $cmpcc->{_aref4cc_pt1} );
2682 $elements_number_of_pt1 = $array->get_elements_number_of();
2683 my $vector_pt1_aref = $array->get_one_row_aref();
2684 $cmpcc->{_vector_pt1_aref} = $vector_pt1_aref;
2685  
2686 print("cmpcc,set_shove_geom,without tracl,pt2, vector_pt1= $cmpcc->{_vector_pt1_aref}}\n");
2687 print("cmpcc,set_shove_geom,without tracl, pt2, elements_number_of= $elements_number_of_pt1\n");
2688  
2689 }
2690 else {
2691 #NADA
2692 # print("cmpcc, set2shove_geom,pt1.b, missing variable \n");
2693 }
2694  
2695 }
2696 else {
2697 print("cmpcc, set_shove_geom, missing variable(s) \n");
2698 }
2699  
2700 }
2701  
2702 =head2 sub set2shove_pt1
2703  
2704 =cut
2705  
2706 sub set2shove_pt1 {
2707  
2708 my ( $self, $aref4cc ) = @_;
2709  
2710 if ( length $aref4cc
2711 and $aref4cc eq $tracl )
2712 {
2713  
2714 $cmpcc->{_is_aref4cc_pt1_tracl} = $true;
2715  
2716 }
2717 elsif ( length $aref4cc ) {
2718  
2719 $cmpcc->{_aref4cc_pt1} = $aref4cc;
2720 $cmpcc->{_is_aref4cc_pt1_tracl} = $false;
2721  
2722 }
2723 else {
2724 print("cmpcc, set2shove_pt1, missing file name \n");
2725 }
2726 }
2727  
2728 =head2 sub set2shove_pt2
2729  
2730 =cut
2731  
2732 sub set2shove_pt2 {
2733  
2734 my ( $self, $aref4cc ) = @_;
2735  
2736 if ( length $aref4cc ) {
2737  
2738 $cmpcc->{_aref4cc_pt2} = $aref4cc;
2739 $cmpcc->{_is_aref4cc_pt2} = $true;
2740  
2741 }
2742 else {
2743 print("cmpcc, set2shove_pt2, missing file name \n");
2744 }
2745 }
2746  
2747 =head2 sub set2shove_pt3
2748  
2749 =cut
2750  
2751 sub set2shove_pt3 {
2752  
2753 my ( $self, $aref4cc ) = @_;
2754  
2755 if ( length $aref4cc ) {
2756  
2757 $cmpcc->{_aref4cc_pt3} = $aref4cc;
2758 $cmpcc->{_is_aref4cc_pt3} = $true;
2759  
2760 }
2761 else {
2762 print("cmpcc, set2shove_pt3, missing file name \n");
2763 }
2764 }
2765  
2766 =head2 sub set2shove_pt4
2767  
2768 =cut
2769  
2770 sub set2shove_pt4 {
2771  
2772 my ( $self, $aref4cc ) = @_;
2773  
2774 if ( length $aref4cc ) {
2775  
2776 $cmpcc->{_aref4cc_pt4} = $aref4cc;
2777 $cmpcc->{_is_aref4cc_pt4} = $true;
2778  
2779 }
2780 else {
2781 print("cmpcc, set2shove_pt4, missing file name \n");
2782 }
2783 }
2784  
2785 =head2 sub set2shove_pt5
2786  
2787 =cut
2788  
2789 sub set2shove_pt5 {
2790  
2791 my ( $self, $aref4cc ) = @_;
2792  
2793 if ( length $aref4cc ) {
2794  
2795 $cmpcc->{_aref4cc_pt5} = $aref4cc;
2796 $cmpcc->{_is_aref4cc_pt5} = $true;
2797  
2798 }
2799 else {
2800 print("cmpcc, set2shove_pt5, missing file name \n");
2801 }
2802 }
2803  
2804 =head2 sub set4loading_base_file_name_line_in
2805  
2806 =cut
2807  
2808 sub set4loading_base_file_name_line_in {
2809  
2810 my ( $self, $file ) = @_;
2811  
2812 my $result;
2813  
2814 if ( length $file ) {
2815  
2816 $cmpcc->{_for_loading_base_file_name_line_in} = $file;
2817  
2818 # print("cmpcc,set4loading_base_file_name_line_in,file=$file\n");
2819  
2820 }
2821 else {
2822 print("cmpcc,set4loading_base_file_name_line_in, missing file name \n");
2823 }
2824  
2825 }
2826  
2827 =head2 sub set4shove_line_geom_base_file_name_out
2828  
2829 =cut
2830  
2831 sub set4shove_line_geom_base_file_name_out {
2832  
2833 my ( $self, $file ) = @_;
2834  
2835 my $result;
2836  
2837 if ( length $file ) {
2838  
2839 $cmpcc->{_shove_line_geom_base_file_name_out} = $file;
2840  
2841 }
2842 else {
2843 print(
2844 "cmpcc, set4shove_line_geom_base_file_name_out, missing file name \n"
2845 );
2846 }
2847 }
2848  
2849 =head2 sub set4shove_sp_gather_geom_base_file_name_out
2850  
2851 =cut
2852  
2853 sub set4shove_sp_gather_geom_base_file_name_out {
2854  
2855 my ( $self, $file ) = @_;
2856  
2857 my $result;
2858  
2859 if ( length $file ) {
2860  
2861 $cmpcc->{_shove_sp_gather_geom_base_file_name_out} = $file;
2862 $cmpcc->{_shove_sp_gather_geom_outbound} =
2863 $DATA_SEISMIC_TXT . '/' . $file . $suffix_txt;
2864  
2865 }
2866 else {
2867 print(
2868 "cmpcc, set4shove_sp_gather_geom_base_file_name_out, missing file name \n"
2869 );
2870 }
2871 }
2872  
2873 1;