lib/App/SeismicUnixGui/sunix/model/sugoupillaudpo.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::sugoupillaudpo;
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 SUGOUPILLAUDPO - calculate Primaries-Only impulse response of a lossless
25  
26 GOUPILLAUD medium for plane waves at normal incidence
27  
28  
29  
30 sugoupillaudpo < 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;
51  
52 default: long enough to capture all primaries
53  
54 pV=1 flag for vector field seismogram
55  
56 (displacement, velocity, acceleration);
57  
58 =-1 for pressure seismogram.
59  
60 verbose=0 silent operation, =1 list warnings
61  
62  
63  
64 Input: Reflection coefficient series:
65  
66  
67  
68 impedance[i]-impedance[i+1]
69  
70 r[i] = -----------------------------
71  
72 impedance[i]+impedance[i+1]
73  
74  
75  
76 r[0]= surface refl. coef. (as seen from above)
77  
78 r[n]= refl. coef. of the deepest interface
79  
80  
81  
82 Input file is to be in SU format, i.e., binary floats with a SU header.
83  
84  
85  
86 Remarks:
87  
88 1. For vector fields, a buried source produces a spike of amplitude 1
89  
90 propagating downwards and a spike of amplitude -1 propagating upwards.
91  
92 A buried pressure source produces spikes of amplitude 1 both in the up-
93  
94 and downward directions.
95  
96 A surface source induces only a downgoing spike of amplitude 1 at the
97  
98 top of the first layer (both for vector and pressure fields).
99  
100 2. The sampling interval dt in the header of the input reflectivity file
101  
102 is interpreted as a two-way traveltime thicknes of the layers. The sampling
103  
104 interval of the output seismogram is the same as that of the input file.
105  
106  
107  
108
109  
110 Credits:
111  
112 CWP: Albena Mateeva, April 2001.
113  
114  
115  
116  
117  
118  
119  
120 =head2 User's notes (Juan Lorenzo)
121 untested
122  
123 =cut
124  
125  
126 =head2 CHANGES and their DATES
127  
128 =cut
129  
130 use Moose;
131 our $VERSION = '0.0.1';
132  
133  
134 =head2 Import packages
135  
136 =cut
137  
138 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
139  
140 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
141 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
142  
143  
144 =head2 instantiation of packages
145  
146 =cut
147  
148 my $get = L_SU_global_constants->new();
149 my $Project = Project_config->new();
150 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
151 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
152 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
153  
154 my $var = $get->var();
155 my $on = $var->{_on};
156 my $off = $var->{_off};
157 my $true = $var->{_true};
158 my $false = $var->{_false};
159 my $empty_string = $var->{_empty_string};
160  
161 =head2 Encapsulated
162 hash of private variables
163  
164 =cut
165  
166 my $sugoupillaudpo = {
167 _k => '',
168 _l => '',
169 _pV => '',
170 _tmax => '',
171 _verbose => '',
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 $sugoupillaudpo->{_Step} = 'sugoupillaudpo'.$sugoupillaudpo->{_Step};
187 return ( $sugoupillaudpo->{_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 $sugoupillaudpo->{_note} = 'sugoupillaudpo'.$sugoupillaudpo->{_note};
202 return ( $sugoupillaudpo->{_note} );
203  
204 }
205  
206  
207  
208 =head2 sub clear
209  
210 =cut
211  
212 sub clear {
213  
214 $sugoupillaudpo->{_k} = '';
215 $sugoupillaudpo->{_l} = '';
216 $sugoupillaudpo->{_pV} = '';
217 $sugoupillaudpo->{_tmax} = '';
218 $sugoupillaudpo->{_verbose} = '';
219 $sugoupillaudpo->{_Step} = '';
220 $sugoupillaudpo->{_note} = '';
221 }
222  
223  
224 =head2 sub k
225  
226  
227 =cut
228  
229 sub k {
230  
231 my ( $self,$k ) = @_;
232 if ( $k ne $empty_string ) {
233  
234 $sugoupillaudpo->{_k} = $k;
235 $sugoupillaudpo->{_note} = $sugoupillaudpo->{_note}.' k='.$sugoupillaudpo->{_k};
236 $sugoupillaudpo->{_Step} = $sugoupillaudpo->{_Step}.' k='.$sugoupillaudpo->{_k};
237  
238 } else {
239 print("sugoupillaudpo, k, missing k,\n");
240 }
241 }
242  
243  
244 =head2 sub l
245  
246  
247 =cut
248  
249 sub l {
250  
251 my ( $self,$l ) = @_;
252 if ( $l ne $empty_string ) {
253  
254 $sugoupillaudpo->{_l} = $l;
255 $sugoupillaudpo->{_note} = $sugoupillaudpo->{_note}.' l='.$sugoupillaudpo->{_l};
256 $sugoupillaudpo->{_Step} = $sugoupillaudpo->{_Step}.' l='.$sugoupillaudpo->{_l};
257  
258 } else {
259 print("sugoupillaudpo, l, missing l,\n");
260 }
261 }
262  
263  
264 =head2 sub pV
265  
266  
267 =cut
268  
269 sub pV {
270  
271 my ( $self,$pV ) = @_;
272 if ( $pV ne $empty_string ) {
273  
274 $sugoupillaudpo->{_pV} = $pV;
275 $sugoupillaudpo->{_note} = $sugoupillaudpo->{_note}.' pV='.$sugoupillaudpo->{_pV};
276 $sugoupillaudpo->{_Step} = $sugoupillaudpo->{_Step}.' pV='.$sugoupillaudpo->{_pV};
277  
278 } else {
279 print("sugoupillaudpo, pV, missing pV,\n");
280 }
281 }
282  
283  
284 =head2 sub tmax
285  
286  
287 =cut
288  
289 sub tmax {
290  
291 my ( $self,$tmax ) = @_;
292 if ( $tmax ne $empty_string ) {
293  
294 $sugoupillaudpo->{_tmax} = $tmax;
295 $sugoupillaudpo->{_note} = $sugoupillaudpo->{_note}.' tmax='.$sugoupillaudpo->{_tmax};
296 $sugoupillaudpo->{_Step} = $sugoupillaudpo->{_Step}.' tmax='.$sugoupillaudpo->{_tmax};
297  
298 } else {
299 print("sugoupillaudpo, tmax, missing tmax,\n");
300 }
301 }
302  
303  
304 =head2 sub verbose
305  
306  
307 =cut
308  
309 sub verbose {
310  
311 my ( $self,$verbose ) = @_;
312 if ( $verbose ne $empty_string ) {
313  
314 $sugoupillaudpo->{_verbose} = $verbose;
315 $sugoupillaudpo->{_note} = $sugoupillaudpo->{_note}.' verbose='.$sugoupillaudpo->{_verbose};
316 $sugoupillaudpo->{_Step} = $sugoupillaudpo->{_Step}.' verbose='.$sugoupillaudpo->{_verbose};
317  
318 } else {
319 print("sugoupillaudpo, verbose, missing verbose,\n");
320 }
321 }
322  
323  
324 =head2 sub get_max_index
325  
326 max index = number of input variables -1
327
328 =cut
329
330 sub get_max_index {
331 my ($self) = @_;
332 my $max_index = 4;
333  
334 return($max_index);
335 }
336
337
338 1;