lib/App/SeismicUnixGui/sunix/data/wtcomp.pm untested

filter: Statementstmt 0.0% 0 / 76 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 10 totaltotal 0.0% 0 / 112 CC 7 SCAR 14.8
CC
7
Cov
0%
error
6.0
n1
6.0
n2
6.0
CRAP 4.4
1 package App::SeismicUnixGui::sunix::data::wtcomp;
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 WTCOMP - Compression by Wavelet Transform
25  
26  
27  
28 wtcomp < stdin n1= n2= [optional parameter] > sdtout
29  
30  
31  
32 Required Parameters:
33  
34 n1= number of samples in the fast (first) dimension
35  
36 n2= number of samples in the slow (second) dimension
37  
38 Optional Parameters:
39  
40 nstage1= number of stages (set automatically based on n1)
41  
42 nstage2= number of stages (set automatically based on n2)
43  
44 nfilter=11 number of filters
45  
46 error=0.01 acceptable error
47  
48  
49  
50  
51  
52  
53  
54 Author: CWP: Tong Chen, Dec 1995
55  
56  
57  
58  
59  
60 =head2 User's notes (Juan Lorenzo)
61 untested
62  
63 =cut
64  
65  
66 =head2 CHANGES and their DATES
67  
68 =cut
69  
70 use Moose;
71 our $VERSION = '0.0.1';
72  
73  
74 =head2 Import packages
75  
76 =cut
77  
78 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
79  
80 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
81 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
82  
83  
84 =head2 instantiation of packages
85  
86 =cut
87  
88 my $get = L_SU_global_constants->new();
89 my $Project = Project_config->new();
90 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
91 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
92 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
93  
94 my $var = $get->var();
95 my $on = $var->{_on};
96 my $off = $var->{_off};
97 my $true = $var->{_true};
98 my $false = $var->{_false};
99 my $empty_string = $var->{_empty_string};
100  
101 =head2 Encapsulated
102 hash of private variables
103  
104 =cut
105  
106 my $wtcomp = {
107 _error => '',
108 _n1 => '',
109 _n2 => '',
110 _nfilter => '',
111 _nstage1 => '',
112 _nstage2 => '',
113 _Step => '',
114 _note => '',
115  
116 };
117  
118 =head2 sub Step
119  
120 collects switches and assembles bash instructions
121 by adding the program name
122  
123 =cut
124  
125 sub Step {
126  
127 $wtcomp->{_Step} = 'wtcomp'.$wtcomp->{_Step};
128 return ( $wtcomp->{_Step} );
129  
130 }
131  
132  
133 =head2 sub note
134  
135 collects switches and assembles bash instructions
136 by adding the program name
137  
138 =cut
139  
140 sub note {
141  
142 $wtcomp->{_note} = 'wtcomp'.$wtcomp->{_note};
143 return ( $wtcomp->{_note} );
144  
145 }
146  
147  
148  
149 =head2 sub clear
150  
151 =cut
152  
153 sub clear {
154  
155 $wtcomp->{_error} = '';
156 $wtcomp->{_n1} = '';
157 $wtcomp->{_n2} = '';
158 $wtcomp->{_nfilter} = '';
159 $wtcomp->{_nstage1} = '';
160 $wtcomp->{_nstage2} = '';
161 $wtcomp->{_Step} = '';
162 $wtcomp->{_note} = '';
163 }
164  
165  
166 =head2 sub error
167  
168  
169 =cut
170  
171 sub error {
172  
173 my ( $self,$error ) = @_;
174 if ( $error ne $empty_string ) {
175  
176 $wtcomp->{_error} = $error;
177 $wtcomp->{_note} = $wtcomp->{_note}.' error='.$wtcomp->{_error};
178 $wtcomp->{_Step} = $wtcomp->{_Step}.' error='.$wtcomp->{_error};
179  
180 } else {
181 print("wtcomp, error, missing error,\n");
182 }
183 }
184  
185  
186 =head2 sub n1
187  
188  
189 =cut
190  
191 sub n1 {
192  
193 my ( $self,$n1 ) = @_;
194 if ( $n1 ne $empty_string ) {
195  
196 $wtcomp->{_n1} = $n1;
197 $wtcomp->{_note} = $wtcomp->{_note}.' n1='.$wtcomp->{_n1};
198 $wtcomp->{_Step} = $wtcomp->{_Step}.' n1='.$wtcomp->{_n1};
199  
200 } else {
201 print("wtcomp, n1, missing n1,\n");
202 }
203 }
204  
205  
206 =head2 sub n2
207  
208  
209 =cut
210  
211 sub n2 {
212  
213 my ( $self,$n2 ) = @_;
214 if ( $n2 ne $empty_string ) {
215  
216 $wtcomp->{_n2} = $n2;
217 $wtcomp->{_note} = $wtcomp->{_note}.' n2='.$wtcomp->{_n2};
218 $wtcomp->{_Step} = $wtcomp->{_Step}.' n2='.$wtcomp->{_n2};
219  
220 } else {
221 print("wtcomp, n2, missing n2,\n");
222 }
223 }
224  
225  
226 =head2 sub nfilter
227  
228  
229 =cut
230  
231 sub nfilter {
232  
233 my ( $self,$nfilter ) = @_;
234 if ( $nfilter ne $empty_string ) {
235  
236 $wtcomp->{_nfilter} = $nfilter;
237 $wtcomp->{_note} = $wtcomp->{_note}.' nfilter='.$wtcomp->{_nfilter};
238 $wtcomp->{_Step} = $wtcomp->{_Step}.' nfilter='.$wtcomp->{_nfilter};
239  
240 } else {
241 print("wtcomp, nfilter, missing nfilter,\n");
242 }
243 }
244  
245  
246 =head2 sub nstage1
247  
248  
249 =cut
250  
251 sub nstage1 {
252  
253 my ( $self,$nstage1 ) = @_;
254 if ( $nstage1 ne $empty_string ) {
255  
256 $wtcomp->{_nstage1} = $nstage1;
257 $wtcomp->{_note} = $wtcomp->{_note}.' nstage1='.$wtcomp->{_nstage1};
258 $wtcomp->{_Step} = $wtcomp->{_Step}.' nstage1='.$wtcomp->{_nstage1};
259  
260 } else {
261 print("wtcomp, nstage1, missing nstage1,\n");
262 }
263 }
264  
265  
266 =head2 sub nstage2
267  
268  
269 =cut
270  
271 sub nstage2 {
272  
273 my ( $self,$nstage2 ) = @_;
274 if ( $nstage2 ne $empty_string ) {
275  
276 $wtcomp->{_nstage2} = $nstage2;
277 $wtcomp->{_note} = $wtcomp->{_note}.' nstage2='.$wtcomp->{_nstage2};
278 $wtcomp->{_Step} = $wtcomp->{_Step}.' nstage2='.$wtcomp->{_nstage2};
279  
280 } else {
281 print("wtcomp, nstage2, missing nstage2,\n");
282 }
283 }
284  
285  
286 =head2 sub get_max_index
287  
288 max index = number of input variables -1
289
290 =cut
291
292 sub get_max_index {
293 my ($self) = @_;
294 my $max_index = 5;
295  
296 return($max_index);
297 }
298
299
300 1;