lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/sutaupnmo.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%
cdp
6.0
dx
6.0
key
6.0
CRAP 4.9
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sutaupnmo;
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 SUTAUPNMO - NMO for an arbitrary velocity function of tau and CDP
25  
26  
27  
28 sutaupnmo <stdin >stdout [optional parameters]
29  
30  
31  
32 Optional Parameters:
33  
34 tnmo=0,... NMO times corresponding to velocities in vnmo
35  
36 vnmo=1500,... NMO velocities corresponding to times in tnmo
37  
38 cdp= CDPs for which vnmo & tnmo are specified (see Notes)
39  
40 smute=1.5 samples with NMO stretch exceeding smute are zeroed
41  
42 lmute=25 length (in samples) of linear ramp for stretch mute
43  
44 sscale=1 =1 to divide output samples by NMO stretch factor
45  
46  
47  
48 Notes:
49  
50  
51  
52 For constant-velocity NMO, specify only one vnmo=constant and omit tnmo.
53  
54  
55  
56 For NMO with a velocity function of tau only, specify the arrays
57  
58 vnmo=v1,v2,... tnmo=t1,t2,...
59  
60 where v1 is the velocity at tau t1, v2 is the velocity at tau t2, ...
61  
62 The taus specified in the tnmo array must be monotonically increasing.
63  
64 Linear interpolation and constant extrapolation of the specified velocities
65  
66 is used to compute the velocities at taus not specified.
67  
68  
69  
70 For NMO with a velocity function of tau and CDP, specify the array
71  
72 cdp=cdp1,cdp2,...
73  
74 and, for each CDP specified, specify the vnmo and tnmo arrays as described
75  
76 above. The first (vnmo,tnmo) pair corresponds to the first cdp, and so on.
77  
78 Linear interpolation and constant extrapolation of velocity^2 is used
79  
80 to compute velocities at CDPs not specified.
81  
82  
83  
84 Moveout is defined by
85  
86  
87  
88 tau^2 + tau^2.p^2.vel^2
89  
90  
91  
92 Note: In general, the user should set the cdp parameter. The default is
93  
94 to use tr.cdp from the first trace and assume only one cdp.
95  
96 Caveat:
97  
98 Taunmo should handle triplication
99  
100  
101  
102 NMO interpolation error is less than 1 0.000000or frequencies less than 600f
103  
104 the Nyquist frequency.
105  
106  
107  
108 Exact inverse NMO is not implemented, nor has anisotropy
109  
110 Example implementation:
111  
112 sutaup dx=25 option=2 pmin=0 pmax=0.0007025 < cmpgather.su |
113  
114 supef minlag=0.2 maxlag=0.8 |
115  
116 sutaupnmo tnmo=0.5,2,4 vnmo=1500,2000,3200 smute=1.5 |
117  
118 sumute key=tracr mode=1 ntaper=20 xmute=1,30,40,50,85,15
119  
120 tmute=7.8,7.8,4.5,3.5,2.0,0.35 |
121  
122 sustack key=cdp | ... [...]
123  
124  
125  
126  
127  
128 Credits:
129  
130 Durham, Richard Hobbs modified from SUNMO credited below
131  
132 SEP: Shuki Ronen, Chuck Sword
133  
134 CWP: Shuki Ronen, Jack K. Cohen , Dave Hale
135  
136  
137  
138 Technical Reference:
139  
140 van der Baan papers in geophysics (2002 & 2004)
141  
142  
143  
144 Trace header fields accessed: ns, dt, delrt, offset, cdp, sy
145  
146  
147  
148 =head2 User's notes (Juan Lorenzo)
149 untested
150  
151 =cut
152  
153  
154 =head2 CHANGES and their DATES
155  
156 =cut
157  
158 use Moose;
159 our $VERSION = '0.0.1';
160  
161  
162 =head2 Import packages
163  
164 =cut
165  
166 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
167  
168 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
169 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
170  
171  
172 =head2 instantiation of packages
173  
174 =cut
175  
176 my $get = L_SU_global_constants->new();
177 my $Project = Project_config->new();
178 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
179 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
180 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
181  
182 my $PS_SEISMIC = $Project->PS_SEISMIC();
183  
184 my $var = $get->var();
185 my $on = $var->{_on};
186 my $off = $var->{_off};
187 my $true = $var->{_true};
188 my $false = $var->{_false};
189 my $empty_string = $var->{_empty_string};
190  
191 =head2 Encapsulated
192 hash of private variables
193  
194 =cut
195  
196 my $sutaupnmo = {
197 _cdp => '',
198 _dx => '',
199 _key => '',
200 _lmute => '',
201 _minlag => '',
202 _smute => '',
203 _sscale => '',
204 _tmute => '',
205 _tnmo => '',
206 _vnmo => '',
207 _Step => '',
208 _note => '',
209  
210 };
211  
212 =head2 sub Step
213  
214 collects switches and assembles bash instructions
215 by adding the program name
216  
217 =cut
218  
219 sub Step {
220  
221 $sutaupnmo->{_Step} = 'sutaupnmo'.$sutaupnmo->{_Step};
222 return ( $sutaupnmo->{_Step} );
223  
224 }
225  
226  
227 =head2 sub note
228  
229 collects switches and assembles bash instructions
230 by adding the program name
231  
232 =cut
233  
234 sub note {
235  
236 $sutaupnmo->{_note} = 'sutaupnmo'.$sutaupnmo->{_note};
237 return ( $sutaupnmo->{_note} );
238  
239 }
240  
241  
242  
243 =head2 sub clear
244  
245 =cut
246  
247 sub clear {
248  
249 $sutaupnmo->{_cdp} = '';
250 $sutaupnmo->{_dx} = '';
251 $sutaupnmo->{_key} = '';
252 $sutaupnmo->{_lmute} = '';
253 $sutaupnmo->{_minlag} = '';
254 $sutaupnmo->{_smute} = '';
255 $sutaupnmo->{_sscale} = '';
256 $sutaupnmo->{_tmute} = '';
257 $sutaupnmo->{_tnmo} = '';
258 $sutaupnmo->{_vnmo} = '';
259 $sutaupnmo->{_Step} = '';
260 $sutaupnmo->{_note} = '';
261 }
262  
263  
264 =head2 sub cdp
265  
266  
267 =cut
268  
269 sub cdp {
270  
271 my ( $self,$cdp ) = @_;
272 if ( $cdp ne $empty_string ) {
273  
274 $sutaupnmo->{_cdp} = $cdp;
275 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' cdp='.$sutaupnmo->{_cdp};
276 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' cdp='.$sutaupnmo->{_cdp};
277  
278 } else {
279 print("sutaupnmo, cdp, missing cdp,\n");
280 }
281 }
282  
283  
284 =head2 sub dx
285  
286  
287 =cut
288  
289 sub dx {
290  
291 my ( $self,$dx ) = @_;
292 if ( $dx ne $empty_string ) {
293  
294 $sutaupnmo->{_dx} = $dx;
295 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' dx='.$sutaupnmo->{_dx};
296 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' dx='.$sutaupnmo->{_dx};
297  
298 } else {
299 print("sutaupnmo, dx, missing dx,\n");
300 }
301 }
302  
303  
304 =head2 sub key
305  
306  
307 =cut
308  
309 sub key {
310  
311 my ( $self,$key ) = @_;
312 if ( $key ne $empty_string ) {
313  
314 $sutaupnmo->{_key} = $key;
315 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' key='.$sutaupnmo->{_key};
316 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' key='.$sutaupnmo->{_key};
317  
318 } else {
319 print("sutaupnmo, key, missing key,\n");
320 }
321 }
322  
323  
324 =head2 sub lmute
325  
326  
327 =cut
328  
329 sub lmute {
330  
331 my ( $self,$lmute ) = @_;
332 if ( $lmute ne $empty_string ) {
333  
334 $sutaupnmo->{_lmute} = $lmute;
335 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' lmute='.$sutaupnmo->{_lmute};
336 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' lmute='.$sutaupnmo->{_lmute};
337  
338 } else {
339 print("sutaupnmo, lmute, missing lmute,\n");
340 }
341 }
342  
343  
344 =head2 sub minlag
345  
346  
347 =cut
348  
349 sub minlag {
350  
351 my ( $self,$minlag ) = @_;
352 if ( $minlag ne $empty_string ) {
353  
354 $sutaupnmo->{_minlag} = $minlag;
355 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' minlag='.$sutaupnmo->{_minlag};
356 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' minlag='.$sutaupnmo->{_minlag};
357  
358 } else {
359 print("sutaupnmo, minlag, missing minlag,\n");
360 }
361 }
362  
363  
364 =head2 sub smute
365  
366  
367 =cut
368  
369 sub smute {
370  
371 my ( $self,$smute ) = @_;
372 if ( $smute ne $empty_string ) {
373  
374 $sutaupnmo->{_smute} = $smute;
375 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' smute='.$sutaupnmo->{_smute};
376 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' smute='.$sutaupnmo->{_smute};
377  
378 } else {
379 print("sutaupnmo, smute, missing smute,\n");
380 }
381 }
382  
383  
384 =head2 sub sscale
385  
386  
387 =cut
388  
389 sub sscale {
390  
391 my ( $self,$sscale ) = @_;
392 if ( $sscale ne $empty_string ) {
393  
394 $sutaupnmo->{_sscale} = $sscale;
395 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' sscale='.$sutaupnmo->{_sscale};
396 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' sscale='.$sutaupnmo->{_sscale};
397  
398 } else {
399 print("sutaupnmo, sscale, missing sscale,\n");
400 }
401 }
402  
403  
404 =head2 sub tmute
405  
406  
407 =cut
408  
409 sub tmute {
410  
411 my ( $self,$tmute ) = @_;
412 if ( $tmute ne $empty_string ) {
413  
414 $sutaupnmo->{_tmute} = $tmute;
415 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' tmute='.$sutaupnmo->{_tmute};
416 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' tmute='.$sutaupnmo->{_tmute};
417  
418 } else {
419 print("sutaupnmo, tmute, missing tmute,\n");
420 }
421 }
422  
423  
424 =head2 sub tnmo
425  
426  
427 =cut
428  
429 sub tnmo {
430  
431 my ( $self,$tnmo ) = @_;
432 if ( $tnmo ne $empty_string ) {
433  
434 $sutaupnmo->{_tnmo} = $tnmo;
435 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' tnmo='.$sutaupnmo->{_tnmo};
436 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' tnmo='.$sutaupnmo->{_tnmo};
437  
438 } else {
439 print("sutaupnmo, tnmo, missing tnmo,\n");
440 }
441 }
442  
443  
444 =head2 sub vnmo
445  
446  
447 =cut
448  
449 sub vnmo {
450  
451 my ( $self,$vnmo ) = @_;
452 if ( $vnmo ne $empty_string ) {
453  
454 $sutaupnmo->{_vnmo} = $vnmo;
455 $sutaupnmo->{_note} = $sutaupnmo->{_note}.' vnmo='.$sutaupnmo->{_vnmo};
456 $sutaupnmo->{_Step} = $sutaupnmo->{_Step}.' vnmo='.$sutaupnmo->{_vnmo};
457  
458 } else {
459 print("sutaupnmo, vnmo, missing vnmo,\n");
460 }
461 }
462  
463  
464 =head2 sub get_max_index
465  
466 max index = number of input variables -1
467
468 =cut
469
470 sub get_max_index {
471 my ($self) = @_;
472 my $max_index = 9;
473  
474 return($max_index);
475 }
476
477
478 1;