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

filter: Statementstmt 0.0% 0 / 104 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 / 156 CC 11 SCAR 15.8
CC
11
Cov
0%
dfile
6.0
drfile
6.0
dtout
6.0
CRAP 4.9
1 package App::SeismicUnixGui::sunix::well::suwellrf;
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 SUWELLRF - convert WELL log depth, velocity, density data into a
25  
26 uniformly sampled normal incidence Reflectivity Function of time
27  
28  
29  
30 suwellrf [required parameters] [optional parameters] > [stdout]
31  
32  
33  
34 Required Parameters:
35  
36 dvrfile= file containing depth, velocity, and density values
37  
38 ...or...
39  
40 dvfile= file containing depth and velocity values
41  
42 drfile= file containing depth and density values
43  
44 ...or...
45  
46 dfile= file containing depth values
47  
48 vfile= file containing velocity log values
49  
50 rhofile= file containing density log values
51  
52 nval= number of triplets of d,v,r values if dvrfile is set,
53  
54 number of pairs of d,v and d,r values dvfile and drfile
55  
56 are set, or number of values if dfile, vfile, and rhofile
57  
58 are set.
59  
60  
61  
62 Optional Parameters:
63  
64 dtout=.004 desired time sampling interval (sec) in output
65  
66 ntr=1 number of traces to output
67  
68  
69  
70 Notes:
71  
72 The format of the input file(s) is C-style binary float. These files
73  
74 may be constructed from ascii file via:
75  
76  
77  
78 a2b n1=3 < dvrfile.ascii > dvrfile.bin
79  
80 ...or...
81  
82 a2b n1=2 < dvfile.ascii > dvfile.bin
83  
84 a2b n1=2 < drfile.ascii > drfile.bin
85  
86 ...or...
87  
88 a2b n1=1 < dfile.ascii > dfile.bin
89  
90 a2b n1=1 < vfile.ascii > dfile.bin
91  
92 a2b n1=1 < rhofile.ascii > rhofile.bin
93  
94  
95  
96 A raw normal-incidence impedence reflectivity as a function of time is
97  
98 is generated using the smallest two-way traveltime implied by the
99  
100 input velocities as the time sampling interval. This raw reflectivity
101  
102 trace is then resampled to the desired output time sampling interval
103  
104 via 8 point sinc interpolation. If the number of samples on the output
105  
106 exceeds SU_NFLTS the output trace will be truncated to that value.
107  
108  
109  
110 Caveat:
111  
112 This program is really only a first rough attempt at creating a well
113  
114 log utility. User input and modifications are welcome.
115  
116  
117  
118 See also: suresamp
119  
120  
121  
122  
123  
124  
125  
126 Author: CWP: John Stockwell, Summer 2001, updated Summer 2002.
127  
128 inspired by a project by GP grad student Leo Brown
129  
130  
131  
132 =head2 User's notes (Juan Lorenzo)
133 untested
134  
135 =cut
136  
137  
138 =head2 CHANGES and their DATES
139  
140 =cut
141  
142 use Moose;
143 our $VERSION = '0.0.1';
144  
145  
146 =head2 Import packages
147  
148 =cut
149  
150 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
151  
152 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
153 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
154  
155  
156 =head2 instantiation of packages
157  
158 =cut
159  
160 my $get = L_SU_global_constants->new();
161 my $Project = Project_config->new();
162 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
163 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
164 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
165  
166 my $var = $get->var();
167 my $on = $var->{_on};
168 my $off = $var->{_off};
169 my $true = $var->{_true};
170 my $false = $var->{_false};
171 my $empty_string = $var->{_empty_string};
172  
173 =head2 Encapsulated
174 hash of private variables
175  
176 =cut
177  
178 my $suwellrf = {
179 _dfile => '',
180 _drfile => '',
181 _dtout => '',
182 _dvfile => '',
183 _dvrfile => '',
184 _n1 => '',
185 _ntr => '',
186 _nval => '',
187 _rhofile => '',
188 _vfile => '',
189 _Step => '',
190 _note => '',
191  
192 };
193  
194 =head2 sub Step
195  
196 collects switches and assembles bash instructions
197 by adding the program name
198  
199 =cut
200  
201 sub Step {
202  
203 $suwellrf->{_Step} = 'suwellrf'.$suwellrf->{_Step};
204 return ( $suwellrf->{_Step} );
205  
206 }
207  
208  
209 =head2 sub note
210  
211 collects switches and assembles bash instructions
212 by adding the program name
213  
214 =cut
215  
216 sub note {
217  
218 $suwellrf->{_note} = 'suwellrf'.$suwellrf->{_note};
219 return ( $suwellrf->{_note} );
220  
221 }
222  
223  
224  
225 =head2 sub clear
226  
227 =cut
228  
229 sub clear {
230  
231 $suwellrf->{_dfile} = '';
232 $suwellrf->{_drfile} = '';
233 $suwellrf->{_dtout} = '';
234 $suwellrf->{_dvfile} = '';
235 $suwellrf->{_dvrfile} = '';
236 $suwellrf->{_n1} = '';
237 $suwellrf->{_ntr} = '';
238 $suwellrf->{_nval} = '';
239 $suwellrf->{_rhofile} = '';
240 $suwellrf->{_vfile} = '';
241 $suwellrf->{_Step} = '';
242 $suwellrf->{_note} = '';
243 }
244  
245  
246 =head2 sub dfile
247  
248  
249 =cut
250  
251 sub dfile {
252  
253 my ( $self,$dfile ) = @_;
254 if ( $dfile ne $empty_string ) {
255  
256 $suwellrf->{_dfile} = $dfile;
257 $suwellrf->{_note} = $suwellrf->{_note}.' dfile='.$suwellrf->{_dfile};
258 $suwellrf->{_Step} = $suwellrf->{_Step}.' dfile='.$suwellrf->{_dfile};
259  
260 } else {
261 print("suwellrf, dfile, missing dfile,\n");
262 }
263 }
264  
265  
266 =head2 sub drfile
267  
268  
269 =cut
270  
271 sub drfile {
272  
273 my ( $self,$drfile ) = @_;
274 if ( $drfile ne $empty_string ) {
275  
276 $suwellrf->{_drfile} = $drfile;
277 $suwellrf->{_note} = $suwellrf->{_note}.' drfile='.$suwellrf->{_drfile};
278 $suwellrf->{_Step} = $suwellrf->{_Step}.' drfile='.$suwellrf->{_drfile};
279  
280 } else {
281 print("suwellrf, drfile, missing drfile,\n");
282 }
283 }
284  
285  
286 =head2 sub dtout
287  
288  
289 =cut
290  
291 sub dtout {
292  
293 my ( $self,$dtout ) = @_;
294 if ( $dtout ne $empty_string ) {
295  
296 $suwellrf->{_dtout} = $dtout;
297 $suwellrf->{_note} = $suwellrf->{_note}.' dtout='.$suwellrf->{_dtout};
298 $suwellrf->{_Step} = $suwellrf->{_Step}.' dtout='.$suwellrf->{_dtout};
299  
300 } else {
301 print("suwellrf, dtout, missing dtout,\n");
302 }
303 }
304  
305  
306 =head2 sub dvfile
307  
308  
309 =cut
310  
311 sub dvfile {
312  
313 my ( $self,$dvfile ) = @_;
314 if ( $dvfile ne $empty_string ) {
315  
316 $suwellrf->{_dvfile} = $dvfile;
317 $suwellrf->{_note} = $suwellrf->{_note}.' dvfile='.$suwellrf->{_dvfile};
318 $suwellrf->{_Step} = $suwellrf->{_Step}.' dvfile='.$suwellrf->{_dvfile};
319  
320 } else {
321 print("suwellrf, dvfile, missing dvfile,\n");
322 }
323 }
324  
325  
326 =head2 sub dvrfile
327  
328  
329 =cut
330  
331 sub dvrfile {
332  
333 my ( $self,$dvrfile ) = @_;
334 if ( $dvrfile ne $empty_string ) {
335  
336 $suwellrf->{_dvrfile} = $dvrfile;
337 $suwellrf->{_note} = $suwellrf->{_note}.' dvrfile='.$suwellrf->{_dvrfile};
338 $suwellrf->{_Step} = $suwellrf->{_Step}.' dvrfile='.$suwellrf->{_dvrfile};
339  
340 } else {
341 print("suwellrf, dvrfile, missing dvrfile,\n");
342 }
343 }
344  
345  
346 =head2 sub n1
347  
348  
349 =cut
350  
351 sub n1 {
352  
353 my ( $self,$n1 ) = @_;
354 if ( $n1 ne $empty_string ) {
355  
356 $suwellrf->{_n1} = $n1;
357 $suwellrf->{_note} = $suwellrf->{_note}.' n1='.$suwellrf->{_n1};
358 $suwellrf->{_Step} = $suwellrf->{_Step}.' n1='.$suwellrf->{_n1};
359  
360 } else {
361 print("suwellrf, n1, missing n1,\n");
362 }
363 }
364  
365  
366 =head2 sub ntr
367  
368  
369 =cut
370  
371 sub ntr {
372  
373 my ( $self,$ntr ) = @_;
374 if ( $ntr ne $empty_string ) {
375  
376 $suwellrf->{_ntr} = $ntr;
377 $suwellrf->{_note} = $suwellrf->{_note}.' ntr='.$suwellrf->{_ntr};
378 $suwellrf->{_Step} = $suwellrf->{_Step}.' ntr='.$suwellrf->{_ntr};
379  
380 } else {
381 print("suwellrf, ntr, missing ntr,\n");
382 }
383 }
384  
385  
386 =head2 sub nval
387  
388  
389 =cut
390  
391 sub nval {
392  
393 my ( $self,$nval ) = @_;
394 if ( $nval ne $empty_string ) {
395  
396 $suwellrf->{_nval} = $nval;
397 $suwellrf->{_note} = $suwellrf->{_note}.' nval='.$suwellrf->{_nval};
398 $suwellrf->{_Step} = $suwellrf->{_Step}.' nval='.$suwellrf->{_nval};
399  
400 } else {
401 print("suwellrf, nval, missing nval,\n");
402 }
403 }
404  
405  
406 =head2 sub rhofile
407  
408  
409 =cut
410  
411 sub rhofile {
412  
413 my ( $self,$rhofile ) = @_;
414 if ( $rhofile ne $empty_string ) {
415  
416 $suwellrf->{_rhofile} = $rhofile;
417 $suwellrf->{_note} = $suwellrf->{_note}.' rhofile='.$suwellrf->{_rhofile};
418 $suwellrf->{_Step} = $suwellrf->{_Step}.' rhofile='.$suwellrf->{_rhofile};
419  
420 } else {
421 print("suwellrf, rhofile, missing rhofile,\n");
422 }
423 }
424  
425  
426 =head2 sub vfile
427  
428  
429 =cut
430  
431 sub vfile {
432  
433 my ( $self,$vfile ) = @_;
434 if ( $vfile ne $empty_string ) {
435  
436 $suwellrf->{_vfile} = $vfile;
437 $suwellrf->{_note} = $suwellrf->{_note}.' vfile='.$suwellrf->{_vfile};
438 $suwellrf->{_Step} = $suwellrf->{_Step}.' vfile='.$suwellrf->{_vfile};
439  
440 } else {
441 print("suwellrf, vfile, missing vfile,\n");
442 }
443 }
444  
445  
446 =head2 sub get_max_index
447  
448 max index = number of input variables -1
449
450 =cut
451
452 sub get_max_index {
453 my ($self) = @_;
454 my $max_index = 8;
455  
456 return($max_index);
457 }
458
459
460 1;