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

filter: Statementstmt 0.0% 0 / 77 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 10 totaltotal 0.0% 0 / 113 CC 7 SCAR 14.8
CC
7
Cov
0%
dt
6.0
dx
6.0
dz
6.0
CRAP 4.4
1 package App::SeismicUnixGui::sunix::migration::sumigpspi;
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 SUMIGPSPI - Gazdag's phase-shift plus interpolation depth migration
25  
26 for zero-offset data, which can handle the lateral
27  
28 velocity variation.
29  
30  
31  
32 sumigpspi <infile >outfile vfile= [optional parameters]
33  
34
35  
36 Required Parameters:
37  
38 nz= number of depth sapmles
39  
40 dz= depth sampling interval
41  
42 vfile= name of file containing velocities
43  
44 (Please see Notes below concerning the format of vfile)
45  
46  
47  
48 Optional Parameters:
49  
50 dt=from header(dt) or .004 time sampling interval
51  
52 dx=from header(d2) or 1.0 midpoint sampling interval
53  
54  
55  
56 tmpdir= if non-empty, use the value as a directory path
57  
58 prefix for storing temporary files; else if the
59  
60 the CWP_TMPDIR environment variable is set use
61  
62 its value for the path; else use tmpfile()
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. (In C v[iz][ix] denotes a v(x,z) array, whereas v[ix][iz]
79  
80 denotes a v(z,x) array, the opposite of what Matlab and Fortran
81  
82 programmers may expect.)
83  
84  
85  
86 Because most of the tools in the SU package (such as unif2, unisam2,
87  
88 and makevel) produce output with the structure vfile[ix][iz], you will
89  
90 need to transpose the velocity files created by these programs. You may
91  
92 use the SU program 'transp' in SU to transpose such files into the
93  
94 required vfile[iz][ix] structure.
95  
96  
97  
98  
99  
100  
101  
102  
103  
104 Credits: CWP, Baoniu Han, April 20th, 1998
105  
106  
107  
108 Trace header fields accessed: ns, dt, delrt, d2
109  
110 Trace header fields modified: ns, dt, delrt
111  
112  
113  
114 =head2 User's notes (Juan Lorenzo)
115 untested
116  
117 =cut
118  
119  
120 =head2 CHANGES and their DATES
121  
122 =cut
123  
124 use Moose;
125 our $VERSION = '0.0.1';
126  
127  
128 =head2 Import packages
129  
130 =cut
131  
132 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
133  
134 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
135 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
136  
137  
138 =head2 instantiation of packages
139  
140 =cut
141  
142 my $get = L_SU_global_constants->new();
143 my $Project = Project_config->new();
144 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
145 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
146 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
147  
148 my $PS_SEISMIC = $Project->PS_SEISMIC();
149  
150 my $var = $get->var();
151 my $on = $var->{_on};
152 my $off = $var->{_off};
153 my $true = $var->{_true};
154 my $false = $var->{_false};
155 my $empty_string = $var->{_empty_string};
156  
157 =head2 Encapsulated
158 hash of private variables
159  
160 =cut
161  
162 my $sumigpspi = {
163 _dt => '',
164 _dx => '',
165 _dz => '',
166 _nz => '',
167 _tmpdir => '',
168 _vfile => '',
169 _Step => '',
170 _note => '',
171  
172 };
173  
174 =head2 sub Step
175  
176 collects switches and assembles bash instructions
177 by adding the program name
178  
179 =cut
180  
181 sub Step {
182  
183 $sumigpspi->{_Step} = 'sumigpspi'.$sumigpspi->{_Step};
184 return ( $sumigpspi->{_Step} );
185  
186 }
187  
188  
189 =head2 sub note
190  
191 collects switches and assembles bash instructions
192 by adding the program name
193  
194 =cut
195  
196 sub note {
197  
198 $sumigpspi->{_note} = 'sumigpspi'.$sumigpspi->{_note};
199 return ( $sumigpspi->{_note} );
200  
201 }
202  
203  
204  
205 =head2 sub clear
206  
207 =cut
208  
209 sub clear {
210  
211 $sumigpspi->{_dt} = '';
212 $sumigpspi->{_dx} = '';
213 $sumigpspi->{_dz} = '';
214 $sumigpspi->{_nz} = '';
215 $sumigpspi->{_tmpdir} = '';
216 $sumigpspi->{_vfile} = '';
217 $sumigpspi->{_Step} = '';
218 $sumigpspi->{_note} = '';
219 }
220  
221  
222 =head2 sub dt
223  
224  
225 =cut
226  
227 sub dt {
228  
229 my ( $self,$dt ) = @_;
230 if ( $dt ne $empty_string ) {
231  
232 $sumigpspi->{_dt} = $dt;
233 $sumigpspi->{_note} = $sumigpspi->{_note}.' dt='.$sumigpspi->{_dt};
234 $sumigpspi->{_Step} = $sumigpspi->{_Step}.' dt='.$sumigpspi->{_dt};
235  
236 } else {
237 print("sumigpspi, dt, missing dt,\n");
238 }
239 }
240  
241  
242 =head2 sub dx
243  
244  
245 =cut
246  
247 sub dx {
248  
249 my ( $self,$dx ) = @_;
250 if ( $dx ne $empty_string ) {
251  
252 $sumigpspi->{_dx} = $dx;
253 $sumigpspi->{_note} = $sumigpspi->{_note}.' dx='.$sumigpspi->{_dx};
254 $sumigpspi->{_Step} = $sumigpspi->{_Step}.' dx='.$sumigpspi->{_dx};
255  
256 } else {
257 print("sumigpspi, dx, missing dx,\n");
258 }
259 }
260  
261  
262 =head2 sub dz
263  
264  
265 =cut
266  
267 sub dz {
268  
269 my ( $self,$dz ) = @_;
270 if ( $dz ne $empty_string ) {
271  
272 $sumigpspi->{_dz} = $dz;
273 $sumigpspi->{_note} = $sumigpspi->{_note}.' dz='.$sumigpspi->{_dz};
274 $sumigpspi->{_Step} = $sumigpspi->{_Step}.' dz='.$sumigpspi->{_dz};
275  
276 } else {
277 print("sumigpspi, dz, missing dz,\n");
278 }
279 }
280  
281  
282 =head2 sub nz
283  
284  
285 =cut
286  
287 sub nz {
288  
289 my ( $self,$nz ) = @_;
290 if ( $nz ne $empty_string ) {
291  
292 $sumigpspi->{_nz} = $nz;
293 $sumigpspi->{_note} = $sumigpspi->{_note}.' nz='.$sumigpspi->{_nz};
294 $sumigpspi->{_Step} = $sumigpspi->{_Step}.' nz='.$sumigpspi->{_nz};
295  
296 } else {
297 print("sumigpspi, nz, missing nz,\n");
298 }
299 }
300  
301  
302 =head2 sub tmpdir
303  
304  
305 =cut
306  
307 sub tmpdir {
308  
309 my ( $self,$tmpdir ) = @_;
310 if ( $tmpdir ne $empty_string ) {
311  
312 $sumigpspi->{_tmpdir} = $tmpdir;
313 $sumigpspi->{_note} = $sumigpspi->{_note}.' tmpdir='.$sumigpspi->{_tmpdir};
314 $sumigpspi->{_Step} = $sumigpspi->{_Step}.' tmpdir='.$sumigpspi->{_tmpdir};
315  
316 } else {
317 print("sumigpspi, tmpdir, missing tmpdir,\n");
318 }
319 }
320  
321  
322 =head2 sub vfile
323  
324  
325 =cut
326  
327 sub vfile {
328  
329 my ( $self,$vfile ) = @_;
330 if ( $vfile ne $empty_string ) {
331  
332 $sumigpspi->{_vfile} = $vfile;
333 $sumigpspi->{_note} = $sumigpspi->{_note}.' vfile='.$sumigpspi->{_vfile};
334 $sumigpspi->{_Step} = $sumigpspi->{_Step}.' vfile='.$sumigpspi->{_vfile};
335  
336 } else {
337 print("sumigpspi, vfile, missing vfile,\n");
338 }
339 }
340  
341  
342 =head2 sub get_max_index
343  
344 max index = number of input variables -1
345
346 =cut
347
348 sub get_max_index {
349 my ($self) = @_;
350 my $max_index = 5;
351  
352 return($max_index);
353 }
354
355
356 1;