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

filter: Statementstmt 0.0% 0 / 105 Branchbran 0.0% 0 / 20 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 18 Podpod 0.0% 0 / 14 totaltotal 0.0% 0 / 157 CC 11 SCAR 15.8
CC
11
Cov
0%
elevation
6.0
hdrs
6.0
no
6.0
CRAP 4.9
1 package App::SeismicUnixGui::sunix::header::sustaticB;
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 SUSTATICB - Elevation static corrections, apply corrections from
25  
26 headers or from a source and receiver statics file
27  
28 (beta submitted by J. W. Neese)
29  
30  
31  
32 sustaticB <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 =3 to read from output files of suresstat
51  
52 sign=1 apply static correction (add tstat values)
53  
54 =-1 apply negative of tstat values
55  
56 Options when hdrs=2 and hdrs=3:
57  
58 sou_file= input file for source statics (ms)
59  
60 rec_file= input file for receiver statics (ms)
61  
62 ns=240 (2)number of sources; (3) max fldr
63  
64 nr=335 number of receivers
65  
66 no=96 number of offsets
67  
68  
69  
70 Notes:
71  
72 For hdrs=1, statics calculation is not performed, statics correction
73  
74 is applied to the data by reading statics (in ms) from the header.
75  
76  
77  
78 For hdrs=0, field statics are calculated, and
79  
80 input field sut is assumed measured in ms.
81  
82 output field sstat equals 10^scalel*(sdel - selev + sdepth)/swevel
83  
84 output field gstat equals sstat - sut/1000.
85  
86 output field tstat equals sstat + gstat + 10^scalel*(selev - gelev)/wevel
87  
88  
89  
90 For hdrs=2, statics are surface consistently obtained from the
91  
92 statics files. The geometry should be regular.
93  
94 The source- and receiver-statics files should be unformated C binary
95  
96 floats and contain the statics (in ms) as a function of surface location.
97  
98  
99  
100 For hdrs=3, statics are read from the output files of suresstat, with
101  
102 the same options as hdrs=2 (but use no=max traces per shot and assume
103  
104 that ns=max fldr number and nr=max receiver number).
105  
106 For each shot number (trace header fldr) and each receiver number
107  
108 (trace header tracf) the program will look up the appropriate static
109  
110 correction. The geometry need not be regular as each trace is treated
111  
112 independently.
113  
114  
115  
116 Caveat: The static shifts are computed with the assumption that the
117  
118 desired datum is sea level (elevation=0). You may need to shift the
119  
120 selev and gelev header values via suchw.
121  
122 Example: subtracting min(selev,gelev)=25094431
123  
124  
125  
126 suchw < CR290.su key1->:selev,gelev key2->:selev,gelev key3->:selev,gelev \\
127  
128 a->:-25094431,-25094431 b->:1,1 c->:0,0 > CR290datum.su
129  
130  
131  
132 Credits:
133  
134 CWP: Jamie Burns
135  
136  
137  
138 CWP: Modified by Mohammed Alfaraj, 11/10/1992, for reading
139  
140 statics from headers and including sign (+-) option
141  
142  
143  
144 CWP: Modified by Timo Tjan, 29 June 1995, to include input of
145  
146 source and receiver statics from files.
147  
148  
149  
150 modified by Thomas Pratt, USGS, Feb, 2000 to read statics from
151  
152 the output files of suresstat
153  
154  
155  
156 Logic changed by JWN to fix options hdrs=2,3 ???
157  
158  
159  
160 Trace header fields accessed: ns, dt, delrt, gelev, selev,
161  
162 sdepth, gdel, sdel, swevel, sut, scalel, fldr, tracf
163  
164 Trace header fields modified: sstat, gstat, tstat
165  
166  
167  
168  
169  
170 =head2 User's notes (Juan Lorenzo)
171 untested
172  
173 =cut
174  
175  
176 =head2 CHANGES and their DATES
177  
178 =cut
179  
180 use Moose;
181 our $VERSION = '0.0.1';
182  
183  
184 =head2 Import packages
185  
186 =cut
187  
188 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
189  
190 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
191 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
192  
193  
194 =head2 instantiation of packages
195  
196 =cut
197  
198 my $get = L_SU_global_constants->new();
199 my $Project = Project_config->new();
200 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
201 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
202 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
203  
204 my $PS_SEISMIC = $Project->PS_SEISMIC();
205  
206 my $var = $get->var();
207 my $on = $var->{_on};
208 my $off = $var->{_off};
209 my $true = $var->{_true};
210 my $false = $var->{_false};
211 my $empty_string = $var->{_empty_string};
212  
213 =head2 Encapsulated
214 hash of private variables
215  
216 =cut
217  
218 my $sustaticB = {
219 _elevation => '',
220 _hdrs => '',
221 _no => '',
222 _nr => '',
223 _ns => '',
224 _rec_file => '',
225 _sign => '',
226 _sou_file => '',
227 _v0 => '',
228 _v1 => '',
229 _Step => '',
230 _note => '',
231  
232 };
233  
234 =head2 sub Step
235  
236 collects switches and assembles bash instructions
237 by adding the program name
238  
239 =cut
240  
241 sub Step {
242  
243 $sustaticB->{_Step} = 'sustaticB'.$sustaticB->{_Step};
244 return ( $sustaticB->{_Step} );
245  
246 }
247  
248  
249 =head2 sub note
250  
251 collects switches and assembles bash instructions
252 by adding the program name
253  
254 =cut
255  
256 sub note {
257  
258 $sustaticB->{_note} = 'sustaticB'.$sustaticB->{_note};
259 return ( $sustaticB->{_note} );
260  
261 }
262  
263  
264  
265 =head2 sub clear
266  
267 =cut
268  
269 sub clear {
270  
271 $sustaticB->{_elevation} = '';
272 $sustaticB->{_hdrs} = '';
273 $sustaticB->{_no} = '';
274 $sustaticB->{_nr} = '';
275 $sustaticB->{_ns} = '';
276 $sustaticB->{_rec_file} = '';
277 $sustaticB->{_sign} = '';
278 $sustaticB->{_sou_file} = '';
279 $sustaticB->{_v0} = '';
280 $sustaticB->{_v1} = '';
281 $sustaticB->{_Step} = '';
282 $sustaticB->{_note} = '';
283 }
284  
285  
286 =head2 sub elevation
287  
288  
289 =cut
290  
291 sub elevation {
292  
293 my ( $self,$elevation ) = @_;
294 if ( $elevation ne $empty_string ) {
295  
296 $sustaticB->{_elevation} = $elevation;
297 $sustaticB->{_note} = $sustaticB->{_note}.' elevation='.$sustaticB->{_elevation};
298 $sustaticB->{_Step} = $sustaticB->{_Step}.' elevation='.$sustaticB->{_elevation};
299  
300 } else {
301 print("sustaticB, elevation, missing elevation,\n");
302 }
303 }
304  
305  
306 =head2 sub hdrs
307  
308  
309 =cut
310  
311 sub hdrs {
312  
313 my ( $self,$hdrs ) = @_;
314 if ( $hdrs ne $empty_string ) {
315  
316 $sustaticB->{_hdrs} = $hdrs;
317 $sustaticB->{_note} = $sustaticB->{_note}.' hdrs='.$sustaticB->{_hdrs};
318 $sustaticB->{_Step} = $sustaticB->{_Step}.' hdrs='.$sustaticB->{_hdrs};
319  
320 } else {
321 print("sustaticB, hdrs, missing hdrs,\n");
322 }
323 }
324  
325  
326 =head2 sub no
327  
328  
329 =cut
330  
331 sub no {
332  
333 my ( $self,$no ) = @_;
334 if ( $no ne $empty_string ) {
335  
336 $sustaticB->{_no} = $no;
337 $sustaticB->{_note} = $sustaticB->{_note}.' no='.$sustaticB->{_no};
338 $sustaticB->{_Step} = $sustaticB->{_Step}.' no='.$sustaticB->{_no};
339  
340 } else {
341 print("sustaticB, no, missing no,\n");
342 }
343 }
344  
345  
346 =head2 sub nr
347  
348  
349 =cut
350  
351 sub nr {
352  
353 my ( $self,$nr ) = @_;
354 if ( $nr ne $empty_string ) {
355  
356 $sustaticB->{_nr} = $nr;
357 $sustaticB->{_note} = $sustaticB->{_note}.' nr='.$sustaticB->{_nr};
358 $sustaticB->{_Step} = $sustaticB->{_Step}.' nr='.$sustaticB->{_nr};
359  
360 } else {
361 print("sustaticB, nr, missing nr,\n");
362 }
363 }
364  
365  
366 =head2 sub ns
367  
368  
369 =cut
370  
371 sub ns {
372  
373 my ( $self,$ns ) = @_;
374 if ( $ns ne $empty_string ) {
375  
376 $sustaticB->{_ns} = $ns;
377 $sustaticB->{_note} = $sustaticB->{_note}.' ns='.$sustaticB->{_ns};
378 $sustaticB->{_Step} = $sustaticB->{_Step}.' ns='.$sustaticB->{_ns};
379  
380 } else {
381 print("sustaticB, ns, missing ns,\n");
382 }
383 }
384  
385  
386 =head2 sub rec_file
387  
388  
389 =cut
390  
391 sub rec_file {
392  
393 my ( $self,$rec_file ) = @_;
394 if ( $rec_file ne $empty_string ) {
395  
396 $sustaticB->{_rec_file} = $rec_file;
397 $sustaticB->{_note} = $sustaticB->{_note}.' rec_file='.$sustaticB->{_rec_file};
398 $sustaticB->{_Step} = $sustaticB->{_Step}.' rec_file='.$sustaticB->{_rec_file};
399  
400 } else {
401 print("sustaticB, rec_file, missing rec_file,\n");
402 }
403 }
404  
405  
406 =head2 sub sign
407  
408  
409 =cut
410  
411 sub sign {
412  
413 my ( $self,$sign ) = @_;
414 if ( $sign ne $empty_string ) {
415  
416 $sustaticB->{_sign} = $sign;
417 $sustaticB->{_note} = $sustaticB->{_note}.' sign='.$sustaticB->{_sign};
418 $sustaticB->{_Step} = $sustaticB->{_Step}.' sign='.$sustaticB->{_sign};
419  
420 } else {
421 print("sustaticB, sign, missing sign,\n");
422 }
423 }
424  
425  
426 =head2 sub sou_file
427  
428  
429 =cut
430  
431 sub sou_file {
432  
433 my ( $self,$sou_file ) = @_;
434 if ( $sou_file ne $empty_string ) {
435  
436 $sustaticB->{_sou_file} = $sou_file;
437 $sustaticB->{_note} = $sustaticB->{_note}.' sou_file='.$sustaticB->{_sou_file};
438 $sustaticB->{_Step} = $sustaticB->{_Step}.' sou_file='.$sustaticB->{_sou_file};
439  
440 } else {
441 print("sustaticB, sou_file, missing sou_file,\n");
442 }
443 }
444  
445  
446 =head2 sub v0
447  
448  
449 =cut
450  
451 sub v0 {
452  
453 my ( $self,$v0 ) = @_;
454 if ( $v0 ne $empty_string ) {
455  
456 $sustaticB->{_v0} = $v0;
457 $sustaticB->{_note} = $sustaticB->{_note}.' v0='.$sustaticB->{_v0};
458 $sustaticB->{_Step} = $sustaticB->{_Step}.' v0='.$sustaticB->{_v0};
459  
460 } else {
461 print("sustaticB, v0, missing v0,\n");
462 }
463 }
464  
465  
466 =head2 sub v1
467  
468  
469 =cut
470  
471 sub v1 {
472  
473 my ( $self,$v1 ) = @_;
474 if ( $v1 ne $empty_string ) {
475  
476 $sustaticB->{_v1} = $v1;
477 $sustaticB->{_note} = $sustaticB->{_note}.' v1='.$sustaticB->{_v1};
478 $sustaticB->{_Step} = $sustaticB->{_Step}.' v1='.$sustaticB->{_v1};
479  
480 } else {
481 print("sustaticB, v1, missing v1,\n");
482 }
483 }
484  
485  
486 =head2 sub get_max_index
487  
488 max index = number of input variables -1
489
490 =cut
491
492 sub get_max_index {
493 my ($self) = @_;
494 my $max_index = 9;
495  
496 return($max_index);
497 }
498
499
500 1;