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

filter: Statementstmt 0.0% 0 / 76 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 10 totaltotal 0.0% 0 / 112 CC 7 SCAR 14.8
CC
7
Cov
0%
b
6.0
dz
6.0
f
6.0
CRAP 4.4
1 package App::SeismicUnixGui::sunix::well::sulprime;
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 SULPRIME - find appropriate Backus average length for
25  
26 a given log suite, frequency, and purpose
27  
28  
29  
30 sulprime < vp_vs_rho.su [options] or
31  
32 sulprime < vp_vs_rho_gr.su [options]
33  
34  
35  
36 Required parameters:
37  
38 none
39  
40  
41  
42 Optional parameter:
43  
44 b=2.0 target value of Backus number
45  
46 b=2 is transmission limit (ok for proc, mig, etc.)
47  
48 b=0.3 is scattering limit (ok for modeling)
49  
50 dz=1 input depth sample interval (ft)
51  
52 f=60 frequency (Hz)... dominant or max (to be safe)
53  
54 nmax=301 maximum averaging length (samples)
55  
56 verbose=1 print intermediate results
57  
58 =0 print final result only
59  
60  
61  
62 Notes:
63  
64 1. input is in sync with subackus, but vp and gr not used
65  
66 (gr= gamma ray log)
67  
68 Related codes: subackus, subackush
69  
70  
71  
72
73  
74 Credits:
75  
76 UHouston: Chris Liner Sept 2008
77  
78 I gratefully acknowledge Saudi Aramco for permission
79  
80 to release this code developed while I worked for the
81  
82 EXPEC-ARC research division.
83  
84 Reference:
85  
86 The Backus Number (Liner and Fei, 2007, TLE)
87  
88  
89  
90  
91  
92 =head2 User's notes (Juan Lorenzo)
93 untested
94  
95 =cut
96  
97  
98 =head2 CHANGES and their DATES
99  
100 =cut
101  
102 use Moose;
103 our $VERSION = '0.0.1';
104  
105  
106 =head2 Import packages
107  
108 =cut
109  
110 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
111  
112 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
113 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
114  
115  
116 =head2 instantiation of packages
117  
118 =cut
119  
120 my $get = L_SU_global_constants->new();
121 my $Project = Project_config->new();
122 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
123 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
124 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
125  
126 my $var = $get->var();
127 my $on = $var->{_on};
128 my $off = $var->{_off};
129 my $true = $var->{_true};
130 my $false = $var->{_false};
131 my $empty_string = $var->{_empty_string};
132  
133 =head2 Encapsulated
134 hash of private variables
135  
136 =cut
137  
138 my $sulprime = {
139 _b => '',
140 _dz => '',
141 _f => '',
142 _gr => '',
143 _nmax => '',
144 _verbose => '',
145 _Step => '',
146 _note => '',
147  
148 };
149  
150 =head2 sub Step
151  
152 collects switches and assembles bash instructions
153 by adding the program name
154  
155 =cut
156  
157 sub Step {
158  
159 $sulprime->{_Step} = 'sulprime'.$sulprime->{_Step};
160 return ( $sulprime->{_Step} );
161  
162 }
163  
164  
165 =head2 sub note
166  
167 collects switches and assembles bash instructions
168 by adding the program name
169  
170 =cut
171  
172 sub note {
173  
174 $sulprime->{_note} = 'sulprime'.$sulprime->{_note};
175 return ( $sulprime->{_note} );
176  
177 }
178  
179  
180  
181 =head2 sub clear
182  
183 =cut
184  
185 sub clear {
186  
187 $sulprime->{_b} = '';
188 $sulprime->{_dz} = '';
189 $sulprime->{_f} = '';
190 $sulprime->{_gr} = '';
191 $sulprime->{_nmax} = '';
192 $sulprime->{_verbose} = '';
193 $sulprime->{_Step} = '';
194 $sulprime->{_note} = '';
195 }
196  
197  
198 =head2 sub b
199  
200  
201 =cut
202  
203 sub b {
204  
205 my ( $self,$b ) = @_;
206 if ( $b ne $empty_string ) {
207  
208 $sulprime->{_b} = $b;
209 $sulprime->{_note} = $sulprime->{_note}.' b='.$sulprime->{_b};
210 $sulprime->{_Step} = $sulprime->{_Step}.' b='.$sulprime->{_b};
211  
212 } else {
213 print("sulprime, b, missing b,\n");
214 }
215 }
216  
217  
218 =head2 sub dz
219  
220  
221 =cut
222  
223 sub dz {
224  
225 my ( $self,$dz ) = @_;
226 if ( $dz ne $empty_string ) {
227  
228 $sulprime->{_dz} = $dz;
229 $sulprime->{_note} = $sulprime->{_note}.' dz='.$sulprime->{_dz};
230 $sulprime->{_Step} = $sulprime->{_Step}.' dz='.$sulprime->{_dz};
231  
232 } else {
233 print("sulprime, dz, missing dz,\n");
234 }
235 }
236  
237  
238 =head2 sub f
239  
240  
241 =cut
242  
243 sub f {
244  
245 my ( $self,$f ) = @_;
246 if ( $f ne $empty_string ) {
247  
248 $sulprime->{_f} = $f;
249 $sulprime->{_note} = $sulprime->{_note}.' f='.$sulprime->{_f};
250 $sulprime->{_Step} = $sulprime->{_Step}.' f='.$sulprime->{_f};
251  
252 } else {
253 print("sulprime, f, missing f,\n");
254 }
255 }
256  
257  
258 =head2 sub gr
259  
260  
261 =cut
262  
263 sub gr {
264  
265 my ( $self,$gr ) = @_;
266 if ( $gr ne $empty_string ) {
267  
268 $sulprime->{_gr} = $gr;
269 $sulprime->{_note} = $sulprime->{_note}.' gr='.$sulprime->{_gr};
270 $sulprime->{_Step} = $sulprime->{_Step}.' gr='.$sulprime->{_gr};
271  
272 } else {
273 print("sulprime, gr, missing gr,\n");
274 }
275 }
276  
277  
278 =head2 sub nmax
279  
280  
281 =cut
282  
283 sub nmax {
284  
285 my ( $self,$nmax ) = @_;
286 if ( $nmax ne $empty_string ) {
287  
288 $sulprime->{_nmax} = $nmax;
289 $sulprime->{_note} = $sulprime->{_note}.' nmax='.$sulprime->{_nmax};
290 $sulprime->{_Step} = $sulprime->{_Step}.' nmax='.$sulprime->{_nmax};
291  
292 } else {
293 print("sulprime, nmax, missing nmax,\n");
294 }
295 }
296  
297  
298 =head2 sub verbose
299  
300  
301 =cut
302  
303 sub verbose {
304  
305 my ( $self,$verbose ) = @_;
306 if ( $verbose ne $empty_string ) {
307  
308 $sulprime->{_verbose} = $verbose;
309 $sulprime->{_note} = $sulprime->{_note}.' verbose='.$sulprime->{_verbose};
310 $sulprime->{_Step} = $sulprime->{_Step}.' verbose='.$sulprime->{_verbose};
311  
312 } else {
313 print("sulprime, verbose, missing verbose,\n");
314 }
315 }
316  
317  
318 =head2 sub get_max_index
319  
320 max index = number of input variables -1
321
322 =cut
323
324 sub get_max_index {
325 my ($self) = @_;
326 my $max_index = 5;
327  
328 return($max_index);
329 }
330
331
332 1;