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