lib/App/SeismicUnixGui/sunix/header/sustaticrrs.pm untested

filter: Statementstmt 0.0% 0 / 168 Branchbran 0.0% 0 / 38 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 27 Podpod 0.0% 0 / 23 totaltotal 0.0% 0 / 256 CC 20 SCAR 16.7
CC
20
Cov
0%
V_r
6.0
blvl_file
6.0
dx
6.0
CRAP 5.3
1 package App::SeismicUnixGui::sunix::header::sustaticrrs;
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 SUSTATICRRS - Elevation STATIC corrections, apply corrections from
25  
26 headers or from a source and receiver statics file,
27  
28 includes application of Residual Refraction Statics
29  
30  
31  
32 sustaticrrs <stdin >stdout [optional parameters]
33  
34  
35  
36 Required parameters:
37  
38 none
39  
40 Optional Parameters:
41  
42 v0=v1 or user-defined or from header, weathering velocity
43  
44 v1=user-defined or from header, subweathering velocity
45  
46 hdrs=0 =1 to read statics from headers
47  
48 =2 to read statics from files
49  
50 sign=1 =-1 to subtract statics from traces(up shift)
51  
52 Options when hdrs=2:
53  
54 sou_file= input file for source statics (ms)
55  
56 rec_file= input file for receiver statics (ms)
57  
58 ns=240 number of sources
59  
60 nr=335 number of receivers
61  
62 no=96 number of offsets
63  
64  
65  
66 Options when hdrs=3:
67  
68 blvl_file= base of the near-surface model file (sampled
69  
70 at CMP locations)
71  
72 refr_file= horizontal reference datum file (sampled at
73  
74 CMP locations)
75  
76 nsamp= number of midpoints on line
77  
78 fx= first x location in velocity model
79  
80 dx= midpoint interval
81  
82 V_r= replacement velocity
83  
84 mx= number of velocity model samples in
85  
86 lateral direction
87  
88 mz= number of velocity model samples in
89  
90 vertical direction
91  
92 dzv= velocity model depth interval
93  
94 vfile= near-surface velocity model
95  
96  
97  
98 Options when hdrs=4:
99  
100 nsamp= number of midpoints on line
101  
102 fx= first x location in velocity model ",
103  
104 dx= midpoint interval ",
105  
106  
107  
108 Options when hdrs=5:
109  
110 none
111  
112  
113  
114 Notes:
115  
116 For hdrs=1, statics calculation is not performed, statics correction
117  
118 is applied to the data by reading statics (in ms) from the header.
119  
120  
121  
122 For hdrs=0, field statics are calculated, and
123  
124 input field sut is assumed measured in ms.
125  
126 output field sstat equals 10^scalel*(sdel - selev + sdepth)/swevel
127  
128 output field gstat equals sstat - sut/1000.
129  
130 output field tstat equals sstat + gstat + 10^scalel*(selev - gelev)/wevel
131  
132  
133  
134 For hdrs=2, statics are surface consistently obtained from the
135  
136 statics files. The geometry should be regular.
137  
138 The source- and receiver-statics files should be unformated C binary
139  
140 floats and contain the statics (in ms) as a function of surface location.
141  
142  
143  
144 For hdrs=3, residual refraction statics and average refraction statics
145  
146 are computed. For hdrs=4, residual refraction statics are applied,
147  
148 and for hdrs=5, average refraction statics are applied (Cox, 1999).
149  
150 These three options are coupled in many data processing sequences:
151  
152 before stack residual and average refraction statics are computed but
153  
154 only residual refractions statics are applied, and after stack average
155  
156 refraction statics are applied. Refraction statics are often split
157  
158 like this to avoid biasing stacking velocities. The files blvl_file
159  
160 and refr_file are the base of the velocity model defined in vfile and
161  
162 the final reference datum, as described by Cox (1999), respectively.
163  
164 Residual refraction statics are stored in the header field gstat, and
165  
166 the average statics are stored in the header field tstat. V_r is the
167  
168 replacement velocity as described by Cox (1999). The velocity file,
169  
170 vfile, is designed to work with a horizontal upper surface defined in
171  
172 refr_file. If the survey has irregular topography, the horizontal
173  
174 upper surface should be above the highest topographic point on the
175  
176 line, and the velocity between this horizontal surface and topography
177  
178 should be some very large value, such as 999999999, so that the
179  
180 traveltimes through that region are inconsequential.
181  
182  
183  
184 Credits:
185  
186 CWP: Jamie Burns
187  
188  
189  
190 CWP: Modified by Mohammed Alfaraj, 11/10/1992, for reading
191  
192 statics from headers and including sign (+-) option
193  
194  
195  
196 CWP: Modified by Timo Tjan, 29 June 1995, to include input of
197  
198 source and receiver statics from files.
199  
200  
201  
202 CWP: Modified by Chris Robinson, 11/2000, to include the splitting
203  
204 of refraction statics into residuals and averages
205  
206  
207  
208 Trace header fields accessed: ns, dt, delrt, gelev, selev,
209  
210 sdepth, gdel, sdel, swevel, sut, scalel
211  
212 Trace header fields modified: sstat, gstat, tstat
213  
214  
215  
216 References:
217  
218  
219  
220 Cox, M., 1999, Static corrections for seismic reflection surveys:
221  
222 Soc. Expl. Geophys.
223  
224  
225  
226  
227  
228 =head2 User's notes (Juan Lorenzo)
229 untested
230  
231 =cut
232  
233  
234 =head2 CHANGES and their DATES
235  
236 =cut
237  
238 use Moose;
239 our $VERSION = '0.0.1';
240  
241  
242 =head2 Import packages
243  
244 =cut
245  
246 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
247  
248 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
249 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
250  
251  
252 =head2 instantiation of packages
253  
254 =cut
255  
256 my $get = L_SU_global_constants->new();
257 my $Project = Project_config->new();
258 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
259 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
260 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
261  
262 my $PS_SEISMIC = $Project->PS_SEISMIC();
263  
264 my $var = $get->var();
265 my $on = $var->{_on};
266 my $off = $var->{_off};
267 my $true = $var->{_true};
268 my $false = $var->{_false};
269 my $empty_string = $var->{_empty_string};
270  
271 =head2 Encapsulated
272 hash of private variables
273  
274 =cut
275  
276 my $sustaticrrs = {
277 _V_r => '',
278 _blvl_file => '',
279 _dx => '',
280 _dzv => '',
281 _fx => '',
282 _hdrs => '',
283 _mx => '',
284 _mz => '',
285 _no => '',
286 _nr => '',
287 _ns => '',
288 _nsamp => '',
289 _rec_file => '',
290 _refr_file => '',
291 _sign => '',
292 _sou_file => '',
293 _v0 => '',
294 _v1 => '',
295 _vfile => '',
296 _Step => '',
297 _note => '',
298  
299 };
300  
301 =head2 sub Step
302  
303 collects switches and assembles bash instructions
304 by adding the program name
305  
306 =cut
307  
308 sub Step {
309  
310 $sustaticrrs->{_Step} = 'sustaticrrs'.$sustaticrrs->{_Step};
311 return ( $sustaticrrs->{_Step} );
312  
313 }
314  
315  
316 =head2 sub note
317  
318 collects switches and assembles bash instructions
319 by adding the program name
320  
321 =cut
322  
323 sub note {
324  
325 $sustaticrrs->{_note} = 'sustaticrrs'.$sustaticrrs->{_note};
326 return ( $sustaticrrs->{_note} );
327  
328 }
329  
330  
331  
332 =head2 sub clear
333  
334 =cut
335  
336 sub clear {
337  
338 $sustaticrrs->{_V_r} = '';
339 $sustaticrrs->{_blvl_file} = '';
340 $sustaticrrs->{_dx} = '';
341 $sustaticrrs->{_dzv} = '';
342 $sustaticrrs->{_fx} = '';
343 $sustaticrrs->{_hdrs} = '';
344 $sustaticrrs->{_mx} = '';
345 $sustaticrrs->{_mz} = '';
346 $sustaticrrs->{_no} = '';
347 $sustaticrrs->{_nr} = '';
348 $sustaticrrs->{_ns} = '';
349 $sustaticrrs->{_nsamp} = '';
350 $sustaticrrs->{_rec_file} = '';
351 $sustaticrrs->{_refr_file} = '';
352 $sustaticrrs->{_sign} = '';
353 $sustaticrrs->{_sou_file} = '';
354 $sustaticrrs->{_v0} = '';
355 $sustaticrrs->{_v1} = '';
356 $sustaticrrs->{_vfile} = '';
357 $sustaticrrs->{_Step} = '';
358 $sustaticrrs->{_note} = '';
359 }
360  
361  
362 =head2 sub V_r
363  
364  
365 =cut
366  
367 sub V_r {
368  
369 my ( $self,$V_r ) = @_;
370 if ( $V_r ne $empty_string ) {
371  
372 $sustaticrrs->{_V_r} = $V_r;
373 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' V_r='.$sustaticrrs->{_V_r};
374 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' V_r='.$sustaticrrs->{_V_r};
375  
376 } else {
377 print("sustaticrrs, V_r, missing V_r,\n");
378 }
379 }
380  
381  
382 =head2 sub blvl_file
383  
384  
385 =cut
386  
387 sub blvl_file {
388  
389 my ( $self,$blvl_file ) = @_;
390 if ( $blvl_file ne $empty_string ) {
391  
392 $sustaticrrs->{_blvl_file} = $blvl_file;
393 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' blvl_file='.$sustaticrrs->{_blvl_file};
394 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' blvl_file='.$sustaticrrs->{_blvl_file};
395  
396 } else {
397 print("sustaticrrs, blvl_file, missing blvl_file,\n");
398 }
399 }
400  
401  
402 =head2 sub dx
403  
404  
405 =cut
406  
407 sub dx {
408  
409 my ( $self,$dx ) = @_;
410 if ( $dx ne $empty_string ) {
411  
412 $sustaticrrs->{_dx} = $dx;
413 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' dx='.$sustaticrrs->{_dx};
414 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' dx='.$sustaticrrs->{_dx};
415  
416 } else {
417 print("sustaticrrs, dx, missing dx,\n");
418 }
419 }
420  
421  
422 =head2 sub dzv
423  
424  
425 =cut
426  
427 sub dzv {
428  
429 my ( $self,$dzv ) = @_;
430 if ( $dzv ne $empty_string ) {
431  
432 $sustaticrrs->{_dzv} = $dzv;
433 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' dzv='.$sustaticrrs->{_dzv};
434 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' dzv='.$sustaticrrs->{_dzv};
435  
436 } else {
437 print("sustaticrrs, dzv, missing dzv,\n");
438 }
439 }
440  
441  
442 =head2 sub fx
443  
444  
445 =cut
446  
447 sub fx {
448  
449 my ( $self,$fx ) = @_;
450 if ( $fx ne $empty_string ) {
451  
452 $sustaticrrs->{_fx} = $fx;
453 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' fx='.$sustaticrrs->{_fx};
454 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' fx='.$sustaticrrs->{_fx};
455  
456 } else {
457 print("sustaticrrs, fx, missing fx,\n");
458 }
459 }
460  
461  
462 =head2 sub hdrs
463  
464  
465 =cut
466  
467 sub hdrs {
468  
469 my ( $self,$hdrs ) = @_;
470 if ( $hdrs ne $empty_string ) {
471  
472 $sustaticrrs->{_hdrs} = $hdrs;
473 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' hdrs='.$sustaticrrs->{_hdrs};
474 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' hdrs='.$sustaticrrs->{_hdrs};
475  
476 } else {
477 print("sustaticrrs, hdrs, missing hdrs,\n");
478 }
479 }
480  
481  
482 =head2 sub mx
483  
484  
485 =cut
486  
487 sub mx {
488  
489 my ( $self,$mx ) = @_;
490 if ( $mx ne $empty_string ) {
491  
492 $sustaticrrs->{_mx} = $mx;
493 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' mx='.$sustaticrrs->{_mx};
494 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' mx='.$sustaticrrs->{_mx};
495  
496 } else {
497 print("sustaticrrs, mx, missing mx,\n");
498 }
499 }
500  
501  
502 =head2 sub mz
503  
504  
505 =cut
506  
507 sub mz {
508  
509 my ( $self,$mz ) = @_;
510 if ( $mz ne $empty_string ) {
511  
512 $sustaticrrs->{_mz} = $mz;
513 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' mz='.$sustaticrrs->{_mz};
514 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' mz='.$sustaticrrs->{_mz};
515  
516 } else {
517 print("sustaticrrs, mz, missing mz,\n");
518 }
519 }
520  
521  
522 =head2 sub no
523  
524  
525 =cut
526  
527 sub no {
528  
529 my ( $self,$no ) = @_;
530 if ( $no ne $empty_string ) {
531  
532 $sustaticrrs->{_no} = $no;
533 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' no='.$sustaticrrs->{_no};
534 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' no='.$sustaticrrs->{_no};
535  
536 } else {
537 print("sustaticrrs, no, missing no,\n");
538 }
539 }
540  
541  
542 =head2 sub nr
543  
544  
545 =cut
546  
547 sub nr {
548  
549 my ( $self,$nr ) = @_;
550 if ( $nr ne $empty_string ) {
551  
552 $sustaticrrs->{_nr} = $nr;
553 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' nr='.$sustaticrrs->{_nr};
554 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' nr='.$sustaticrrs->{_nr};
555  
556 } else {
557 print("sustaticrrs, nr, missing nr,\n");
558 }
559 }
560  
561  
562 =head2 sub ns
563  
564  
565 =cut
566  
567 sub ns {
568  
569 my ( $self,$ns ) = @_;
570 if ( $ns ne $empty_string ) {
571  
572 $sustaticrrs->{_ns} = $ns;
573 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' ns='.$sustaticrrs->{_ns};
574 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' ns='.$sustaticrrs->{_ns};
575  
576 } else {
577 print("sustaticrrs, ns, missing ns,\n");
578 }
579 }
580  
581  
582 =head2 sub nsamp
583  
584  
585 =cut
586  
587 sub nsamp {
588  
589 my ( $self,$nsamp ) = @_;
590 if ( $nsamp ne $empty_string ) {
591  
592 $sustaticrrs->{_nsamp} = $nsamp;
593 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' nsamp='.$sustaticrrs->{_nsamp};
594 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' nsamp='.$sustaticrrs->{_nsamp};
595  
596 } else {
597 print("sustaticrrs, nsamp, missing nsamp,\n");
598 }
599 }
600  
601  
602 =head2 sub rec_file
603  
604  
605 =cut
606  
607 sub rec_file {
608  
609 my ( $self,$rec_file ) = @_;
610 if ( $rec_file ne $empty_string ) {
611  
612 $sustaticrrs->{_rec_file} = $rec_file;
613 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' rec_file='.$sustaticrrs->{_rec_file};
614 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' rec_file='.$sustaticrrs->{_rec_file};
615  
616 } else {
617 print("sustaticrrs, rec_file, missing rec_file,\n");
618 }
619 }
620  
621  
622 =head2 sub refr_file
623  
624  
625 =cut
626  
627 sub refr_file {
628  
629 my ( $self,$refr_file ) = @_;
630 if ( $refr_file ne $empty_string ) {
631  
632 $sustaticrrs->{_refr_file} = $refr_file;
633 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' refr_file='.$sustaticrrs->{_refr_file};
634 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' refr_file='.$sustaticrrs->{_refr_file};
635  
636 } else {
637 print("sustaticrrs, refr_file, missing refr_file,\n");
638 }
639 }
640  
641  
642 =head2 sub sign
643  
644  
645 =cut
646  
647 sub sign {
648  
649 my ( $self,$sign ) = @_;
650 if ( $sign ne $empty_string ) {
651  
652 $sustaticrrs->{_sign} = $sign;
653 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' sign='.$sustaticrrs->{_sign};
654 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' sign='.$sustaticrrs->{_sign};
655  
656 } else {
657 print("sustaticrrs, sign, missing sign,\n");
658 }
659 }
660  
661  
662 =head2 sub sou_file
663  
664  
665 =cut
666  
667 sub sou_file {
668  
669 my ( $self,$sou_file ) = @_;
670 if ( $sou_file ne $empty_string ) {
671  
672 $sustaticrrs->{_sou_file} = $sou_file;
673 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' sou_file='.$sustaticrrs->{_sou_file};
674 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' sou_file='.$sustaticrrs->{_sou_file};
675  
676 } else {
677 print("sustaticrrs, sou_file, missing sou_file,\n");
678 }
679 }
680  
681  
682 =head2 sub v0
683  
684  
685 =cut
686  
687 sub v0 {
688  
689 my ( $self,$v0 ) = @_;
690 if ( $v0 ne $empty_string ) {
691  
692 $sustaticrrs->{_v0} = $v0;
693 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' v0='.$sustaticrrs->{_v0};
694 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' v0='.$sustaticrrs->{_v0};
695  
696 } else {
697 print("sustaticrrs, v0, missing v0,\n");
698 }
699 }
700  
701  
702 =head2 sub v1
703  
704  
705 =cut
706  
707 sub v1 {
708  
709 my ( $self,$v1 ) = @_;
710 if ( $v1 ne $empty_string ) {
711  
712 $sustaticrrs->{_v1} = $v1;
713 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' v1='.$sustaticrrs->{_v1};
714 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' v1='.$sustaticrrs->{_v1};
715  
716 } else {
717 print("sustaticrrs, v1, missing v1,\n");
718 }
719 }
720  
721  
722 =head2 sub vfile
723  
724  
725 =cut
726  
727 sub vfile {
728  
729 my ( $self,$vfile ) = @_;
730 if ( $vfile ne $empty_string ) {
731  
732 $sustaticrrs->{_vfile} = $vfile;
733 $sustaticrrs->{_note} = $sustaticrrs->{_note}.' vfile='.$sustaticrrs->{_vfile};
734 $sustaticrrs->{_Step} = $sustaticrrs->{_Step}.' vfile='.$sustaticrrs->{_vfile};
735  
736 } else {
737 print("sustaticrrs, vfile, missing vfile,\n");
738 }
739 }
740  
741  
742 =head2 sub get_max_index
743  
744 max index = number of input variables -1
745
746 =cut
747
748 sub get_max_index {
749 my ($self) = @_;
750 my $max_index = 18;
751  
752 return($max_index);
753 }
754
755
756 1;