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

filter: Statementstmt 0.0% 0 / 139 Branchbran 0.0% 0 / 30 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 23 Podpod 0.0% 0 / 19 totaltotal 0.0% 0 / 211 CC 16 SCAR 16.4
CC
16
Cov
0%
compon
6.0
dt
6.0
fpeak
6.0
CRAP 5.2
1 package App::SeismicUnixGui::sunix::model::elasyn;
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 ELASYN - SYNthetic seismograms for triangulated elastic media
25  
26  
27  
28 elasyn <rayends xg= zg= [optional parameters]
29  
30  
31  
32 Required Parameters:
33  
34 xg= x coordinates of receiver surface
35  
36 zg= z coordinates of receiver surface
37  
38  
39  
40 Optional Parameters:
41  
42 compon=0 horizontal and vertical component seismograms
43  
44 =3 vertical component (positive downwards)
45  
46 =1 horizontal component
47  
48 ng=101 number of receivers (uniform distributed along surface)
49  
50 krecord=1 integer index of receiver surface (see notes below)
51  
52 nt=251 number of time samples
53  
54 dt=0.004 time sampling interval
55  
56 ft=0.0 first time sample
57  
58 inter=0 linear interpolation
59  
60 inter=1 (default) cross parabolic interpolation
61  
62 reftrans=0 =1 complex refl/transm. coefficients considered
63  
64 nameref=-1 all rays recorded at interface <krecord> considered ",
65  
66 =0, only direct hits are considered
67  
68 >0, only rays reflected from interface <nameref>
69  
70 lscale= if defined restricts range of extrapolation
71  
72 fpeak=0.1/dt peak frequency of ricker wavelet
73  
74 infofile ASCII-file to store useful information
75  
76 xfile=x_compon.bin bin-file to store x_component traces
77  
78 zfile=z_compon.bin bin-file to store z_component traces
79  
80  
81  
82 NOTES:
83  
84 Only rays that terminate with index krecord will contribute to the
85  
86 synthetic seismograms at the receiver (xg,zg) locations. The
87  
88 receiver locations are determined by cubic spline interpolation
89  
90 of the specified (xg,zg) coordinates.
91  
92  
93  
94 Warning!!-- This version is not quite complete. There is a bug in the
95  
96 interpolation routines that causes a segmentation violation on the last
97  
98 couple of traces.
99  
100  
101  
102  
103  
104  
105  
106 AUTHORS: Andreas Rueger, Colorado School of Mines, 02/02/94
107  
108 Tariq Alkalifah, Colorado School of Mines, 02/02/94
109  
110 (interpolation routines)
111  
112
113  
114 The program is based on :
115  
116 gbbeam.c, Author: Andreas Rueger, 08/12/93
117  
118 sdbeam.c, AUTHOR Dave Hale, CSM, 02/26/91
119  
120  
121  
122  
123  
124 =head2 User's notes (Juan Lorenzo)
125 untested
126  
127 =cut
128  
129  
130 =head2 CHANGES and their DATES
131  
132 =cut
133  
134 use Moose;
135 our $VERSION = '0.0.1';
136  
137  
138 =head2 Import packages
139  
140 =cut
141  
142 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
143  
144 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
145 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
146  
147  
148 =head2 instantiation of packages
149  
150 =cut
151  
152 my $get = L_SU_global_constants->new();
153 my $Project = Project_config->new();
154 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
155 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
156 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
157  
158 my $var = $get->var();
159 my $on = $var->{_on};
160 my $off = $var->{_off};
161 my $true = $var->{_true};
162 my $false = $var->{_false};
163 my $empty_string = $var->{_empty_string};
164  
165 =head2 Encapsulated
166 hash of private variables
167  
168 =cut
169  
170 my $elasyn = {
171 _compon => '',
172 _dt => '',
173 _fpeak => '',
174 _ft => '',
175 _inter => '',
176 _krecord => '',
177 _lscale => '',
178 _nameref => '',
179 _ng => '',
180 _nt => '',
181 _reftrans => '',
182 _xfile => '',
183 _xg => '',
184 _zfile => '',
185 _zg => '',
186 _Step => '',
187 _note => '',
188  
189 };
190  
191 =head2 sub Step
192  
193 collects switches and assembles bash instructions
194 by adding the program name
195  
196 =cut
197  
198 sub Step {
199  
200 $elasyn->{_Step} = 'elasyn'.$elasyn->{_Step};
201 return ( $elasyn->{_Step} );
202  
203 }
204  
205  
206 =head2 sub note
207  
208 collects switches and assembles bash instructions
209 by adding the program name
210  
211 =cut
212  
213 sub note {
214  
215 $elasyn->{_note} = 'elasyn'.$elasyn->{_note};
216 return ( $elasyn->{_note} );
217  
218 }
219  
220  
221  
222 =head2 sub clear
223  
224 =cut
225  
226 sub clear {
227  
228 $elasyn->{_compon} = '';
229 $elasyn->{_dt} = '';
230 $elasyn->{_fpeak} = '';
231 $elasyn->{_ft} = '';
232 $elasyn->{_inter} = '';
233 $elasyn->{_krecord} = '';
234 $elasyn->{_lscale} = '';
235 $elasyn->{_nameref} = '';
236 $elasyn->{_ng} = '';
237 $elasyn->{_nt} = '';
238 $elasyn->{_reftrans} = '';
239 $elasyn->{_xfile} = '';
240 $elasyn->{_xg} = '';
241 $elasyn->{_zfile} = '';
242 $elasyn->{_zg} = '';
243 $elasyn->{_Step} = '';
244 $elasyn->{_note} = '';
245 }
246  
247  
248 =head2 sub compon
249  
250  
251 =cut
252  
253 sub compon {
254  
255 my ( $self,$compon ) = @_;
256 if ( $compon ne $empty_string ) {
257  
258 $elasyn->{_compon} = $compon;
259 $elasyn->{_note} = $elasyn->{_note}.' compon='.$elasyn->{_compon};
260 $elasyn->{_Step} = $elasyn->{_Step}.' compon='.$elasyn->{_compon};
261  
262 } else {
263 print("elasyn, compon, missing compon,\n");
264 }
265 }
266  
267  
268 =head2 sub dt
269  
270  
271 =cut
272  
273 sub dt {
274  
275 my ( $self,$dt ) = @_;
276 if ( $dt ne $empty_string ) {
277  
278 $elasyn->{_dt} = $dt;
279 $elasyn->{_note} = $elasyn->{_note}.' dt='.$elasyn->{_dt};
280 $elasyn->{_Step} = $elasyn->{_Step}.' dt='.$elasyn->{_dt};
281  
282 } else {
283 print("elasyn, dt, missing dt,\n");
284 }
285 }
286  
287  
288 =head2 sub fpeak
289  
290  
291 =cut
292  
293 sub fpeak {
294  
295 my ( $self,$fpeak ) = @_;
296 if ( $fpeak ne $empty_string ) {
297  
298 $elasyn->{_fpeak} = $fpeak;
299 $elasyn->{_note} = $elasyn->{_note}.' fpeak='.$elasyn->{_fpeak};
300 $elasyn->{_Step} = $elasyn->{_Step}.' fpeak='.$elasyn->{_fpeak};
301  
302 } else {
303 print("elasyn, fpeak, missing fpeak,\n");
304 }
305 }
306  
307  
308 =head2 sub ft
309  
310  
311 =cut
312  
313 sub ft {
314  
315 my ( $self,$ft ) = @_;
316 if ( $ft ne $empty_string ) {
317  
318 $elasyn->{_ft} = $ft;
319 $elasyn->{_note} = $elasyn->{_note}.' ft='.$elasyn->{_ft};
320 $elasyn->{_Step} = $elasyn->{_Step}.' ft='.$elasyn->{_ft};
321  
322 } else {
323 print("elasyn, ft, missing ft,\n");
324 }
325 }
326  
327  
328 =head2 sub inter
329  
330  
331 =cut
332  
333 sub inter {
334  
335 my ( $self,$inter ) = @_;
336 if ( $inter ne $empty_string ) {
337  
338 $elasyn->{_inter} = $inter;
339 $elasyn->{_note} = $elasyn->{_note}.' inter='.$elasyn->{_inter};
340 $elasyn->{_Step} = $elasyn->{_Step}.' inter='.$elasyn->{_inter};
341  
342 } else {
343 print("elasyn, inter, missing inter,\n");
344 }
345 }
346  
347  
348 =head2 sub krecord
349  
350  
351 =cut
352  
353 sub krecord {
354  
355 my ( $self,$krecord ) = @_;
356 if ( $krecord ne $empty_string ) {
357  
358 $elasyn->{_krecord} = $krecord;
359 $elasyn->{_note} = $elasyn->{_note}.' krecord='.$elasyn->{_krecord};
360 $elasyn->{_Step} = $elasyn->{_Step}.' krecord='.$elasyn->{_krecord};
361  
362 } else {
363 print("elasyn, krecord, missing krecord,\n");
364 }
365 }
366  
367  
368 =head2 sub lscale
369  
370  
371 =cut
372  
373 sub lscale {
374  
375 my ( $self,$lscale ) = @_;
376 if ( $lscale ne $empty_string ) {
377  
378 $elasyn->{_lscale} = $lscale;
379 $elasyn->{_note} = $elasyn->{_note}.' lscale='.$elasyn->{_lscale};
380 $elasyn->{_Step} = $elasyn->{_Step}.' lscale='.$elasyn->{_lscale};
381  
382 } else {
383 print("elasyn, lscale, missing lscale,\n");
384 }
385 }
386  
387  
388 =head2 sub nameref
389  
390  
391 =cut
392  
393 sub nameref {
394  
395 my ( $self,$nameref ) = @_;
396 if ( $nameref ne $empty_string ) {
397  
398 $elasyn->{_nameref} = $nameref;
399 $elasyn->{_note} = $elasyn->{_note}.' nameref='.$elasyn->{_nameref};
400 $elasyn->{_Step} = $elasyn->{_Step}.' nameref='.$elasyn->{_nameref};
401  
402 } else {
403 print("elasyn, nameref, missing nameref,\n");
404 }
405 }
406  
407  
408 =head2 sub ng
409  
410  
411 =cut
412  
413 sub ng {
414  
415 my ( $self,$ng ) = @_;
416 if ( $ng ne $empty_string ) {
417  
418 $elasyn->{_ng} = $ng;
419 $elasyn->{_note} = $elasyn->{_note}.' ng='.$elasyn->{_ng};
420 $elasyn->{_Step} = $elasyn->{_Step}.' ng='.$elasyn->{_ng};
421  
422 } else {
423 print("elasyn, ng, missing ng,\n");
424 }
425 }
426  
427  
428 =head2 sub nt
429  
430  
431 =cut
432  
433 sub nt {
434  
435 my ( $self,$nt ) = @_;
436 if ( $nt ne $empty_string ) {
437  
438 $elasyn->{_nt} = $nt;
439 $elasyn->{_note} = $elasyn->{_note}.' nt='.$elasyn->{_nt};
440 $elasyn->{_Step} = $elasyn->{_Step}.' nt='.$elasyn->{_nt};
441  
442 } else {
443 print("elasyn, nt, missing nt,\n");
444 }
445 }
446  
447  
448 =head2 sub reftrans
449  
450  
451 =cut
452  
453 sub reftrans {
454  
455 my ( $self,$reftrans ) = @_;
456 if ( $reftrans ne $empty_string ) {
457  
458 $elasyn->{_reftrans} = $reftrans;
459 $elasyn->{_note} = $elasyn->{_note}.' reftrans='.$elasyn->{_reftrans};
460 $elasyn->{_Step} = $elasyn->{_Step}.' reftrans='.$elasyn->{_reftrans};
461  
462 } else {
463 print("elasyn, reftrans, missing reftrans,\n");
464 }
465 }
466  
467  
468 =head2 sub xfile
469  
470  
471 =cut
472  
473 sub xfile {
474  
475 my ( $self,$xfile ) = @_;
476 if ( $xfile ne $empty_string ) {
477  
478 $elasyn->{_xfile} = $xfile;
479 $elasyn->{_note} = $elasyn->{_note}.' xfile='.$elasyn->{_xfile};
480 $elasyn->{_Step} = $elasyn->{_Step}.' xfile='.$elasyn->{_xfile};
481  
482 } else {
483 print("elasyn, xfile, missing xfile,\n");
484 }
485 }
486  
487  
488 =head2 sub xg
489  
490  
491 =cut
492  
493 sub xg {
494  
495 my ( $self,$xg ) = @_;
496 if ( $xg ne $empty_string ) {
497  
498 $elasyn->{_xg} = $xg;
499 $elasyn->{_note} = $elasyn->{_note}.' xg='.$elasyn->{_xg};
500 $elasyn->{_Step} = $elasyn->{_Step}.' xg='.$elasyn->{_xg};
501  
502 } else {
503 print("elasyn, xg, missing xg,\n");
504 }
505 }
506  
507  
508 =head2 sub zfile
509  
510  
511 =cut
512  
513 sub zfile {
514  
515 my ( $self,$zfile ) = @_;
516 if ( $zfile ne $empty_string ) {
517  
518 $elasyn->{_zfile} = $zfile;
519 $elasyn->{_note} = $elasyn->{_note}.' zfile='.$elasyn->{_zfile};
520 $elasyn->{_Step} = $elasyn->{_Step}.' zfile='.$elasyn->{_zfile};
521  
522 } else {
523 print("elasyn, zfile, missing zfile,\n");
524 }
525 }
526  
527  
528 =head2 sub zg
529  
530  
531 =cut
532  
533 sub zg {
534  
535 my ( $self,$zg ) = @_;
536 if ( $zg ne $empty_string ) {
537  
538 $elasyn->{_zg} = $zg;
539 $elasyn->{_note} = $elasyn->{_note}.' zg='.$elasyn->{_zg};
540 $elasyn->{_Step} = $elasyn->{_Step}.' zg='.$elasyn->{_zg};
541  
542 } else {
543 print("elasyn, zg, missing zg,\n");
544 }
545 }
546  
547  
548 =head2 sub get_max_index
549  
550 max index = number of input variables -1
551
552 =cut
553
554 sub get_max_index {
555 my ($self) = @_;
556 my $max_index = 14;
557  
558 return($max_index);
559 }
560
561
562 1;