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

filter: Statementstmt 0.0% 0 / 69 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 11 totaltotal 0.0% 0 / 107 CC 8 SCAR 15.7
CC
8
Cov
0%
dz
6.0
m
6.0
ncurve
6.0
CRAP 4.8
1 package App::SeismicUnixGui::sunix::well::las2su;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PROGRAM NAME: LAS2SU - convert las2 format well log curves to su traces
8 AUTHOR: Juan Lorenzo (Perl module only)
9 DATE:
10 DESCRIPTION:
11 Version:
12  
13 =head2 USE
14  
15 =head3 NOTES
16  
17 =head4 Examples
18  
19 =head3 SEISMIC UNIX NOTES
20  
21 LAS2SU - convert las2 format well log curves to su traces
22  
23 las2su <stdin nskip= ncurve= >stdout [optional params]
24  
25 Required parameters:
26 none
27 Optional parameters:
28 ncurve=automatic number of log curves in the las file
29 dz=0.5 input depth sampling (ft)
30 m=0 output (d1,f1) in feet
31 =1 output (d1,f1) in meters
32 ss=0 do not subsample (unless nz > 32767 )
33 =1 pass every other sample
34 verbose=0 =1 to echo las header lines to screen
35 outhdr=las_header.asc name of file for las headers
36  
37 Notes:
38 1. It is recommended to run LAS_CERTIFY available from CWLS
39 at http://cwls.org.
40 2. First log curve MUST BE depth.
41 3. If number of depth levels > 32767 (segy NT limit)
42 then input is subsampled by factor of 2 or 4 as needed
43 4. Logs may be isolated using tracl header word (1,2,...,ncurve)
44 tracl=1 is depth
45  
46 If the input LAS file contains sonic data as delta t or interval
47 transit time and you plan to use these data for generating a
48 reflection coefficient time series in suwellrf, convert the sonic
49 trace to velocity using suop with op=s2v (sonic to velocity)
50 before input of the velocity trace to suwellrf. ",
51  
52 Caveat: ",
53 No trap is made for the commonly used null value in LAS files
54 (-999.25). The null value will be output as ?999.25, which
55 really messes up a suxwigb display of density data because the
56 ?999.25 skews the more or less 2.5 values of density.
57 The user needs to edit out null values (-999.25) before running
58 other programs, such as "suwellrf".
59  
60  
61 Credits:
62 * Chris Liner based on code by Ferhan Ahmed and a2b.c (June 2005)
63 * (Based on code by Ferhan Ahmed and a2b.c)
64 * I gratefully acknowledge Saudi Aramco for permission
65 * to release this code developed while I worked for the
66 * EXPEC-ARC research division.
67 * CWP: John Stockwell 31 Oct 2006, combining lasstrip and
68 * CENPET: lasstrip 2006 by Werner Heigl
69 *
70 * Rob Hardy: allow the ncurve parameter to work correctly if set
71 * - change string length to 400 characters to allow more curves
72 * - note nskip in header is totally ignored !
73 *
74 * Ideas for improvement:
75 * add option to chop off part of logs (often shallow
76 * portions are not of interest
77 * cross check sampling interval from header against
78 * values found from first log curve (=depth)
79 *
80
81  
82 =head2 CHANGES and their DATES
83  
84 =cut
85  
86 use Moose;
87 our $VERSION = '0.0.1';
88 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
89  
90 my $get = L_SU_global_constants->new();
91  
92 my $var = $get->var();
93 my $empty_string = $var->{_empty_string};
94  
95 my $las2su = {
96 _dz => '',
97 _m => '',
98 _ncurve => '',
99 _nskip => '',
100 _outhdr => '',
101 _ss => '',
102 _verbose => '',
103 _Step => '',
104 _note => '',
105 };
106  
107 =head2 sub Step
108  
109 collects switches and assembles bash instructions
110 by adding the program name
111  
112 =cut
113  
114 sub Step {
115  
116 $las2su->{_Step} = 'las2su' . $las2su->{_Step};
117 return ( $las2su->{_Step} );
118  
119 }
120  
121 =head2 sub note
122  
123 collects switches and assembles bash instructions
124 by adding the program name
125  
126 =cut
127  
128 sub note {
129  
130 $las2su->{_note} = 'las2su' . $las2su->{_note};
131 return ( $las2su->{_note} );
132  
133 }
134  
135 =head2 sub clear
136  
137 =cut
138  
139 sub clear {
140  
141 $las2su->{_dz} = '';
142 $las2su->{_m} = '';
143 $las2su->{_ncurve} = '';
144 $las2su->{_nskip} = '';
145 $las2su->{_outhdr} = '';
146 $las2su->{_ss} = '';
147 $las2su->{_verbose} = '';
148 $las2su->{_Step} = '';
149 $las2su->{_note} = '';
150 }
151  
152 =head2 sub dz
153  
154  
155 =cut
156  
157 sub dz {
158  
159 my ( $self, $dz ) = @_;
160 if ( $dz ne $empty_string ) {
161  
162 $las2su->{_dz} = $dz;
163 $las2su->{_note} = $las2su->{_note} . ' dz=' . $las2su->{_dz};
164 $las2su->{_Step} = $las2su->{_Step} . ' dz=' . $las2su->{_dz};
165  
166 }
167 else {
168 print("las2su, dz, missing dz,\n");
169 }
170 }
171  
172 =head2 sub m
173  
174  
175 =cut
176  
177 sub m {
178  
179 my ( $self, $m ) = @_;
180 if ( $m ne $empty_string ) {
181  
182 $las2su->{_m} = $m;
183 $las2su->{_note} = $las2su->{_note} . ' m=' . $las2su->{_m};
184 $las2su->{_Step} = $las2su->{_Step} . ' m=' . $las2su->{_m};
185  
186 }
187 else {
188 print("las2su, m, missing m,\n");
189 }
190 }
191  
192 =head2 sub ncurve
193  
194  
195 =cut
196  
197 sub ncurve {
198  
199 my ( $self, $ncurve ) = @_;
200 if ( $ncurve ne $empty_string ) {
201  
202 $las2su->{_ncurve} = $ncurve;
203 $las2su->{_note} = $las2su->{_note} . ' ncurve=' . $las2su->{_ncurve};
204 $las2su->{_Step} = $las2su->{_Step} . ' ncurve=' . $las2su->{_ncurve};
205  
206 }
207 else {
208 print("las2su, ncurve, missing ncurve,\n");
209 }
210 }
211  
212 =head2 sub nskip
213  
214  
215 =cut
216  
217 sub nskip {
218  
219 my ( $self, $nskip ) = @_;
220 if ( $nskip ne $empty_string ) {
221  
222 $las2su->{_nskip} = $nskip;
223 $las2su->{_note} = $las2su->{_note} . ' nskip=' . $las2su->{_nskip};
224 $las2su->{_Step} = $las2su->{_Step} . ' nskip=' . $las2su->{_nskip};
225  
226 }
227 else {
228 print("las2su, nskip, missing nskip,\n");
229 }
230 }
231  
232 =head2 sub outhdr
233  
234  
235 =cut
236  
237 sub outhdr {
238  
239 my ( $self, $outhdr ) = @_;
240 if ( $outhdr ne $empty_string ) {
241  
242 $las2su->{_outhdr} = $outhdr;
243 $las2su->{_note} = $las2su->{_note} . ' outhdr=' . $las2su->{_outhdr};
244 $las2su->{_Step} = $las2su->{_Step} . ' outhdr=' . $las2su->{_outhdr};
245  
246 }
247 else {
248 print("las2su, outhdr, missing outhdr,\n");
249 }
250 }
251  
252 =head2 sub ss
253  
254  
255 =cut
256  
257 sub ss {
258  
259 my ( $self, $ss ) = @_;
260 if ( $ss ne $empty_string ) {
261  
262 $las2su->{_ss} = $ss;
263 $las2su->{_note} = $las2su->{_note} . ' ss=' . $las2su->{_ss};
264 $las2su->{_Step} = $las2su->{_Step} . ' ss=' . $las2su->{_ss};
265  
266 }
267 else {
268 print("las2su, ss, missing ss,\n");
269 }
270 }
271  
272 =head2 sub verbose
273  
274  
275 =cut
276  
277 sub verbose {
278  
279 my ( $self, $verbose ) = @_;
280 if ( $verbose ne $empty_string ) {
281  
282 $las2su->{_verbose} = $verbose;
283 $las2su->{_note} =
284 $las2su->{_note} . ' verbose=' . $las2su->{_verbose};
285 $las2su->{_Step} =
286 $las2su->{_Step} . ' verbose=' . $las2su->{_verbose};
287  
288 }
289 else {
290 print("las2su, verbose, missing verbose,\n");
291 }
292 }
293  
294 =head2 sub get_max_index
295
296 max index = number of input variables -1
297
298 =cut
299  
300 sub get_max_index {
301 my ($self) = @_;
302 my $max_index = 6;
303  
304 return ($max_index);
305 }
306  
307 1;