lib/App/SeismicUnixGui/sunix/model/elatriuni.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%
a1111file
6.0
a1113file
6.0
a1133file
6.0
CRAP 5.2
1 package App::SeismicUnixGui::sunix::model::elatriuni;
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 ELATRIUNI - convert TRIangulated ELAstic models to UNIformly sampled models
25  
26  
27  
28 elatriuni <modelfile nx= nz= [optional parameters]
29  
30  
31  
32 Required Parameters:
33  
34 nx number of x samples
35  
36 nz number of z samples
37  
38  
39  
40 Optional Parameters:
41  
42 dx=1.0 x sampling interval
43  
44 dz=1.0 z sampling interval
45  
46 fx=0.0 first x sampled
47  
48 fz=0.0 first z sampled
49  
50 a1111file=a1111.bin bin-file to store a1111 components
51  
52 a3333file=a3333.bin bin-file to store a3333 components
53  
54 a1133file=a1133.bin bin-file to store a1133 components
55  
56 a1313file=a1313.bin bin-file to store a1313 components
57  
58 a1113file=a1113.bin bin-file to store a1113 components
59  
60 a3313file=a3313.bin bin-file to store a3313 components
61  
62 a1212file=a1212.bin bin-file to store a1212 components
63  
64 a1223file=a1212.bin bin-file to store a1223 components
65  
66 a2323file=a2323.bin bin-file to store a2323 components
67  
68 rhofile=rho.bin bin-file to store rho components
69  
70  
71  
72  
73  
74  
75  
76 AUTHORS: Andreas Rueger, Colorado School of Mines, 01/02/95
77  
78 Dave Hale, Colorado School of Mines, 04/23/91
79  
80
81  
82  
83  
84  
85  
86 =head2 User's notes (Juan Lorenzo)
87 untested
88  
89 =cut
90  
91  
92 =head2 CHANGES and their DATES
93  
94 =cut
95  
96 use Moose;
97 our $VERSION = '0.0.1';
98  
99  
100 =head2 Import packages
101  
102 =cut
103  
104 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
105  
106 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
107 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
108  
109  
110 =head2 instantiation of packages
111  
112 =cut
113  
114 my $get = L_SU_global_constants->new();
115 my $Project = Project_config->new();
116 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
117 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
118 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
119  
120 my $var = $get->var();
121 my $on = $var->{_on};
122 my $off = $var->{_off};
123 my $true = $var->{_true};
124 my $false = $var->{_false};
125 my $empty_string = $var->{_empty_string};
126  
127 =head2 Encapsulated
128 hash of private variables
129  
130 =cut
131  
132 my $elatriuni = {
133 _a1111file => '',
134 _a1113file => '',
135 _a1133file => '',
136 _a1212file => '',
137 _a1223file => '',
138 _a1313file => '',
139 _a2323file => '',
140 _a3313file => '',
141 _a3333file => '',
142 _dx => '',
143 _dz => '',
144 _fx => '',
145 _fz => '',
146 _nx => '',
147 _rhofile => '',
148 _Step => '',
149 _note => '',
150  
151 };
152  
153 =head2 sub Step
154  
155 collects switches and assembles bash instructions
156 by adding the program name
157  
158 =cut
159  
160 sub Step {
161  
162 $elatriuni->{_Step} = 'elatriuni'.$elatriuni->{_Step};
163 return ( $elatriuni->{_Step} );
164  
165 }
166  
167  
168 =head2 sub note
169  
170 collects switches and assembles bash instructions
171 by adding the program name
172  
173 =cut
174  
175 sub note {
176  
177 $elatriuni->{_note} = 'elatriuni'.$elatriuni->{_note};
178 return ( $elatriuni->{_note} );
179  
180 }
181  
182  
183  
184 =head2 sub clear
185  
186 =cut
187  
188 sub clear {
189  
190 $elatriuni->{_a1111file} = '';
191 $elatriuni->{_a1113file} = '';
192 $elatriuni->{_a1133file} = '';
193 $elatriuni->{_a1212file} = '';
194 $elatriuni->{_a1223file} = '';
195 $elatriuni->{_a1313file} = '';
196 $elatriuni->{_a2323file} = '';
197 $elatriuni->{_a3313file} = '';
198 $elatriuni->{_a3333file} = '';
199 $elatriuni->{_dx} = '';
200 $elatriuni->{_dz} = '';
201 $elatriuni->{_fx} = '';
202 $elatriuni->{_fz} = '';
203 $elatriuni->{_nx} = '';
204 $elatriuni->{_rhofile} = '';
205 $elatriuni->{_Step} = '';
206 $elatriuni->{_note} = '';
207 }
208  
209  
210 =head2 sub a1111file
211  
212  
213 =cut
214  
215 sub a1111file {
216  
217 my ( $self,$a1111file ) = @_;
218 if ( $a1111file ne $empty_string ) {
219  
220 $elatriuni->{_a1111file} = $a1111file;
221 $elatriuni->{_note} = $elatriuni->{_note}.' a1111file='.$elatriuni->{_a1111file};
222 $elatriuni->{_Step} = $elatriuni->{_Step}.' a1111file='.$elatriuni->{_a1111file};
223  
224 } else {
225 print("elatriuni, a1111file, missing a1111file,\n");
226 }
227 }
228  
229  
230 =head2 sub a1113file
231  
232  
233 =cut
234  
235 sub a1113file {
236  
237 my ( $self,$a1113file ) = @_;
238 if ( $a1113file ne $empty_string ) {
239  
240 $elatriuni->{_a1113file} = $a1113file;
241 $elatriuni->{_note} = $elatriuni->{_note}.' a1113file='.$elatriuni->{_a1113file};
242 $elatriuni->{_Step} = $elatriuni->{_Step}.' a1113file='.$elatriuni->{_a1113file};
243  
244 } else {
245 print("elatriuni, a1113file, missing a1113file,\n");
246 }
247 }
248  
249  
250 =head2 sub a1133file
251  
252  
253 =cut
254  
255 sub a1133file {
256  
257 my ( $self,$a1133file ) = @_;
258 if ( $a1133file ne $empty_string ) {
259  
260 $elatriuni->{_a1133file} = $a1133file;
261 $elatriuni->{_note} = $elatriuni->{_note}.' a1133file='.$elatriuni->{_a1133file};
262 $elatriuni->{_Step} = $elatriuni->{_Step}.' a1133file='.$elatriuni->{_a1133file};
263  
264 } else {
265 print("elatriuni, a1133file, missing a1133file,\n");
266 }
267 }
268  
269  
270 =head2 sub a1212file
271  
272  
273 =cut
274  
275 sub a1212file {
276  
277 my ( $self,$a1212file ) = @_;
278 if ( $a1212file ne $empty_string ) {
279  
280 $elatriuni->{_a1212file} = $a1212file;
281 $elatriuni->{_note} = $elatriuni->{_note}.' a1212file='.$elatriuni->{_a1212file};
282 $elatriuni->{_Step} = $elatriuni->{_Step}.' a1212file='.$elatriuni->{_a1212file};
283  
284 } else {
285 print("elatriuni, a1212file, missing a1212file,\n");
286 }
287 }
288  
289  
290 =head2 sub a1223file
291  
292  
293 =cut
294  
295 sub a1223file {
296  
297 my ( $self,$a1223file ) = @_;
298 if ( $a1223file ne $empty_string ) {
299  
300 $elatriuni->{_a1223file} = $a1223file;
301 $elatriuni->{_note} = $elatriuni->{_note}.' a1223file='.$elatriuni->{_a1223file};
302 $elatriuni->{_Step} = $elatriuni->{_Step}.' a1223file='.$elatriuni->{_a1223file};
303  
304 } else {
305 print("elatriuni, a1223file, missing a1223file,\n");
306 }
307 }
308  
309  
310 =head2 sub a1313file
311  
312  
313 =cut
314  
315 sub a1313file {
316  
317 my ( $self,$a1313file ) = @_;
318 if ( $a1313file ne $empty_string ) {
319  
320 $elatriuni->{_a1313file} = $a1313file;
321 $elatriuni->{_note} = $elatriuni->{_note}.' a1313file='.$elatriuni->{_a1313file};
322 $elatriuni->{_Step} = $elatriuni->{_Step}.' a1313file='.$elatriuni->{_a1313file};
323  
324 } else {
325 print("elatriuni, a1313file, missing a1313file,\n");
326 }
327 }
328  
329  
330 =head2 sub a2323file
331  
332  
333 =cut
334  
335 sub a2323file {
336  
337 my ( $self,$a2323file ) = @_;
338 if ( $a2323file ne $empty_string ) {
339  
340 $elatriuni->{_a2323file} = $a2323file;
341 $elatriuni->{_note} = $elatriuni->{_note}.' a2323file='.$elatriuni->{_a2323file};
342 $elatriuni->{_Step} = $elatriuni->{_Step}.' a2323file='.$elatriuni->{_a2323file};
343  
344 } else {
345 print("elatriuni, a2323file, missing a2323file,\n");
346 }
347 }
348  
349  
350 =head2 sub a3313file
351  
352  
353 =cut
354  
355 sub a3313file {
356  
357 my ( $self,$a3313file ) = @_;
358 if ( $a3313file ne $empty_string ) {
359  
360 $elatriuni->{_a3313file} = $a3313file;
361 $elatriuni->{_note} = $elatriuni->{_note}.' a3313file='.$elatriuni->{_a3313file};
362 $elatriuni->{_Step} = $elatriuni->{_Step}.' a3313file='.$elatriuni->{_a3313file};
363  
364 } else {
365 print("elatriuni, a3313file, missing a3313file,\n");
366 }
367 }
368  
369  
370 =head2 sub a3333file
371  
372  
373 =cut
374  
375 sub a3333file {
376  
377 my ( $self,$a3333file ) = @_;
378 if ( $a3333file ne $empty_string ) {
379  
380 $elatriuni->{_a3333file} = $a3333file;
381 $elatriuni->{_note} = $elatriuni->{_note}.' a3333file='.$elatriuni->{_a3333file};
382 $elatriuni->{_Step} = $elatriuni->{_Step}.' a3333file='.$elatriuni->{_a3333file};
383  
384 } else {
385 print("elatriuni, a3333file, missing a3333file,\n");
386 }
387 }
388  
389  
390 =head2 sub dx
391  
392  
393 =cut
394  
395 sub dx {
396  
397 my ( $self,$dx ) = @_;
398 if ( $dx ne $empty_string ) {
399  
400 $elatriuni->{_dx} = $dx;
401 $elatriuni->{_note} = $elatriuni->{_note}.' dx='.$elatriuni->{_dx};
402 $elatriuni->{_Step} = $elatriuni->{_Step}.' dx='.$elatriuni->{_dx};
403  
404 } else {
405 print("elatriuni, dx, missing dx,\n");
406 }
407 }
408  
409  
410 =head2 sub dz
411  
412  
413 =cut
414  
415 sub dz {
416  
417 my ( $self,$dz ) = @_;
418 if ( $dz ne $empty_string ) {
419  
420 $elatriuni->{_dz} = $dz;
421 $elatriuni->{_note} = $elatriuni->{_note}.' dz='.$elatriuni->{_dz};
422 $elatriuni->{_Step} = $elatriuni->{_Step}.' dz='.$elatriuni->{_dz};
423  
424 } else {
425 print("elatriuni, dz, missing dz,\n");
426 }
427 }
428  
429  
430 =head2 sub fx
431  
432  
433 =cut
434  
435 sub fx {
436  
437 my ( $self,$fx ) = @_;
438 if ( $fx ne $empty_string ) {
439  
440 $elatriuni->{_fx} = $fx;
441 $elatriuni->{_note} = $elatriuni->{_note}.' fx='.$elatriuni->{_fx};
442 $elatriuni->{_Step} = $elatriuni->{_Step}.' fx='.$elatriuni->{_fx};
443  
444 } else {
445 print("elatriuni, fx, missing fx,\n");
446 }
447 }
448  
449  
450 =head2 sub fz
451  
452  
453 =cut
454  
455 sub fz {
456  
457 my ( $self,$fz ) = @_;
458 if ( $fz ne $empty_string ) {
459  
460 $elatriuni->{_fz} = $fz;
461 $elatriuni->{_note} = $elatriuni->{_note}.' fz='.$elatriuni->{_fz};
462 $elatriuni->{_Step} = $elatriuni->{_Step}.' fz='.$elatriuni->{_fz};
463  
464 } else {
465 print("elatriuni, fz, missing fz,\n");
466 }
467 }
468  
469  
470 =head2 sub nx
471  
472  
473 =cut
474  
475 sub nx {
476  
477 my ( $self,$nx ) = @_;
478 if ( $nx ne $empty_string ) {
479  
480 $elatriuni->{_nx} = $nx;
481 $elatriuni->{_note} = $elatriuni->{_note}.' nx='.$elatriuni->{_nx};
482 $elatriuni->{_Step} = $elatriuni->{_Step}.' nx='.$elatriuni->{_nx};
483  
484 } else {
485 print("elatriuni, nx, missing nx,\n");
486 }
487 }
488  
489  
490 =head2 sub rhofile
491  
492  
493 =cut
494  
495 sub rhofile {
496  
497 my ( $self,$rhofile ) = @_;
498 if ( $rhofile ne $empty_string ) {
499  
500 $elatriuni->{_rhofile} = $rhofile;
501 $elatriuni->{_note} = $elatriuni->{_note}.' rhofile='.$elatriuni->{_rhofile};
502 $elatriuni->{_Step} = $elatriuni->{_Step}.' rhofile='.$elatriuni->{_rhofile};
503  
504 } else {
505 print("elatriuni, rhofile, missing rhofile,\n");
506 }
507 }
508  
509  
510 =head2 sub get_max_index
511  
512 max index = number of input variables -1
513
514 =cut
515
516 sub get_max_index {
517 my ($self) = @_;
518 my $max_index = 15;
519  
520 return($max_index);
521 }
522
523
524 1;