lib/App/SeismicUnixGui/sunix/well/subackush.pm untested

filter: Statementstmt 0.0% 0 / 125 Branchbran 0.0% 0 / 26 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 21 Podpod 0.0% 0 / 17 totaltotal 0.0% 0 / 189 CC 14 SCAR 16.2
CC
14
Cov
0%
gr
6.0
grc
6.0
grs
6.0
CRAP 5.1
1 package App::SeismicUnixGui::sunix::well::subackush;
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 SUBACKUSH - calculate Thomsen anisotropy parameters from
25  
26 well log (vp,vs,rho) data and optionally include
27  
28 intrinsic VTI shale layers based on gramma ray log
29  
30 via BACKUS averaging
31  
32 subackush < vp_vs_rho.su >stdout [options]
33  
34 subackush < vp_vs_rho_gr.su gr=1 >stdout [options]
35  
36  
37  
38 Required parameters:
39  
40 none
41  
42  
43  
44 Optional parameter:
45  
46 navg=101 number of depth samples in Backus avg window
47  
48  
49  
50 Intrinsic anisotropy of shale layers can be included ...
51  
52 gr=0 no gamma ray log input for shale
53  
54 =1 input is vp_vs_rho_gr
55  
56 grs=100 pure shale gamma ray value (API units)
57  
58 grc=10 0hale gamma ray value (API units)
59  
60 smode=1 include shale anis params prop to shale volume
61  
62 =0 include shale anis for pure shale only
63  
64 se=0.209 shale epsilon (Thomsen parameter)
65  
66 sd=0.033 shale delta (Thomsen parameter)
67  
68 sg=0.203 shale gamma (Thomsen parameter)
69  
70  
71  
72 Notes:
73  
74 1. Input are (vp,vs,rho) traces in metric units
75  
76 2. Output are
77  
78 tracl =(1,2,3,4,5,6)
79  
80 quantity =(vp0,vs0,<rho>,epsilon,delta,gamma)
81  
82 units =(m/s,m/s,kg/m^3,nd,nd,nd) nd=dimensionless
83  
84 tracl =(7,8)
85  
86 quantity =(Vsh,shaleEps) Vsh=shale volume fraction
87  
88 units =(nd,nd)
89  
90 3. (epsilon,delta,etc.) can be isolated by tracl header field
91  
92 4. (vp0,vs0) are backus averaged vertical wavespeeds
93  
94 5. <rho> is backus averaged density, etc.
95  
96  
97  
98 Example:
99  
100 las2su < logs.las nskip=34 nlog=4 > logs.su
101  
102 suwind < logs.su key=tracl min=2 max=3 | suop op=s2vm > v.su
103  
104 suwind < logs.su key=tracl min=4 max=4 | suop op=d2m > d.su
105  
106 fcat v.su d.su > vp_vs_rho.su
107  
108 subackus < vp_vs_rho.su > vp0_vs0_rho_eps_delta_gamma.su
109  
110 In this example we start with a well las file containing
111  
112 34 header lines and 4 log tracks (depth,p_son,s_son,den).
113  
114 This is converted to su format by las2su. Then we pull off
115  
116 the sonic logs and convert them to velocity in metric units.
117  
118 Then the density log is pulled off and converted to metric.
119  
120 All three metric curves are bundled into one su file which
121  
122 is the input to subackus. ",
123  
124  
125  
126 Related programs: subackus, sulprime
127  
128  
129  
130  
131  
132 Credits:
133  
134  
135  
136 UHouston: Chris Liner
137  
138 I gratefully acknowledge Saudi Aramco for permission
139  
140 to release this code developed while I worked for the
141  
142 EXPEC-ARC research division.
143  
144  
145  
146 References:
147  
148 Anisotropy parameters: Thomsen, 2002, DISC Notes (SEG)
149  
150 Backus Method: Berryman, Grechka, and Berge, 1997, SEP94
151  
152 Shale params: Wang, 2002, Geophysics, p. 1427
153  
154  
155  
156 =head2 User's notes (Juan Lorenzo)
157 untested
158  
159 =cut
160  
161  
162 =head2 CHANGES and their DATES
163  
164 =cut
165  
166 use Moose;
167 our $VERSION = '0.0.1';
168  
169  
170 =head2 Import packages
171  
172 =cut
173  
174 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
175  
176 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
177 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
178  
179  
180 =head2 instantiation of packages
181  
182 =cut
183  
184 my $get = L_SU_global_constants->new();
185 my $Project = Project_config->new();
186 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
187 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
188 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
189  
190 my $var = $get->var();
191 my $on = $var->{_on};
192 my $off = $var->{_off};
193 my $true = $var->{_true};
194 my $false = $var->{_false};
195 my $empty_string = $var->{_empty_string};
196  
197 =head2 Encapsulated
198 hash of private variables
199  
200 =cut
201  
202 my $subackush = {
203 _gr => '',
204 _grc => '',
205 _grs => '',
206 _key => '',
207 _navg => '',
208 _nskip => '',
209 _quantity => '',
210 _sd => '',
211 _se => '',
212 _sg => '',
213 _smode => '',
214 _tracl => '',
215 _units => '',
216 _Step => '',
217 _note => '',
218  
219 };
220  
221 =head2 sub Step
222  
223 collects switches and assembles bash instructions
224 by adding the program name
225  
226 =cut
227  
228 sub Step {
229  
230 $subackush->{_Step} = 'subackush'.$subackush->{_Step};
231 return ( $subackush->{_Step} );
232  
233 }
234  
235  
236 =head2 sub note
237  
238 collects switches and assembles bash instructions
239 by adding the program name
240  
241 =cut
242  
243 sub note {
244  
245 $subackush->{_note} = 'subackush'.$subackush->{_note};
246 return ( $subackush->{_note} );
247  
248 }
249  
250  
251  
252 =head2 sub clear
253  
254 =cut
255  
256 sub clear {
257  
258 $subackush->{_gr} = '';
259 $subackush->{_grc} = '';
260 $subackush->{_grs} = '';
261 $subackush->{_key} = '';
262 $subackush->{_navg} = '';
263 $subackush->{_nskip} = '';
264 $subackush->{_quantity} = '';
265 $subackush->{_sd} = '';
266 $subackush->{_se} = '';
267 $subackush->{_sg} = '';
268 $subackush->{_smode} = '';
269 $subackush->{_tracl} = '';
270 $subackush->{_units} = '';
271 $subackush->{_Step} = '';
272 $subackush->{_note} = '';
273 }
274  
275  
276 =head2 sub gr
277  
278  
279 =cut
280  
281 sub gr {
282  
283 my ( $self,$gr ) = @_;
284 if ( $gr ne $empty_string ) {
285  
286 $subackush->{_gr} = $gr;
287 $subackush->{_note} = $subackush->{_note}.' gr='.$subackush->{_gr};
288 $subackush->{_Step} = $subackush->{_Step}.' gr='.$subackush->{_gr};
289  
290 } else {
291 print("subackush, gr, missing gr,\n");
292 }
293 }
294  
295  
296 =head2 sub grc
297  
298  
299 =cut
300  
301 sub grc {
302  
303 my ( $self,$grc ) = @_;
304 if ( $grc ne $empty_string ) {
305  
306 $subackush->{_grc} = $grc;
307 $subackush->{_note} = $subackush->{_note}.' grc='.$subackush->{_grc};
308 $subackush->{_Step} = $subackush->{_Step}.' grc='.$subackush->{_grc};
309  
310 } else {
311 print("subackush, grc, missing grc,\n");
312 }
313 }
314  
315  
316 =head2 sub grs
317  
318  
319 =cut
320  
321 sub grs {
322  
323 my ( $self,$grs ) = @_;
324 if ( $grs ne $empty_string ) {
325  
326 $subackush->{_grs} = $grs;
327 $subackush->{_note} = $subackush->{_note}.' grs='.$subackush->{_grs};
328 $subackush->{_Step} = $subackush->{_Step}.' grs='.$subackush->{_grs};
329  
330 } else {
331 print("subackush, grs, missing grs,\n");
332 }
333 }
334  
335  
336 =head2 sub key
337  
338  
339 =cut
340  
341 sub key {
342  
343 my ( $self,$key ) = @_;
344 if ( $key ne $empty_string ) {
345  
346 $subackush->{_key} = $key;
347 $subackush->{_note} = $subackush->{_note}.' key='.$subackush->{_key};
348 $subackush->{_Step} = $subackush->{_Step}.' key='.$subackush->{_key};
349  
350 } else {
351 print("subackush, key, missing key,\n");
352 }
353 }
354  
355  
356 =head2 sub navg
357  
358  
359 =cut
360  
361 sub navg {
362  
363 my ( $self,$navg ) = @_;
364 if ( $navg ne $empty_string ) {
365  
366 $subackush->{_navg} = $navg;
367 $subackush->{_note} = $subackush->{_note}.' navg='.$subackush->{_navg};
368 $subackush->{_Step} = $subackush->{_Step}.' navg='.$subackush->{_navg};
369  
370 } else {
371 print("subackush, navg, missing navg,\n");
372 }
373 }
374  
375  
376 =head2 sub nskip
377  
378  
379 =cut
380  
381 sub nskip {
382  
383 my ( $self,$nskip ) = @_;
384 if ( $nskip ne $empty_string ) {
385  
386 $subackush->{_nskip} = $nskip;
387 $subackush->{_note} = $subackush->{_note}.' nskip='.$subackush->{_nskip};
388 $subackush->{_Step} = $subackush->{_Step}.' nskip='.$subackush->{_nskip};
389  
390 } else {
391 print("subackush, nskip, missing nskip,\n");
392 }
393 }
394  
395  
396 =head2 sub quantity
397  
398  
399 =cut
400  
401 sub quantity {
402  
403 my ( $self,$quantity ) = @_;
404 if ( $quantity ne $empty_string ) {
405  
406 $subackush->{_quantity} = $quantity;
407 $subackush->{_note} = $subackush->{_note}.' quantity='.$subackush->{_quantity};
408 $subackush->{_Step} = $subackush->{_Step}.' quantity='.$subackush->{_quantity};
409  
410 } else {
411 print("subackush, quantity, missing quantity,\n");
412 }
413 }
414  
415  
416 =head2 sub sd
417  
418  
419 =cut
420  
421 sub sd {
422  
423 my ( $self,$sd ) = @_;
424 if ( $sd ne $empty_string ) {
425  
426 $subackush->{_sd} = $sd;
427 $subackush->{_note} = $subackush->{_note}.' sd='.$subackush->{_sd};
428 $subackush->{_Step} = $subackush->{_Step}.' sd='.$subackush->{_sd};
429  
430 } else {
431 print("subackush, sd, missing sd,\n");
432 }
433 }
434  
435  
436 =head2 sub se
437  
438  
439 =cut
440  
441 sub se {
442  
443 my ( $self,$se ) = @_;
444 if ( $se ne $empty_string ) {
445  
446 $subackush->{_se} = $se;
447 $subackush->{_note} = $subackush->{_note}.' se='.$subackush->{_se};
448 $subackush->{_Step} = $subackush->{_Step}.' se='.$subackush->{_se};
449  
450 } else {
451 print("subackush, se, missing se,\n");
452 }
453 }
454  
455  
456 =head2 sub sg
457  
458  
459 =cut
460  
461 sub sg {
462  
463 my ( $self,$sg ) = @_;
464 if ( $sg ne $empty_string ) {
465  
466 $subackush->{_sg} = $sg;
467 $subackush->{_note} = $subackush->{_note}.' sg='.$subackush->{_sg};
468 $subackush->{_Step} = $subackush->{_Step}.' sg='.$subackush->{_sg};
469  
470 } else {
471 print("subackush, sg, missing sg,\n");
472 }
473 }
474  
475  
476 =head2 sub smode
477  
478  
479 =cut
480  
481 sub smode {
482  
483 my ( $self,$smode ) = @_;
484 if ( $smode ne $empty_string ) {
485  
486 $subackush->{_smode} = $smode;
487 $subackush->{_note} = $subackush->{_note}.' smode='.$subackush->{_smode};
488 $subackush->{_Step} = $subackush->{_Step}.' smode='.$subackush->{_smode};
489  
490 } else {
491 print("subackush, smode, missing smode,\n");
492 }
493 }
494  
495  
496 =head2 sub tracl
497  
498  
499 =cut
500  
501 sub tracl {
502  
503 my ( $self,$tracl ) = @_;
504 if ( $tracl ne $empty_string ) {
505  
506 $subackush->{_tracl} = $tracl;
507 $subackush->{_note} = $subackush->{_note}.' tracl='.$subackush->{_tracl};
508 $subackush->{_Step} = $subackush->{_Step}.' tracl='.$subackush->{_tracl};
509  
510 } else {
511 print("subackush, tracl, missing tracl,\n");
512 }
513 }
514  
515  
516 =head2 sub units
517  
518  
519 =cut
520  
521 sub units {
522  
523 my ( $self,$units ) = @_;
524 if ( $units ne $empty_string ) {
525  
526 $subackush->{_units} = $units;
527 $subackush->{_note} = $subackush->{_note}.' units='.$subackush->{_units};
528 $subackush->{_Step} = $subackush->{_Step}.' units='.$subackush->{_units};
529  
530 } else {
531 print("subackush, units, missing units,\n");
532 }
533 }
534  
535  
536 =head2 sub get_max_index
537  
538 max index = number of input variables -1
539
540 =cut
541
542 sub get_max_index {
543 my ($self) = @_;
544 my $max_index = 12;
545  
546 return($max_index);
547 }
548
549
550 1;