lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/suttoz.pm untested

filter: Statementstmt 0.0% 0 / 84 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 15 Podpod 0.0% 0 / 11 totaltotal 0.0% 0 / 124 CC 8 SCAR 15.1
CC
8
Cov
0%
dz
6.0
fz
6.0
nz
6.0
CRAP 4.5
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::suttoz;
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 SUTTOZ - resample from time to depth
25  
26  
27  
28 suttoz <stdin >stdout [optional parms]
29  
30  
31  
32 Optional Parameters:
33  
34 nz=1+(nt-1)*dt*vmax/(2.0*dz) number of depth samples in output
35  
36 dz=vmin*dt/2 depth sampling interval (defaults avoids aliasing)
37  
38 fz=v(ft)*ft/2 first depth sample
39  
40 t=0.0,... times corresponding to interval velocities in v
41  
42 v=1500.0,... interval velocities corresponding to times in v
43  
44 vfile= binary (non-ascii) file containing velocities v(t)
45  
46 verbose=0 >0 to print depth sampling information
47  
48  
49  
50 Notes:
51  
52 Default value of nz set to avoid aliasing
53  
54 The t and v arrays specify an interval velocity function of time.
55  
56  
57  
58 Note that t and v are given as arrays of floats separated by commas,
59  
60 for example:
61  
62 t=0.0,0.01,.2,... v=1500.0,1720.0,1833.5,... with the number of t values
63  
64 equaling the number of v values. The velocities are linearly interpolated
65  
66 to make a continuous, piecewise linear v(t) profile.
67  
68  
69  
70 Linear interpolation and constant extrapolation is used to determine
71  
72 interval velocities at times not specified. Values specified in t
73  
74 must increase monotonically.
75  
76  
77  
78 Alternatively, interval velocities may be stored in a binary file
79  
80 containing one velocity for every time sample. If vfile is specified,
81  
82 then the t and v arrays are ignored.
83  
84  
85  
86 see selfdoc of suztot for depth to time conversion
87  
88  
89  
90 Trace header fields accessed: ns, dt, and delrt
91  
92 Trace header fields modified: trid, ns, d1, and f1
93  
94  
95  
96  
97  
98 Credits:
99  
100 CWP: Dave Hale c. 1992
101  
102  
103  
104  
105  
106 =head2 User's notes (Juan Lorenzo)
107 untested
108  
109 =cut
110  
111  
112 =head2 CHANGES and their DATES
113  
114 =cut
115  
116 use Moose;
117 our $VERSION = '0.0.1';
118  
119  
120 =head2 Import packages
121  
122 =cut
123  
124 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
125  
126 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
127 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
128  
129  
130 =head2 instantiation of packages
131  
132 =cut
133  
134 my $get = L_SU_global_constants->new();
135 my $Project = Project_config->new();
136 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
137 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
138 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
139  
140 my $PS_SEISMIC = $Project->PS_SEISMIC();
141  
142 my $var = $get->var();
143 my $on = $var->{_on};
144 my $off = $var->{_off};
145 my $true = $var->{_true};
146 my $false = $var->{_false};
147 my $empty_string = $var->{_empty_string};
148  
149 =head2 Encapsulated
150 hash of private variables
151  
152 =cut
153  
154 my $suttoz = {
155 _dz => '',
156 _fz => '',
157 _nz => '',
158 _t => '',
159 _v => '',
160 _verbose => '',
161 _vfile => '',
162 _Step => '',
163 _note => '',
164  
165 };
166  
167 =head2 sub Step
168  
169 collects switches and assembles bash instructions
170 by adding the program name
171  
172 =cut
173  
174 sub Step {
175  
176 $suttoz->{_Step} = 'suttoz'.$suttoz->{_Step};
177 return ( $suttoz->{_Step} );
178  
179 }
180  
181  
182 =head2 sub note
183  
184 collects switches and assembles bash instructions
185 by adding the program name
186  
187 =cut
188  
189 sub note {
190  
191 $suttoz->{_note} = 'suttoz'.$suttoz->{_note};
192 return ( $suttoz->{_note} );
193  
194 }
195  
196  
197  
198 =head2 sub clear
199  
200 =cut
201  
202 sub clear {
203  
204 $suttoz->{_dz} = '';
205 $suttoz->{_fz} = '';
206 $suttoz->{_nz} = '';
207 $suttoz->{_t} = '';
208 $suttoz->{_v} = '';
209 $suttoz->{_verbose} = '';
210 $suttoz->{_vfile} = '';
211 $suttoz->{_Step} = '';
212 $suttoz->{_note} = '';
213 }
214  
215  
216 =head2 sub dz
217  
218  
219 =cut
220  
221 sub dz {
222  
223 my ( $self,$dz ) = @_;
224 if ( $dz ne $empty_string ) {
225  
226 $suttoz->{_dz} = $dz;
227 $suttoz->{_note} = $suttoz->{_note}.' dz='.$suttoz->{_dz};
228 $suttoz->{_Step} = $suttoz->{_Step}.' dz='.$suttoz->{_dz};
229  
230 } else {
231 print("suttoz, dz, missing dz,\n");
232 }
233 }
234  
235  
236 =head2 sub fz
237  
238  
239 =cut
240  
241 sub fz {
242  
243 my ( $self,$fz ) = @_;
244 if ( $fz ne $empty_string ) {
245  
246 $suttoz->{_fz} = $fz;
247 $suttoz->{_note} = $suttoz->{_note}.' fz='.$suttoz->{_fz};
248 $suttoz->{_Step} = $suttoz->{_Step}.' fz='.$suttoz->{_fz};
249  
250 } else {
251 print("suttoz, fz, missing fz,\n");
252 }
253 }
254  
255  
256 =head2 sub nz
257  
258  
259 =cut
260  
261 sub nz {
262  
263 my ( $self,$nz ) = @_;
264 if ( $nz ne $empty_string ) {
265  
266 $suttoz->{_nz} = $nz;
267 $suttoz->{_note} = $suttoz->{_note}.' nz='.$suttoz->{_nz};
268 $suttoz->{_Step} = $suttoz->{_Step}.' nz='.$suttoz->{_nz};
269  
270 } else {
271 print("suttoz, nz, missing nz,\n");
272 }
273 }
274  
275  
276 =head2 sub t
277  
278  
279 =cut
280  
281 sub t {
282  
283 my ( $self,$t ) = @_;
284 if ( $t ne $empty_string ) {
285  
286 $suttoz->{_t} = $t;
287 $suttoz->{_note} = $suttoz->{_note}.' t='.$suttoz->{_t};
288 $suttoz->{_Step} = $suttoz->{_Step}.' t='.$suttoz->{_t};
289  
290 } else {
291 print("suttoz, t, missing t,\n");
292 }
293 }
294  
295  
296 =head2 sub v
297  
298  
299 =cut
300  
301 sub v {
302  
303 my ( $self,$v ) = @_;
304 if ( $v ne $empty_string ) {
305  
306 $suttoz->{_v} = $v;
307 $suttoz->{_note} = $suttoz->{_note}.' v='.$suttoz->{_v};
308 $suttoz->{_Step} = $suttoz->{_Step}.' v='.$suttoz->{_v};
309  
310 } else {
311 print("suttoz, v, missing v,\n");
312 }
313 }
314  
315  
316 =head2 sub verbose
317  
318  
319 =cut
320  
321 sub verbose {
322  
323 my ( $self,$verbose ) = @_;
324 if ( $verbose ne $empty_string ) {
325  
326 $suttoz->{_verbose} = $verbose;
327 $suttoz->{_note} = $suttoz->{_note}.' verbose='.$suttoz->{_verbose};
328 $suttoz->{_Step} = $suttoz->{_Step}.' verbose='.$suttoz->{_verbose};
329  
330 } else {
331 print("suttoz, verbose, missing verbose,\n");
332 }
333 }
334  
335  
336 =head2 sub vfile
337  
338  
339 =cut
340  
341 sub vfile {
342  
343 my ( $self,$vfile ) = @_;
344 if ( $vfile ne $empty_string ) {
345  
346 $suttoz->{_vfile} = $vfile;
347 $suttoz->{_note} = $suttoz->{_note}.' vfile='.$suttoz->{_vfile};
348 $suttoz->{_Step} = $suttoz->{_Step}.' vfile='.$suttoz->{_vfile};
349  
350 } else {
351 print("suttoz, vfile, missing vfile,\n");
352 }
353 }
354  
355  
356 =head2 sub get_max_index
357  
358 max index = number of input variables -1
359
360 =cut
361
362 sub get_max_index {
363 my ($self) = @_;
364 my $max_index = 6;
365  
366 return($max_index);
367 }
368
369
370 1;