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