lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/sudmofk.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%
cdpmax
6.0
cdpmin
6.0
dxcdp
6.0
CRAP 4.9
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sudmofk;
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 SUDMOFK - DMO via F-K domain (log-stretch) method for common-offset gathers
25  
26  
27  
28 sudmofk <stdin >stdout cdpmin= cdpmax= dxcdp= noffmix= [...]
29  
30  
31  
32 Required Parameters:
33  
34 cdpmin= minimum cdp (integer number) for which to apply DMO
35  
36 cdpmax= maximum cdp (integer number) for which to apply DMO
37  
38 dxcdp= distance between adjacent cdp bins (m)
39  
40 noffmix= number of offsets to mix (see notes)
41  
42  
43  
44 Optional Parameters:
45  
46 tdmo=0.0 times corresponding to rms velocities in vdmo (s)
47  
48 vdmo=1500.0 rms velocities corresponding to times in tdmo (m/s)
49  
50 sdmo=1.0 DMO stretch factor; try 0.6 for typical v(z)
51  
52 fmax=0.5/dt maximum frequency in input traces (Hz)
53  
54 verbose=0 =1 for diagnostic print
55  
56 tmpdir= if non-empty, use the value as a directory path prefix
57  
58 for storing temporary files; else if the CWP_TMPDIR
59  
60 environment variable is set use its value for the path;
61  
62 else use tmpfile()
63  
64  
65  
66 Notes:
67  
68 Input traces should be sorted into common-offset gathers. One common-
69  
70 offset gather ends and another begins when the offset field of the trace
71  
72 headers changes.
73  
74  
75  
76 The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
77  
78 the cdp location expressed in units of meters or feet.
79  
80  
81  
82 The number of offsets to mix (noffmix) should typically no smaller than
83  
84 the ratio of the shotpoint spacing to the cdp spacing. This choice
85  
86 ensures that every cdp will be represented in each offset mix. Traces
87  
88 in each mix will contribute through DMO to other traces in adjacent cdps
89  
90 within that mix. (Values of noffmix 2 or 3 times the ratio of shotpoint
91  
92 spacing to the cdp spacing often yield better results.)
93  
94  
95  
96 The tdmo and vdmo arrays specify a velocity function of time that is
97  
98 used to implement a first-order correction for depth-variable velocity.
99  
100 The times in tdmo must be monotonically increasing.
101  
102  
103  
104 For each offset, the minimum time at which a non-zero sample exists is
105  
106 used to determine a mute time. Output samples for times earlier than this",
107  
108 mute time will be zeroed. Computation time may be significantly reduced
109  
110 if the input traces are zeroed (muted) for early times at large offsets.
111  
112  
113  
114 Credits:
115  
116 CWP: Dave
117  
118  
119  
120 Technical Reference:
121  
122 Dip-Moveout Processing - SEG Course Notes
123  
124 Dave Hale, 1988
125  
126  
127  
128 Trace header fields accessed: ns, dt, delrt, offset, cdp.
129  
130  
131  
132 =head2 User's notes (Juan Lorenzo)
133 untested
134  
135 =cut
136  
137  
138 =head2 CHANGES and their DATES
139  
140 =cut
141  
142 use Moose;
143 our $VERSION = '0.0.1';
144  
145  
146 =head2 Import packages
147  
148 =cut
149  
150 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
151  
152 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
153 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
154  
155  
156 =head2 instantiation of packages
157  
158 =cut
159  
160 my $get = L_SU_global_constants->new();
161 my $Project = Project_config->new();
162 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
163 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
164 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
165  
166 my $PS_SEISMIC = $Project->PS_SEISMIC();
167  
168 my $var = $get->var();
169 my $on = $var->{_on};
170 my $off = $var->{_off};
171 my $true = $var->{_true};
172 my $false = $var->{_false};
173 my $empty_string = $var->{_empty_string};
174  
175 =head2 Encapsulated
176 hash of private variables
177  
178 =cut
179  
180 my $sudmofk = {
181 _cdpmax => '',
182 _cdpmin => '',
183 _dxcdp => '',
184 _fmax => '',
185 _noffmix => '',
186 _sdmo => '',
187 _tdmo => '',
188 _tmpdir => '',
189 _vdmo => '',
190 _verbose => '',
191 _Step => '',
192 _note => '',
193  
194 };
195  
196 =head2 sub Step
197  
198 collects switches and assembles bash instructions
199 by adding the program name
200  
201 =cut
202  
203 sub Step {
204  
205 $sudmofk->{_Step} = 'sudmofk'.$sudmofk->{_Step};
206 return ( $sudmofk->{_Step} );
207  
208 }
209  
210  
211 =head2 sub note
212  
213 collects switches and assembles bash instructions
214 by adding the program name
215  
216 =cut
217  
218 sub note {
219  
220 $sudmofk->{_note} = 'sudmofk'.$sudmofk->{_note};
221 return ( $sudmofk->{_note} );
222  
223 }
224  
225  
226  
227 =head2 sub clear
228  
229 =cut
230  
231 sub clear {
232  
233 $sudmofk->{_cdpmax} = '';
234 $sudmofk->{_cdpmin} = '';
235 $sudmofk->{_dxcdp} = '';
236 $sudmofk->{_fmax} = '';
237 $sudmofk->{_noffmix} = '';
238 $sudmofk->{_sdmo} = '';
239 $sudmofk->{_tdmo} = '';
240 $sudmofk->{_tmpdir} = '';
241 $sudmofk->{_vdmo} = '';
242 $sudmofk->{_verbose} = '';
243 $sudmofk->{_Step} = '';
244 $sudmofk->{_note} = '';
245 }
246  
247  
248 =head2 sub cdpmax
249  
250  
251 =cut
252  
253 sub cdpmax {
254  
255 my ( $self,$cdpmax ) = @_;
256 if ( $cdpmax ne $empty_string ) {
257  
258 $sudmofk->{_cdpmax} = $cdpmax;
259 $sudmofk->{_note} = $sudmofk->{_note}.' cdpmax='.$sudmofk->{_cdpmax};
260 $sudmofk->{_Step} = $sudmofk->{_Step}.' cdpmax='.$sudmofk->{_cdpmax};
261  
262 } else {
263 print("sudmofk, cdpmax, missing cdpmax,\n");
264 }
265 }
266  
267  
268 =head2 sub cdpmin
269  
270  
271 =cut
272  
273 sub cdpmin {
274  
275 my ( $self,$cdpmin ) = @_;
276 if ( $cdpmin ne $empty_string ) {
277  
278 $sudmofk->{_cdpmin} = $cdpmin;
279 $sudmofk->{_note} = $sudmofk->{_note}.' cdpmin='.$sudmofk->{_cdpmin};
280 $sudmofk->{_Step} = $sudmofk->{_Step}.' cdpmin='.$sudmofk->{_cdpmin};
281  
282 } else {
283 print("sudmofk, cdpmin, missing cdpmin,\n");
284 }
285 }
286  
287  
288 =head2 sub dxcdp
289  
290  
291 =cut
292  
293 sub dxcdp {
294  
295 my ( $self,$dxcdp ) = @_;
296 if ( $dxcdp ne $empty_string ) {
297  
298 $sudmofk->{_dxcdp} = $dxcdp;
299 $sudmofk->{_note} = $sudmofk->{_note}.' dxcdp='.$sudmofk->{_dxcdp};
300 $sudmofk->{_Step} = $sudmofk->{_Step}.' dxcdp='.$sudmofk->{_dxcdp};
301  
302 } else {
303 print("sudmofk, dxcdp, missing dxcdp,\n");
304 }
305 }
306  
307  
308 =head2 sub fmax
309  
310  
311 =cut
312  
313 sub fmax {
314  
315 my ( $self,$fmax ) = @_;
316 if ( $fmax ne $empty_string ) {
317  
318 $sudmofk->{_fmax} = $fmax;
319 $sudmofk->{_note} = $sudmofk->{_note}.' fmax='.$sudmofk->{_fmax};
320 $sudmofk->{_Step} = $sudmofk->{_Step}.' fmax='.$sudmofk->{_fmax};
321  
322 } else {
323 print("sudmofk, fmax, missing fmax,\n");
324 }
325 }
326  
327  
328 =head2 sub noffmix
329  
330  
331 =cut
332  
333 sub noffmix {
334  
335 my ( $self,$noffmix ) = @_;
336 if ( $noffmix ne $empty_string ) {
337  
338 $sudmofk->{_noffmix} = $noffmix;
339 $sudmofk->{_note} = $sudmofk->{_note}.' noffmix='.$sudmofk->{_noffmix};
340 $sudmofk->{_Step} = $sudmofk->{_Step}.' noffmix='.$sudmofk->{_noffmix};
341  
342 } else {
343 print("sudmofk, noffmix, missing noffmix,\n");
344 }
345 }
346  
347  
348 =head2 sub sdmo
349  
350  
351 =cut
352  
353 sub sdmo {
354  
355 my ( $self,$sdmo ) = @_;
356 if ( $sdmo ne $empty_string ) {
357  
358 $sudmofk->{_sdmo} = $sdmo;
359 $sudmofk->{_note} = $sudmofk->{_note}.' sdmo='.$sudmofk->{_sdmo};
360 $sudmofk->{_Step} = $sudmofk->{_Step}.' sdmo='.$sudmofk->{_sdmo};
361  
362 } else {
363 print("sudmofk, sdmo, missing sdmo,\n");
364 }
365 }
366  
367  
368 =head2 sub tdmo
369  
370  
371 =cut
372  
373 sub tdmo {
374  
375 my ( $self,$tdmo ) = @_;
376 if ( $tdmo ne $empty_string ) {
377  
378 $sudmofk->{_tdmo} = $tdmo;
379 $sudmofk->{_note} = $sudmofk->{_note}.' tdmo='.$sudmofk->{_tdmo};
380 $sudmofk->{_Step} = $sudmofk->{_Step}.' tdmo='.$sudmofk->{_tdmo};
381  
382 } else {
383 print("sudmofk, tdmo, missing tdmo,\n");
384 }
385 }
386  
387  
388 =head2 sub tmpdir
389  
390  
391 =cut
392  
393 sub tmpdir {
394  
395 my ( $self,$tmpdir ) = @_;
396 if ( $tmpdir ne $empty_string ) {
397  
398 $sudmofk->{_tmpdir} = $tmpdir;
399 $sudmofk->{_note} = $sudmofk->{_note}.' tmpdir='.$sudmofk->{_tmpdir};
400 $sudmofk->{_Step} = $sudmofk->{_Step}.' tmpdir='.$sudmofk->{_tmpdir};
401  
402 } else {
403 print("sudmofk, tmpdir, missing tmpdir,\n");
404 }
405 }
406  
407  
408 =head2 sub vdmo
409  
410  
411 =cut
412  
413 sub vdmo {
414  
415 my ( $self,$vdmo ) = @_;
416 if ( $vdmo ne $empty_string ) {
417  
418 $sudmofk->{_vdmo} = $vdmo;
419 $sudmofk->{_note} = $sudmofk->{_note}.' vdmo='.$sudmofk->{_vdmo};
420 $sudmofk->{_Step} = $sudmofk->{_Step}.' vdmo='.$sudmofk->{_vdmo};
421  
422 } else {
423 print("sudmofk, vdmo, missing vdmo,\n");
424 }
425 }
426  
427  
428 =head2 sub verbose
429  
430  
431 =cut
432  
433 sub verbose {
434  
435 my ( $self,$verbose ) = @_;
436 if ( $verbose ne $empty_string ) {
437  
438 $sudmofk->{_verbose} = $verbose;
439 $sudmofk->{_note} = $sudmofk->{_note}.' verbose='.$sudmofk->{_verbose};
440 $sudmofk->{_Step} = $sudmofk->{_Step}.' verbose='.$sudmofk->{_verbose};
441  
442 } else {
443 print("sudmofk, verbose, missing verbose,\n");
444 }
445 }
446  
447  
448 =head2 sub get_max_index
449  
450 max index = number of input variables -1
451
452 =cut
453
454 sub get_max_index {
455 my ($self) = @_;
456 my $max_index = 9;
457  
458 return($max_index);
459 }
460
461
462 1;