lib/App/SeismicUnixGui/sunix/migration/sumigsplit.pm untested

filter: Statementstmt 0.0% 0 / 91 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 16 Podpod 0.0% 0 / 12 totaltotal 0.0% 0 / 135 CC 9 SCAR 15.4
CC
9
Cov
0%
dt
6.0
dx
6.0
dz
6.0
CRAP 4.7
1 package App::SeismicUnixGui::sunix::migration::sumigsplit;
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 SUMIGSPLIT - Split-step depth migration for zero-offset data.
25  
26  
27  
28 sumigsplit <infile >outfile vfile= [optional parameters]
29  
30  
31  
32 Required Parameters:
33  
34 nz= number of depth sapmles
35  
36 dz= depth sampling interval
37  
38 vfile= name of file containing velocities
39  
40  
41  
42 Optional Parameters:
43  
44 dt=from header(dt) or .004 time sampling interval
45  
46 dx=from header(d2) or 1.0 midpoint sampling interval
47  
48 ft=0.0 first time sample
49  
50 fz= first depth sample
51  
52  
53  
54 tmpdir= if non-empty, use the value as a directory path
55  
56 prefix for storing temporary files; else if the
57  
58 the CWP_TMPDIR environment variable is set use
59  
60 its value for the path; else use tmpfile()
61  
62  
63  
64  
65  
66 Notes:
67  
68 The input velocity file \'vfile\' consists of C-style binary floats.
69  
70 The structure of this file is vfile[iz][ix]. Note that this means that
71  
72 the x-direction is the fastest direction instead of z-direction! Such a
73  
74 structure is more convenient for the downward continuation type
75  
76 migration algorithm than using z as fastest dimension as in other SU
77  
78 programs.
79  
80  
81  
82 Because most of the tools in the SU package (such as unif2, unisam2,
83  
84 and makevel) produce output with the structure vfile[ix][iz], you will
85  
86 need to transpose the velocity files created by these programs. You may
87  
88 use the SU program \'transp\' in SU to transpose such files into the
89  
90 required vfile[iz][ix] structure.
91  
92 (In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
93  
94 denotes a v(z,x) array, the opposite of what Matlab and Fortran
95  
96 programmers may expect.) ",
97  
98  
99  
100
101  
102  
103  
104 Credits: CWP Baoniu Han, July 21th, 1997
105  
106  
107  
108 Reference:
109  
110 Stoffa, P. L. and Fokkema, J. T. and Freire, R. M. and Kessinger, W. P.,
111  
112 1990, Split-step Fourier migration, Geophysics, 55, 410-421.
113  
114  
115  
116  
117  
118 Trace header fields accessed: ns, dt, delrt, d2
119  
120 Trace header fields modified: ns, dt, delrt
121  
122  
123  
124  
125  
126 =head2 User's notes (Juan Lorenzo)
127 untested
128  
129 =cut
130  
131  
132 =head2 CHANGES and their DATES
133  
134 =cut
135  
136 use Moose;
137 our $VERSION = '0.0.1';
138  
139  
140 =head2 Import packages
141  
142 =cut
143  
144 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
145  
146 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
147 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
148  
149  
150 =head2 instantiation of packages
151  
152 =cut
153  
154 my $get = L_SU_global_constants->new();
155 my $Project = Project_config->new();
156 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
157 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
158 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
159  
160 my $PS_SEISMIC = $Project->PS_SEISMIC();
161  
162 my $var = $get->var();
163 my $on = $var->{_on};
164 my $off = $var->{_off};
165 my $true = $var->{_true};
166 my $false = $var->{_false};
167 my $empty_string = $var->{_empty_string};
168  
169 =head2 Encapsulated
170 hash of private variables
171  
172 =cut
173  
174 my $sumigsplit = {
175 _dt => '',
176 _dx => '',
177 _dz => '',
178 _ft => '',
179 _fz => '',
180 _nz => '',
181 _tmpdir => '',
182 _vfile => '',
183 _Step => '',
184 _note => '',
185  
186 };
187  
188 =head2 sub Step
189  
190 collects switches and assembles bash instructions
191 by adding the program name
192  
193 =cut
194  
195 sub Step {
196  
197 $sumigsplit->{_Step} = 'sumigsplit'.$sumigsplit->{_Step};
198 return ( $sumigsplit->{_Step} );
199  
200 }
201  
202  
203 =head2 sub note
204  
205 collects switches and assembles bash instructions
206 by adding the program name
207  
208 =cut
209  
210 sub note {
211  
212 $sumigsplit->{_note} = 'sumigsplit'.$sumigsplit->{_note};
213 return ( $sumigsplit->{_note} );
214  
215 }
216  
217  
218  
219 =head2 sub clear
220  
221 =cut
222  
223 sub clear {
224  
225 $sumigsplit->{_dt} = '';
226 $sumigsplit->{_dx} = '';
227 $sumigsplit->{_dz} = '';
228 $sumigsplit->{_ft} = '';
229 $sumigsplit->{_fz} = '';
230 $sumigsplit->{_nz} = '';
231 $sumigsplit->{_tmpdir} = '';
232 $sumigsplit->{_vfile} = '';
233 $sumigsplit->{_Step} = '';
234 $sumigsplit->{_note} = '';
235 }
236  
237  
238 =head2 sub dt
239  
240  
241 =cut
242  
243 sub dt {
244  
245 my ( $self,$dt ) = @_;
246 if ( $dt ne $empty_string ) {
247  
248 $sumigsplit->{_dt} = $dt;
249 $sumigsplit->{_note} = $sumigsplit->{_note}.' dt='.$sumigsplit->{_dt};
250 $sumigsplit->{_Step} = $sumigsplit->{_Step}.' dt='.$sumigsplit->{_dt};
251  
252 } else {
253 print("sumigsplit, dt, missing dt,\n");
254 }
255 }
256  
257  
258 =head2 sub dx
259  
260  
261 =cut
262  
263 sub dx {
264  
265 my ( $self,$dx ) = @_;
266 if ( $dx ne $empty_string ) {
267  
268 $sumigsplit->{_dx} = $dx;
269 $sumigsplit->{_note} = $sumigsplit->{_note}.' dx='.$sumigsplit->{_dx};
270 $sumigsplit->{_Step} = $sumigsplit->{_Step}.' dx='.$sumigsplit->{_dx};
271  
272 } else {
273 print("sumigsplit, dx, missing dx,\n");
274 }
275 }
276  
277  
278 =head2 sub dz
279  
280  
281 =cut
282  
283 sub dz {
284  
285 my ( $self,$dz ) = @_;
286 if ( $dz ne $empty_string ) {
287  
288 $sumigsplit->{_dz} = $dz;
289 $sumigsplit->{_note} = $sumigsplit->{_note}.' dz='.$sumigsplit->{_dz};
290 $sumigsplit->{_Step} = $sumigsplit->{_Step}.' dz='.$sumigsplit->{_dz};
291  
292 } else {
293 print("sumigsplit, dz, missing dz,\n");
294 }
295 }
296  
297  
298 =head2 sub ft
299  
300  
301 =cut
302  
303 sub ft {
304  
305 my ( $self,$ft ) = @_;
306 if ( $ft ne $empty_string ) {
307  
308 $sumigsplit->{_ft} = $ft;
309 $sumigsplit->{_note} = $sumigsplit->{_note}.' ft='.$sumigsplit->{_ft};
310 $sumigsplit->{_Step} = $sumigsplit->{_Step}.' ft='.$sumigsplit->{_ft};
311  
312 } else {
313 print("sumigsplit, ft, missing ft,\n");
314 }
315 }
316  
317  
318 =head2 sub fz
319  
320  
321 =cut
322  
323 sub fz {
324  
325 my ( $self,$fz ) = @_;
326 if ( $fz ne $empty_string ) {
327  
328 $sumigsplit->{_fz} = $fz;
329 $sumigsplit->{_note} = $sumigsplit->{_note}.' fz='.$sumigsplit->{_fz};
330 $sumigsplit->{_Step} = $sumigsplit->{_Step}.' fz='.$sumigsplit->{_fz};
331  
332 } else {
333 print("sumigsplit, fz, missing fz,\n");
334 }
335 }
336  
337  
338 =head2 sub nz
339  
340  
341 =cut
342  
343 sub nz {
344  
345 my ( $self,$nz ) = @_;
346 if ( $nz ne $empty_string ) {
347  
348 $sumigsplit->{_nz} = $nz;
349 $sumigsplit->{_note} = $sumigsplit->{_note}.' nz='.$sumigsplit->{_nz};
350 $sumigsplit->{_Step} = $sumigsplit->{_Step}.' nz='.$sumigsplit->{_nz};
351  
352 } else {
353 print("sumigsplit, nz, missing nz,\n");
354 }
355 }
356  
357  
358 =head2 sub tmpdir
359  
360  
361 =cut
362  
363 sub tmpdir {
364  
365 my ( $self,$tmpdir ) = @_;
366 if ( $tmpdir ne $empty_string ) {
367  
368 $sumigsplit->{_tmpdir} = $tmpdir;
369 $sumigsplit->{_note} = $sumigsplit->{_note}.' tmpdir='.$sumigsplit->{_tmpdir};
370 $sumigsplit->{_Step} = $sumigsplit->{_Step}.' tmpdir='.$sumigsplit->{_tmpdir};
371  
372 } else {
373 print("sumigsplit, tmpdir, missing tmpdir,\n");
374 }
375 }
376  
377  
378 =head2 sub vfile
379  
380  
381 =cut
382  
383 sub vfile {
384  
385 my ( $self,$vfile ) = @_;
386 if ( $vfile ne $empty_string ) {
387  
388 $sumigsplit->{_vfile} = $vfile;
389 $sumigsplit->{_note} = $sumigsplit->{_note}.' vfile='.$sumigsplit->{_vfile};
390 $sumigsplit->{_Step} = $sumigsplit->{_Step}.' vfile='.$sumigsplit->{_vfile};
391  
392 } else {
393 print("sumigsplit, vfile, missing vfile,\n");
394 }
395 }
396  
397  
398 =head2 sub get_max_index
399  
400 max index = number of input variables -1
401
402 =cut
403
404 sub get_max_index {
405 my ($self) = @_;
406 my $max_index = 7;
407  
408 return($max_index);
409 }
410
411
412 1;