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

filter: Statementstmt 0.0% 0 / 55 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 79 CC 4 SCAR 13.1
CC
4
Cov
0%
dt
6.0
nt
6.0
ntr
6.0
CRAP 3.7
1 package App::SeismicUnixGui::sunix::model::sunull;
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 SUNULL - create null (all zeroes) traces
25  
26  
27  
28 sunull nt= [optional parameters] >outdata
29  
30  
31  
32 Required parameter
33  
34 nt= number of samples per trace
35  
36  
37  
38 Optional parameters
39  
40 ntr=5 number of null traces to create
41  
42 dt=0.004 time sampling interval
43  
44  
45  
46 Rationale: It is sometimes useful to insert null traces
47  
48 between "panels" in a shell loop.
49  
50  
51  
52 See also: sukill, sumute, suzero
53  
54  
55  
56  
57  
58 Credits:
59  
60 CWP: Jack K. Cohen
61  
62  
63  
64 Trace header fields set: ns, dt, tracl
65  
66  
67  
68 =head2 User's notes (Juan Lorenzo)
69 untested
70  
71 =cut
72  
73  
74 =head2 CHANGES and their DATES
75  
76 =cut
77  
78 use Moose;
79 our $VERSION = '0.0.1';
80  
81  
82 =head2 Import packages
83  
84 =cut
85  
86 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
87  
88 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
89 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
90  
91  
92 =head2 instantiation of packages
93  
94 =cut
95  
96 my $get = L_SU_global_constants->new();
97 my $Project = Project_config->new();
98 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
99 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
100 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
101  
102 my $var = $get->var();
103 my $on = $var->{_on};
104 my $off = $var->{_off};
105 my $true = $var->{_true};
106 my $false = $var->{_false};
107 my $empty_string = $var->{_empty_string};
108  
109 =head2 Encapsulated
110 hash of private variables
111  
112 =cut
113  
114 my $sunull = {
115 _dt => '',
116 _nt => '',
117 _ntr => '',
118 _Step => '',
119 _note => '',
120  
121 };
122  
123 =head2 sub Step
124  
125 collects switches and assembles bash instructions
126 by adding the program name
127  
128 =cut
129  
130 sub Step {
131  
132 $sunull->{_Step} = 'sunull'.$sunull->{_Step};
133 return ( $sunull->{_Step} );
134  
135 }
136  
137  
138 =head2 sub note
139  
140 collects switches and assembles bash instructions
141 by adding the program name
142  
143 =cut
144  
145 sub note {
146  
147 $sunull->{_note} = 'sunull'.$sunull->{_note};
148 return ( $sunull->{_note} );
149  
150 }
151  
152  
153  
154 =head2 sub clear
155  
156 =cut
157  
158 sub clear {
159  
160 $sunull->{_dt} = '';
161 $sunull->{_nt} = '';
162 $sunull->{_ntr} = '';
163 $sunull->{_Step} = '';
164 $sunull->{_note} = '';
165 }
166  
167  
168 =head2 sub dt
169  
170  
171 =cut
172  
173 sub dt {
174  
175 my ( $self,$dt ) = @_;
176 if ( $dt ne $empty_string ) {
177  
178 $sunull->{_dt} = $dt;
179 $sunull->{_note} = $sunull->{_note}.' dt='.$sunull->{_dt};
180 $sunull->{_Step} = $sunull->{_Step}.' dt='.$sunull->{_dt};
181  
182 } else {
183 print("sunull, dt, missing dt,\n");
184 }
185 }
186  
187  
188 =head2 sub nt
189  
190  
191 =cut
192  
193 sub nt {
194  
195 my ( $self,$nt ) = @_;
196 if ( $nt ne $empty_string ) {
197  
198 $sunull->{_nt} = $nt;
199 $sunull->{_note} = $sunull->{_note}.' nt='.$sunull->{_nt};
200 $sunull->{_Step} = $sunull->{_Step}.' nt='.$sunull->{_nt};
201  
202 } else {
203 print("sunull, nt, missing nt,\n");
204 }
205 }
206  
207  
208 =head2 sub ntr
209  
210  
211 =cut
212  
213 sub ntr {
214  
215 my ( $self,$ntr ) = @_;
216 if ( $ntr ne $empty_string ) {
217  
218 $sunull->{_ntr} = $ntr;
219 $sunull->{_note} = $sunull->{_note}.' ntr='.$sunull->{_ntr};
220 $sunull->{_Step} = $sunull->{_Step}.' ntr='.$sunull->{_ntr};
221  
222 } else {
223 print("sunull, ntr, missing ntr,\n");
224 }
225 }
226  
227  
228 =head2 sub get_max_index
229  
230 max index = number of input variables -1
231
232 =cut
233
234 sub get_max_index {
235 my ($self) = @_;
236 my $max_index = 2;
237  
238 return($max_index);
239 }
240
241
242 1;