lib/App/SeismicUnixGui/sunix/model/sugoupillaud.pm untested

filter: Statementstmt 0.0% 0 / 69 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 9 totaltotal 0.0% 0 / 101 CC 6 SCAR 14.4
CC
6
Cov
0%
k
6.0
l
6.0
pV
6.0
CRAP 4.2
1 package App::SeismicUnixGui::sunix::model::sugoupillaud;
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 SUGOUPILLAUD - calculate 1D impulse response of
25  
26 non-absorbing Goupillaud medium
27  
28  
29  
30 sugoupillaud < stdin > stdout [optional parameters]
31  
32  
33  
34 Required parameters:
35  
36 none
37  
38  
39  
40 Optional parameters:
41  
42 l=1 source layer number; 1 <= l <= tr.ns
43  
44 Source is located at the top of layer l.
45  
46 k=1 receiver layer number; 1 <= k
47  
48 Receiver is located at the top of layer k.
49  
50 tmax number of output time-samples; default:
51  
52 tmax=NINT((2*tr.ns-(l-1)-(k-1))/2) if k < tr.ns
53  
54 tmax=k if k >=tr.ns
55  
56 pV=1 flag for vector field seismogram
57  
58 (displacement, velocity, acceleration);
59  
60 =-1 for pressure seismogram.
61  
62 verbose=0 silent operation, =1 list warnings
63  
64  
65  
66 Input: Reflection coefficient series:
67  
68  
69  
70 impedance[i]-impedance[i+1]
71  
72 r[i] = -----------------------------
73  
74 impedance[i]+impedance[i+1]
75  
76  
77  
78 r[0]= surface refl. coef. (as seen from above)
79  
80 r[n]= refl. coef. of the deepest interface
81  
82  
83  
84 Input file is to be in SU format, i.e., binary floats with a SU header.
85  
86  
87  
88 Remarks:
89  
90 1. For vector fields, a buried source produces a spike of amplitude 1
91  
92 propagating downwards and a spike of amplitude -1 propagating upwards.
93  
94 A buried pressure source produces spikes of amplitude 1 both in the up
95  
96 and downward directions.
97  
98  
99  
100 A surface source induces only a downgoing spike of amplitude 1 at the
101  
102 top of the first layer (both for vector and pressure fields).
103  
104 2. The sampling interval dt in the header of the input reflectivity file
105  
106 is interpreted as a two-way traveltime thicknes of the layers. The sampling
107  
108 interval of the output seismogram is the same as that of the input file.
109  
110  
111  
112
113  
114 Credits:
115  
116 CWP: Albena Mateeva, May 2000, a summer project at Western Geophysical
117  
118  
119  
120  
121  
122 ANOTATION used in the code comments [arises from the use of z-transforms]:
123  
124 Z-sampled: sampling interval equal to the TWO-way
125  
126 traveltime of the layers;
127  
128 z-sampled: sampling interval equal to the ONE-way
129  
130 traveltime of the layers;
131  
132  
133  
134 REFERENCES:
135  
136  
137  
138 1. Ganley, D. C., 1981, A method for calculating synthetic seismograms
139  
140 which include the effects of absorption and dispersion.
141  
142 Geophysics, Vol.46, No. 8, p. 1100-1107.
143  
144
145  
146 The burial of the source is based on the Appendix of that article.
147  
148  
149  
150 2. Robinson, E. A., Multichannel Time Series Analysis with Digital
151  
152 Computer Programs: 1983 Goose Pond Press, 2nd edition.
153  
154  
155  
156 The recursive polynomials Q, P used in this code are described
157  
158 in Chapter 3 of the book: Wave Propagation in Layered Media.
159  
160  
161  
162 My polynomial multiplication and division functions "prod" and
163  
164 "pratio" are based on Robinson's Fortran subroutines in Chapter 1.
165  
166  
167  
168 4. Clearbout, J. F., Fundamentals of Geophysical Data Processing with
169  
170 Applications to Petroleum Prospecting: 1985 Blackwell Scientific
171  
172 Publications.
173  
174  
175  
176 Chapter 8, Section 3: Introduces recursive polynomials F, G in a
177  
178 more intuitive way than Robinson.
179  
180
181  
182 The connection between the Robinson's P_k, Q_k and Clearbout's
183  
184 F_k, G_k is:
185  
186 P_k(Z) = F_k(Z)
187  
188 Q_k(Z) = - Z^(k) G_k(1/Z)
189  
190  
191  
192  
193  
194 =head2 User's notes (Juan Lorenzo)
195 untested
196  
197 =cut
198  
199  
200 =head2 CHANGES and their DATES
201  
202 =cut
203  
204 use Moose;
205 our $VERSION = '0.0.1';
206  
207  
208 =head2 Import packages
209  
210 =cut
211  
212 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
213  
214 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
215 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
216  
217  
218 =head2 instantiation of packages
219  
220 =cut
221  
222 my $get = L_SU_global_constants->new();
223 my $Project = Project_config->new();
224 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
225 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
226 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
227  
228 my $var = $get->var();
229 my $on = $var->{_on};
230 my $off = $var->{_off};
231 my $true = $var->{_true};
232 my $false = $var->{_false};
233 my $empty_string = $var->{_empty_string};
234  
235 =head2 Encapsulated
236 hash of private variables
237  
238 =cut
239  
240 my $sugoupillaud = {
241 _k => '',
242 _l => '',
243 _pV => '',
244 _tmax => '',
245 _verbose => '',
246 _Step => '',
247 _note => '',
248  
249 };
250  
251 =head2 sub Step
252  
253 collects switches and assembles bash instructions
254 by adding the program name
255  
256 =cut
257  
258 sub Step {
259  
260 $sugoupillaud->{_Step} = 'sugoupillaud'.$sugoupillaud->{_Step};
261 return ( $sugoupillaud->{_Step} );
262  
263 }
264  
265  
266 =head2 sub note
267  
268 collects switches and assembles bash instructions
269 by adding the program name
270  
271 =cut
272  
273 sub note {
274  
275 $sugoupillaud->{_note} = 'sugoupillaud'.$sugoupillaud->{_note};
276 return ( $sugoupillaud->{_note} );
277  
278 }
279  
280  
281  
282 =head2 sub clear
283  
284 =cut
285  
286 sub clear {
287  
288 $sugoupillaud->{_k} = '';
289 $sugoupillaud->{_l} = '';
290 $sugoupillaud->{_pV} = '';
291 $sugoupillaud->{_tmax} = '';
292 $sugoupillaud->{_verbose} = '';
293 $sugoupillaud->{_Step} = '';
294 $sugoupillaud->{_note} = '';
295 }
296  
297  
298 =head2 sub k
299  
300  
301 =cut
302  
303 sub k {
304  
305 my ( $self,$k ) = @_;
306 if ( $k ne $empty_string ) {
307  
308 $sugoupillaud->{_k} = $k;
309 $sugoupillaud->{_note} = $sugoupillaud->{_note}.' k='.$sugoupillaud->{_k};
310 $sugoupillaud->{_Step} = $sugoupillaud->{_Step}.' k='.$sugoupillaud->{_k};
311  
312 } else {
313 print("sugoupillaud, k, missing k,\n");
314 }
315 }
316  
317  
318 =head2 sub l
319  
320  
321 =cut
322  
323 sub l {
324  
325 my ( $self,$l ) = @_;
326 if ( $l ne $empty_string ) {
327  
328 $sugoupillaud->{_l} = $l;
329 $sugoupillaud->{_note} = $sugoupillaud->{_note}.' l='.$sugoupillaud->{_l};
330 $sugoupillaud->{_Step} = $sugoupillaud->{_Step}.' l='.$sugoupillaud->{_l};
331  
332 } else {
333 print("sugoupillaud, l, missing l,\n");
334 }
335 }
336  
337  
338 =head2 sub pV
339  
340  
341 =cut
342  
343 sub pV {
344  
345 my ( $self,$pV ) = @_;
346 if ( $pV ne $empty_string ) {
347  
348 $sugoupillaud->{_pV} = $pV;
349 $sugoupillaud->{_note} = $sugoupillaud->{_note}.' pV='.$sugoupillaud->{_pV};
350 $sugoupillaud->{_Step} = $sugoupillaud->{_Step}.' pV='.$sugoupillaud->{_pV};
351  
352 } else {
353 print("sugoupillaud, pV, missing pV,\n");
354 }
355 }
356  
357  
358 =head2 sub tmax
359  
360  
361 =cut
362  
363 sub tmax {
364  
365 my ( $self,$tmax ) = @_;
366 if ( $tmax ne $empty_string ) {
367  
368 $sugoupillaud->{_tmax} = $tmax;
369 $sugoupillaud->{_note} = $sugoupillaud->{_note}.' tmax='.$sugoupillaud->{_tmax};
370 $sugoupillaud->{_Step} = $sugoupillaud->{_Step}.' tmax='.$sugoupillaud->{_tmax};
371  
372 } else {
373 print("sugoupillaud, tmax, missing tmax,\n");
374 }
375 }
376  
377  
378 =head2 sub verbose
379  
380  
381 =cut
382  
383 sub verbose {
384  
385 my ( $self,$verbose ) = @_;
386 if ( $verbose ne $empty_string ) {
387  
388 $sugoupillaud->{_verbose} = $verbose;
389 $sugoupillaud->{_note} = $sugoupillaud->{_note}.' verbose='.$sugoupillaud->{_verbose};
390 $sugoupillaud->{_Step} = $sugoupillaud->{_Step}.' verbose='.$sugoupillaud->{_verbose};
391  
392 } else {
393 print("sugoupillaud, verbose, missing verbose,\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 = 4;
407  
408 return($max_index);
409 }
410
411
412 1;