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

filter: Statementstmt 0.0% 0 / 91 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 16 Podpod 0.0% 0 / 12 totaltotal 0.0% 0 / 135 CC 9 SCAR 15.4
CC
9
Cov
0%
cdpmin
6.0
fmax
6.0
smute
6.0
CRAP 4.7
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sudmovz;
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 SUDMOVZ - DMO for V(Z) media for common-offset gathers
25  
26  
27  
28 sudmovz <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 vfile= binary (non-ascii) file containing interval velocities (m/s)
47  
48 tdmo=0.0 times corresponding to interval velocities in vdmo (s)
49  
50 vdmo=1500.0 interval velocities corresponding to times in tdmo (m/s)
51  
52 fmax=0.5/dt maximum frequency in input traces (Hz)
53  
54 smute=1.5 stretch mute used for NMO correction
55  
56 speed=1.0 twist this knob for speed (and aliasing)
57  
58 verbose=0 =1 for diagnostic print
59  
60  
61  
62 Notes:
63  
64 Input traces should be sorted into common-offset gathers. One common-
65  
66 offset gather ends and another begins when the offset field of the trace
67  
68 headers changes.
69  
70  
71  
72 The cdp field of the input trace headers must be the cdp bin NUMBER, NOT
73  
74 the cdp location expressed in units of meters or feet.
75  
76  
77  
78 The number of offsets to mix (noffmix) should typically equal the ratio of
79  
80 the shotpoint spacing to the cdp spacing. This choice ensures that every
81  
82 cdp will be represented in each offset mix. Traces in each mix will
83  
84 contribute through DMO to other traces in adjacent cdps within that mix.
85  
86  
87  
88 vfile should contain the regularly sampled interval velocities as a
89  
90 function of time. If vfile is not supplied, the interval velocity
91  
92 function is defined by linear interpolation of the values in the tdmo
93  
94 and vdmo arrays. The times in tdmo must be monotonically increasing.
95  
96  
97  
98 For each offset, the minimum time to process is determined using the
99  
100 smute parameter. The DMO correction is not computed for samples that
101  
102 have experienced greater stretch during NMO.
103  
104  
105  
106 Trace header fields accessed: nt, dt, delrt, offset, cdp.
107  
108 =head2 User's notes (Juan Lorenzo)
109 untested
110  
111 =cut
112  
113  
114 =head2 CHANGES and their DATES
115  
116 =cut
117  
118 use Moose;
119 our $VERSION = '0.0.1';
120  
121  
122 =head2 Import packages
123  
124 =cut
125  
126 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
127  
128 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
129 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
130  
131  
132 =head2 instantiation of packages
133  
134 =cut
135  
136 my $get = L_SU_global_constants->new();
137 my $Project = Project_config->new();
138 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
139 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
140 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
141  
142 my $PS_SEISMIC = $Project->PS_SEISMIC();
143  
144 my $var = $get->var();
145 my $on = $var->{_on};
146 my $off = $var->{_off};
147 my $true = $var->{_true};
148 my $false = $var->{_false};
149 my $empty_string = $var->{_empty_string};
150  
151 =head2 Encapsulated
152 hash of private variables
153  
154 =cut
155  
156 my $sudmovz = {
157 _cdpmin => '',
158 _fmax => '',
159 _smute => '',
160 _speed => '',
161 _tdmo => '',
162 _vdmo => '',
163 _verbose => '',
164 _vfile => '',
165 _Step => '',
166 _note => '',
167  
168 };
169  
170 =head2 sub Step
171  
172 collects switches and assembles bash instructions
173 by adding the program name
174  
175 =cut
176  
177 sub Step {
178  
179 $sudmovz->{_Step} = 'sudmovz'.$sudmovz->{_Step};
180 return ( $sudmovz->{_Step} );
181  
182 }
183  
184  
185 =head2 sub note
186  
187 collects switches and assembles bash instructions
188 by adding the program name
189  
190 =cut
191  
192 sub note {
193  
194 $sudmovz->{_note} = 'sudmovz'.$sudmovz->{_note};
195 return ( $sudmovz->{_note} );
196  
197 }
198  
199  
200  
201 =head2 sub clear
202  
203 =cut
204  
205 sub clear {
206  
207 $sudmovz->{_cdpmin} = '';
208 $sudmovz->{_fmax} = '';
209 $sudmovz->{_smute} = '';
210 $sudmovz->{_speed} = '';
211 $sudmovz->{_tdmo} = '';
212 $sudmovz->{_vdmo} = '';
213 $sudmovz->{_verbose} = '';
214 $sudmovz->{_vfile} = '';
215 $sudmovz->{_Step} = '';
216 $sudmovz->{_note} = '';
217 }
218  
219  
220 =head2 sub cdpmin
221  
222  
223 =cut
224  
225 sub cdpmin {
226  
227 my ( $self,$cdpmin ) = @_;
228 if ( $cdpmin ne $empty_string ) {
229  
230 $sudmovz->{_cdpmin} = $cdpmin;
231 $sudmovz->{_note} = $sudmovz->{_note}.' cdpmin='.$sudmovz->{_cdpmin};
232 $sudmovz->{_Step} = $sudmovz->{_Step}.' cdpmin='.$sudmovz->{_cdpmin};
233  
234 } else {
235 print("sudmovz, cdpmin, missing cdpmin,\n");
236 }
237 }
238  
239  
240 =head2 sub fmax
241  
242  
243 =cut
244  
245 sub fmax {
246  
247 my ( $self,$fmax ) = @_;
248 if ( $fmax ne $empty_string ) {
249  
250 $sudmovz->{_fmax} = $fmax;
251 $sudmovz->{_note} = $sudmovz->{_note}.' fmax='.$sudmovz->{_fmax};
252 $sudmovz->{_Step} = $sudmovz->{_Step}.' fmax='.$sudmovz->{_fmax};
253  
254 } else {
255 print("sudmovz, fmax, missing fmax,\n");
256 }
257 }
258  
259  
260 =head2 sub smute
261  
262  
263 =cut
264  
265 sub smute {
266  
267 my ( $self,$smute ) = @_;
268 if ( $smute ne $empty_string ) {
269  
270 $sudmovz->{_smute} = $smute;
271 $sudmovz->{_note} = $sudmovz->{_note}.' smute='.$sudmovz->{_smute};
272 $sudmovz->{_Step} = $sudmovz->{_Step}.' smute='.$sudmovz->{_smute};
273  
274 } else {
275 print("sudmovz, smute, missing smute,\n");
276 }
277 }
278  
279  
280 =head2 sub speed
281  
282  
283 =cut
284  
285 sub speed {
286  
287 my ( $self,$speed ) = @_;
288 if ( $speed ne $empty_string ) {
289  
290 $sudmovz->{_speed} = $speed;
291 $sudmovz->{_note} = $sudmovz->{_note}.' speed='.$sudmovz->{_speed};
292 $sudmovz->{_Step} = $sudmovz->{_Step}.' speed='.$sudmovz->{_speed};
293  
294 } else {
295 print("sudmovz, speed, missing speed,\n");
296 }
297 }
298  
299  
300 =head2 sub tdmo
301  
302  
303 =cut
304  
305 sub tdmo {
306  
307 my ( $self,$tdmo ) = @_;
308 if ( $tdmo ne $empty_string ) {
309  
310 $sudmovz->{_tdmo} = $tdmo;
311 $sudmovz->{_note} = $sudmovz->{_note}.' tdmo='.$sudmovz->{_tdmo};
312 $sudmovz->{_Step} = $sudmovz->{_Step}.' tdmo='.$sudmovz->{_tdmo};
313  
314 } else {
315 print("sudmovz, tdmo, missing tdmo,\n");
316 }
317 }
318  
319  
320 =head2 sub vdmo
321  
322  
323 =cut
324  
325 sub vdmo {
326  
327 my ( $self,$vdmo ) = @_;
328 if ( $vdmo ne $empty_string ) {
329  
330 $sudmovz->{_vdmo} = $vdmo;
331 $sudmovz->{_note} = $sudmovz->{_note}.' vdmo='.$sudmovz->{_vdmo};
332 $sudmovz->{_Step} = $sudmovz->{_Step}.' vdmo='.$sudmovz->{_vdmo};
333  
334 } else {
335 print("sudmovz, vdmo, missing vdmo,\n");
336 }
337 }
338  
339  
340 =head2 sub verbose
341  
342  
343 =cut
344  
345 sub verbose {
346  
347 my ( $self,$verbose ) = @_;
348 if ( $verbose ne $empty_string ) {
349  
350 $sudmovz->{_verbose} = $verbose;
351 $sudmovz->{_note} = $sudmovz->{_note}.' verbose='.$sudmovz->{_verbose};
352 $sudmovz->{_Step} = $sudmovz->{_Step}.' verbose='.$sudmovz->{_verbose};
353  
354 } else {
355 print("sudmovz, verbose, missing verbose,\n");
356 }
357 }
358  
359  
360 =head2 sub vfile
361  
362  
363 =cut
364  
365 sub vfile {
366  
367 my ( $self,$vfile ) = @_;
368 if ( $vfile ne $empty_string ) {
369  
370 $sudmovz->{_vfile} = $vfile;
371 $sudmovz->{_note} = $sudmovz->{_note}.' vfile='.$sudmovz->{_vfile};
372 $sudmovz->{_Step} = $sudmovz->{_Step}.' vfile='.$sudmovz->{_vfile};
373  
374 } else {
375 print("sudmovz, vfile, missing vfile,\n");
376 }
377 }
378  
379  
380 =head2 sub get_max_index
381  
382 max index = number of input variables -1
383
384 =cut
385
386 sub get_max_index {
387 my ($self) = @_;
388 my $max_index = 7;
389  
390 return($max_index);
391 }
392
393
394 1;