lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/suvelan_nccs.pm untested

filter: Statementstmt 0.0% 0 / 98 Branchbran 0.0% 0 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 17 Podpod 0.0% 0 / 13 totaltotal 0.0% 0 / 146 CC 10 SCAR 15.6
CC
10
Cov
0%
dtratio
6.0
dv
6.0
fv
6.0
CRAP 4.8
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::suvelan_nccs;
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 SUVELAN_NCCS - compute stacking VELocity panel for cdp gathers
25  
26 using Normalized CrossCorrelation Sum
27  
28  
29  
30 suvelan_uccs <stdin >stdout [optional parameters]
31  
32  
33  
34 Optional Parameters:
35  
36 nx=tr.cdpt number of traces in cdp
37  
38 nv=50 number of velocities
39  
40 dv=50.0 velocity sampling interval
41  
42 fv=1500.0 first velocity
43  
44 smute=1.5 samples with NMO stretch exceeding smute are zeroed
45  
46 dtratio=5 ratio of output to input time sampling intervals
47  
48 nsmooth=dtratio*2+1 length of smoothing window
49  
50 verbose=0 =1 for diagnostic print on stderr
51  
52 pwr=1.0 semblance value to the power
53  
54  
55  
56 Notes:
57  
58 Normalized CrossCorrelation sum: sum all possible crosscorrelation
59  
60 trace pairs in a CMP gather for each trial velocity and zero-offset
61  
62 two-way travel time inside a time window. This coherence measure is
63  
64 normalized by dividing each crosscorrelation trace pair by the geometric
65  
66 mean of the energy, inside the chosen time window, of each trace pair
67  
68 involved in each crosscorrelation. Then, to achieve a maximum amplitude
69  
70 of unity, the result is multiplied by 2/(M(M-1)), which is the inverse
71  
72 of the total number of crosscorrelation. The normalization allows to
73  
74 bring out weak reflection as long as these reflections have moveouts close
75  
76 to a hyperbola.
77  
78  
79  
80  
81  
82
83  
84 Credits:
85  
86  
87  
88 CWP: Valmore Celis, Sept 2002
89  
90  
91  
92 Based on the original code: suvelan.c
93  
94 Colorado School of Mines: Dave Hale, c. 1989
95  
96  
97  
98 Trace header fields accessed: ns, dt, delrt, offset, cdp, cdpt
99  
100 Trace header fields modified: ns, dt, offset, cdp
101  
102  
103  
104 Reference: Neidell, N.S., and Taner, M.T., 1971, Semblance and
105  
106 other coherency measures for multichannel data:
107  
108 Geophysics, 36, 498-509.
109  
110  
111  
112  
113  
114 =head2 User's notes (Juan Lorenzo)
115 untested
116  
117 =cut
118  
119  
120 =head2 CHANGES and their DATES
121  
122 =cut
123  
124 use Moose;
125 our $VERSION = '0.0.1';
126  
127  
128 =head2 Import packages
129  
130 =cut
131  
132 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
133  
134 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
135 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
136  
137  
138 =head2 instantiation of packages
139  
140 =cut
141  
142 my $get = L_SU_global_constants->new();
143 my $Project = Project_config->new();
144 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
145 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
146 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
147  
148 my $PS_SEISMIC = $Project->PS_SEISMIC();
149  
150 my $var = $get->var();
151 my $on = $var->{_on};
152 my $off = $var->{_off};
153 my $true = $var->{_true};
154 my $false = $var->{_false};
155 my $empty_string = $var->{_empty_string};
156  
157 =head2 Encapsulated
158 hash of private variables
159  
160 =cut
161  
162 my $suvelan_nccs = {
163 _dtratio => '',
164 _dv => '',
165 _fv => '',
166 _nsmooth => '',
167 _nv => '',
168 _nx => '',
169 _pwr => '',
170 _smute => '',
171 _verbose => '',
172 _Step => '',
173 _note => '',
174  
175 };
176  
177 =head2 sub Step
178  
179 collects switches and assembles bash instructions
180 by adding the program name
181  
182 =cut
183  
184 sub Step {
185  
186 $suvelan_nccs->{_Step} = 'suvelan_nccs'.$suvelan_nccs->{_Step};
187 return ( $suvelan_nccs->{_Step} );
188  
189 }
190  
191  
192 =head2 sub note
193  
194 collects switches and assembles bash instructions
195 by adding the program name
196  
197 =cut
198  
199 sub note {
200  
201 $suvelan_nccs->{_note} = 'suvelan_nccs'.$suvelan_nccs->{_note};
202 return ( $suvelan_nccs->{_note} );
203  
204 }
205  
206  
207  
208 =head2 sub clear
209  
210 =cut
211  
212 sub clear {
213  
214 $suvelan_nccs->{_dtratio} = '';
215 $suvelan_nccs->{_dv} = '';
216 $suvelan_nccs->{_fv} = '';
217 $suvelan_nccs->{_nsmooth} = '';
218 $suvelan_nccs->{_nv} = '';
219 $suvelan_nccs->{_nx} = '';
220 $suvelan_nccs->{_pwr} = '';
221 $suvelan_nccs->{_smute} = '';
222 $suvelan_nccs->{_verbose} = '';
223 $suvelan_nccs->{_Step} = '';
224 $suvelan_nccs->{_note} = '';
225 }
226  
227  
228 =head2 sub dtratio
229  
230  
231 =cut
232  
233 sub dtratio {
234  
235 my ( $self,$dtratio ) = @_;
236 if ( $dtratio ne $empty_string ) {
237  
238 $suvelan_nccs->{_dtratio} = $dtratio;
239 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' dtratio='.$suvelan_nccs->{_dtratio};
240 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' dtratio='.$suvelan_nccs->{_dtratio};
241  
242 } else {
243 print("suvelan_nccs, dtratio, missing dtratio,\n");
244 }
245 }
246  
247  
248 =head2 sub dv
249  
250  
251 =cut
252  
253 sub dv {
254  
255 my ( $self,$dv ) = @_;
256 if ( $dv ne $empty_string ) {
257  
258 $suvelan_nccs->{_dv} = $dv;
259 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' dv='.$suvelan_nccs->{_dv};
260 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' dv='.$suvelan_nccs->{_dv};
261  
262 } else {
263 print("suvelan_nccs, dv, missing dv,\n");
264 }
265 }
266  
267  
268 =head2 sub fv
269  
270  
271 =cut
272  
273 sub fv {
274  
275 my ( $self,$fv ) = @_;
276 if ( $fv ne $empty_string ) {
277  
278 $suvelan_nccs->{_fv} = $fv;
279 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' fv='.$suvelan_nccs->{_fv};
280 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' fv='.$suvelan_nccs->{_fv};
281  
282 } else {
283 print("suvelan_nccs, fv, missing fv,\n");
284 }
285 }
286  
287  
288 =head2 sub nsmooth
289  
290  
291 =cut
292  
293 sub nsmooth {
294  
295 my ( $self,$nsmooth ) = @_;
296 if ( $nsmooth ne $empty_string ) {
297  
298 $suvelan_nccs->{_nsmooth} = $nsmooth;
299 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' nsmooth='.$suvelan_nccs->{_nsmooth};
300 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' nsmooth='.$suvelan_nccs->{_nsmooth};
301  
302 } else {
303 print("suvelan_nccs, nsmooth, missing nsmooth,\n");
304 }
305 }
306  
307  
308 =head2 sub nv
309  
310  
311 =cut
312  
313 sub nv {
314  
315 my ( $self,$nv ) = @_;
316 if ( $nv ne $empty_string ) {
317  
318 $suvelan_nccs->{_nv} = $nv;
319 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' nv='.$suvelan_nccs->{_nv};
320 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' nv='.$suvelan_nccs->{_nv};
321  
322 } else {
323 print("suvelan_nccs, nv, missing nv,\n");
324 }
325 }
326  
327  
328 =head2 sub nx
329  
330  
331 =cut
332  
333 sub nx {
334  
335 my ( $self,$nx ) = @_;
336 if ( $nx ne $empty_string ) {
337  
338 $suvelan_nccs->{_nx} = $nx;
339 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' nx='.$suvelan_nccs->{_nx};
340 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' nx='.$suvelan_nccs->{_nx};
341  
342 } else {
343 print("suvelan_nccs, nx, missing nx,\n");
344 }
345 }
346  
347  
348 =head2 sub pwr
349  
350  
351 =cut
352  
353 sub pwr {
354  
355 my ( $self,$pwr ) = @_;
356 if ( $pwr ne $empty_string ) {
357  
358 $suvelan_nccs->{_pwr} = $pwr;
359 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' pwr='.$suvelan_nccs->{_pwr};
360 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' pwr='.$suvelan_nccs->{_pwr};
361  
362 } else {
363 print("suvelan_nccs, pwr, missing pwr,\n");
364 }
365 }
366  
367  
368 =head2 sub smute
369  
370  
371 =cut
372  
373 sub smute {
374  
375 my ( $self,$smute ) = @_;
376 if ( $smute ne $empty_string ) {
377  
378 $suvelan_nccs->{_smute} = $smute;
379 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' smute='.$suvelan_nccs->{_smute};
380 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' smute='.$suvelan_nccs->{_smute};
381  
382 } else {
383 print("suvelan_nccs, smute, missing smute,\n");
384 }
385 }
386  
387  
388 =head2 sub verbose
389  
390  
391 =cut
392  
393 sub verbose {
394  
395 my ( $self,$verbose ) = @_;
396 if ( $verbose ne $empty_string ) {
397  
398 $suvelan_nccs->{_verbose} = $verbose;
399 $suvelan_nccs->{_note} = $suvelan_nccs->{_note}.' verbose='.$suvelan_nccs->{_verbose};
400 $suvelan_nccs->{_Step} = $suvelan_nccs->{_Step}.' verbose='.$suvelan_nccs->{_verbose};
401  
402 } else {
403 print("suvelan_nccs, verbose, missing verbose,\n");
404 }
405 }
406  
407  
408 =head2 sub get_max_index
409  
410 max index = number of input variables -1
411
412 =cut
413
414 sub get_max_index {
415 my ($self) = @_;
416 my $max_index = 8;
417  
418 return($max_index);
419 }
420
421
422 1;