lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/sutivel.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%
a
6.0
b
6.0
d
6.0
CRAP 4.9
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sutivel;
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 SUTIVEL - SU Transversely Isotropic velocity table builder
25  
26 computes vnmo or vphase as a function of Thomsen's parameters and
27  
28 theta and optionally interpolate to constant increments in slowness
29  
30  
31  
32 Optional Parameters:
33  
34 a=2500. alpha (vertical p velocity)
35  
36 b=1250. beta (vertical sv velocity)
37  
38 e=.20 epsilon (horiz p-wave anisotropy)
39  
40 d=.10 delta (strange parameter)
41  
42 maxangle=90.0 max angle in degrees
43  
44 nangle=9001 number of angles to compute
45  
46 verbose=0 set to 1 to see full listing
47  
48 np=8001 number of slowness values to output
49  
50 option=1 1=output vnmo(p) (result used for TI DMO)
51  
52 option=2:output vnmo(theta) in degrees
53  
54 option=3:output vnmo(theta) in radians
55  
56 option=4:output vphase(p)
57  
58 option=5:output vphase(theta) in degrees
59  
60 option=6:output vphase(theta) in radians
61  
62 option=7:output first derivative vphase(p)
63  
64 option=8:output first derivative vphase(theta) in degrees
65  
66 option=9:output first derivative vphase(theta) in radians
67  
68 option=10:output second derivative vphase(p)
69  
70 option=11:output second derivative vphase(theta) in degrees
71  
72 option=12:output second derivative vphase(theta) in radians
73  
74 option=13:( 1/vnmo(0)^2 -1/vnmo(theta)^2 )/p^2 test vs theta
75  
76 (result should be zero for all theta for d=e)
77  
78 option=14:return vnmo(p) for weak anisotropy
79  
80 normalize=0 =1 means scale vnmo by cosine and scale vphase by
81  
82 1/sqrt(1+2*e*sin(theta)*sin(theta)
83  
84 (only useful for vphase when d=e for constant
85  
86 result)
87  
88 =0 means output vnmo or vphase unnormalized
89  
90  
91  
92 Output on standard output is ascii text with:
93  
94 line 1: number of values
95  
96 line 2: abscissa increment (p or theta increment, always starts at zero)
97  
98 line 3-n: one value per line
99  
100  
101  
102  
103  
104  
105  
106 Author: (visitor to CSM form Mobil) John E. Anderson, Spring 1994
107  
108  
109  
110 =head2 User's notes (Juan Lorenzo)
111 untested
112  
113 =cut
114  
115  
116 =head2 CHANGES and their DATES
117  
118 =cut
119  
120 use Moose;
121 our $VERSION = '0.0.1';
122  
123  
124 =head2 Import packages
125  
126 =cut
127  
128 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
129  
130 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
131 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
132  
133  
134 =head2 instantiation of packages
135  
136 =cut
137  
138 my $get = L_SU_global_constants->new();
139 my $Project = Project_config->new();
140 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
141 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
142 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
143  
144 my $PS_SEISMIC = $Project->PS_SEISMIC();
145  
146 my $var = $get->var();
147 my $on = $var->{_on};
148 my $off = $var->{_off};
149 my $true = $var->{_true};
150 my $false = $var->{_false};
151 my $empty_string = $var->{_empty_string};
152  
153 =head2 Encapsulated
154 hash of private variables
155  
156 =cut
157  
158 my $sutivel = {
159 _a => '',
160 _b => '',
161 _d => '',
162 _e => '',
163 _maxangle => '',
164 _nangle => '',
165 _normalize => '',
166 _np => '',
167 _option => '',
168 _verbose => '',
169 _Step => '',
170 _note => '',
171  
172 };
173  
174 =head2 sub Step
175  
176 collects switches and assembles bash instructions
177 by adding the program name
178  
179 =cut
180  
181 sub Step {
182  
183 $sutivel->{_Step} = 'sutivel'.$sutivel->{_Step};
184 return ( $sutivel->{_Step} );
185  
186 }
187  
188  
189 =head2 sub note
190  
191 collects switches and assembles bash instructions
192 by adding the program name
193  
194 =cut
195  
196 sub note {
197  
198 $sutivel->{_note} = 'sutivel'.$sutivel->{_note};
199 return ( $sutivel->{_note} );
200  
201 }
202  
203  
204  
205 =head2 sub clear
206  
207 =cut
208  
209 sub clear {
210  
211 $sutivel->{_a} = '';
212 $sutivel->{_b} = '';
213 $sutivel->{_d} = '';
214 $sutivel->{_e} = '';
215 $sutivel->{_maxangle} = '';
216 $sutivel->{_nangle} = '';
217 $sutivel->{_normalize} = '';
218 $sutivel->{_np} = '';
219 $sutivel->{_option} = '';
220 $sutivel->{_verbose} = '';
221 $sutivel->{_Step} = '';
222 $sutivel->{_note} = '';
223 }
224  
225  
226 =head2 sub a
227  
228  
229 =cut
230  
231 sub a {
232  
233 my ( $self,$a ) = @_;
234 if ( $a ne $empty_string ) {
235  
236 $sutivel->{_a} = $a;
237 $sutivel->{_note} = $sutivel->{_note}.' a='.$sutivel->{_a};
238 $sutivel->{_Step} = $sutivel->{_Step}.' a='.$sutivel->{_a};
239  
240 } else {
241 print("sutivel, a, missing a,\n");
242 }
243 }
244  
245  
246 =head2 sub b
247  
248  
249 =cut
250  
251 sub b {
252  
253 my ( $self,$b ) = @_;
254 if ( $b ne $empty_string ) {
255  
256 $sutivel->{_b} = $b;
257 $sutivel->{_note} = $sutivel->{_note}.' b='.$sutivel->{_b};
258 $sutivel->{_Step} = $sutivel->{_Step}.' b='.$sutivel->{_b};
259  
260 } else {
261 print("sutivel, b, missing b,\n");
262 }
263 }
264  
265  
266 =head2 sub d
267  
268  
269 =cut
270  
271 sub d {
272  
273 my ( $self,$d ) = @_;
274 if ( $d ne $empty_string ) {
275  
276 $sutivel->{_d} = $d;
277 $sutivel->{_note} = $sutivel->{_note}.' d='.$sutivel->{_d};
278 $sutivel->{_Step} = $sutivel->{_Step}.' d='.$sutivel->{_d};
279  
280 } else {
281 print("sutivel, d, missing d,\n");
282 }
283 }
284  
285  
286 =head2 sub e
287  
288  
289 =cut
290  
291 sub e {
292  
293 my ( $self,$e ) = @_;
294 if ( $e ne $empty_string ) {
295  
296 $sutivel->{_e} = $e;
297 $sutivel->{_note} = $sutivel->{_note}.' e='.$sutivel->{_e};
298 $sutivel->{_Step} = $sutivel->{_Step}.' e='.$sutivel->{_e};
299  
300 } else {
301 print("sutivel, e, missing e,\n");
302 }
303 }
304  
305  
306 =head2 sub maxangle
307  
308  
309 =cut
310  
311 sub maxangle {
312  
313 my ( $self,$maxangle ) = @_;
314 if ( $maxangle ne $empty_string ) {
315  
316 $sutivel->{_maxangle} = $maxangle;
317 $sutivel->{_note} = $sutivel->{_note}.' maxangle='.$sutivel->{_maxangle};
318 $sutivel->{_Step} = $sutivel->{_Step}.' maxangle='.$sutivel->{_maxangle};
319  
320 } else {
321 print("sutivel, maxangle, missing maxangle,\n");
322 }
323 }
324  
325  
326 =head2 sub nangle
327  
328  
329 =cut
330  
331 sub nangle {
332  
333 my ( $self,$nangle ) = @_;
334 if ( $nangle ne $empty_string ) {
335  
336 $sutivel->{_nangle} = $nangle;
337 $sutivel->{_note} = $sutivel->{_note}.' nangle='.$sutivel->{_nangle};
338 $sutivel->{_Step} = $sutivel->{_Step}.' nangle='.$sutivel->{_nangle};
339  
340 } else {
341 print("sutivel, nangle, missing nangle,\n");
342 }
343 }
344  
345  
346 =head2 sub normalize
347  
348  
349 =cut
350  
351 sub normalize {
352  
353 my ( $self,$normalize ) = @_;
354 if ( $normalize ne $empty_string ) {
355  
356 $sutivel->{_normalize} = $normalize;
357 $sutivel->{_note} = $sutivel->{_note}.' normalize='.$sutivel->{_normalize};
358 $sutivel->{_Step} = $sutivel->{_Step}.' normalize='.$sutivel->{_normalize};
359  
360 } else {
361 print("sutivel, normalize, missing normalize,\n");
362 }
363 }
364  
365  
366 =head2 sub np
367  
368  
369 =cut
370  
371 sub np {
372  
373 my ( $self,$np ) = @_;
374 if ( $np ne $empty_string ) {
375  
376 $sutivel->{_np} = $np;
377 $sutivel->{_note} = $sutivel->{_note}.' np='.$sutivel->{_np};
378 $sutivel->{_Step} = $sutivel->{_Step}.' np='.$sutivel->{_np};
379  
380 } else {
381 print("sutivel, np, missing np,\n");
382 }
383 }
384  
385  
386 =head2 sub option
387  
388  
389 =cut
390  
391 sub option {
392  
393 my ( $self,$option ) = @_;
394 if ( $option ne $empty_string ) {
395  
396 $sutivel->{_option} = $option;
397 $sutivel->{_note} = $sutivel->{_note}.' option='.$sutivel->{_option};
398 $sutivel->{_Step} = $sutivel->{_Step}.' option='.$sutivel->{_option};
399  
400 } else {
401 print("sutivel, option, missing option,\n");
402 }
403 }
404  
405  
406 =head2 sub verbose
407  
408  
409 =cut
410  
411 sub verbose {
412  
413 my ( $self,$verbose ) = @_;
414 if ( $verbose ne $empty_string ) {
415  
416 $sutivel->{_verbose} = $verbose;
417 $sutivel->{_note} = $sutivel->{_note}.' verbose='.$sutivel->{_verbose};
418 $sutivel->{_Step} = $sutivel->{_Step}.' verbose='.$sutivel->{_verbose};
419  
420 } else {
421 print("sutivel, verbose, missing verbose,\n");
422 }
423 }
424  
425  
426 =head2 sub get_max_index
427  
428 max index = number of input variables -1
429
430 =cut
431
432 sub get_max_index {
433 my ($self) = @_;
434 my $max_index = 9;
435  
436 return($max_index);
437 }
438
439
440 1;