lib/App/SeismicUnixGui/sunix/transform/dctcomp.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%
blocksize1
6.0
blocksize2
6.0
error
6.0
CRAP 4.2
1 package App::SeismicUnixGui::sunix::transform::dctcomp;
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 DCTCOMP - Compression by Discrete Cosine Transform
25  
26  
27  
28 dctcomp < 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 blocksize1=16 blocksize in direction 1
41  
42 blocksize2=16 blocksize in direction 2
43  
44 error=0.01 acceptable error
45  
46  
47 Author: CWP: Tong Chen Dec 1995
48  
49  
50 =head2 User's notes: Juan Lorenzo
51  
52 Untested 9.4.21
53  
54 =cut
55  
56  
57 =head2 CHANGES and their DATES
58  
59 =cut
60  
61 use Moose;
62 our $VERSION = '0.0.1';
63  
64  
65 =head2 Import packages
66  
67 =cut
68  
69 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
70  
71 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
72 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
73  
74  
75 =head2 instantiation of packages
76  
77 =cut
78  
79 my $get = L_SU_global_constants->new();
80 my $Project = Project_config->new();
81 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
82 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
83 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
84  
85 my $var = $get->var();
86 my $on = $var->{_on};
87 my $off = $var->{_off};
88 my $true = $var->{_true};
89 my $false = $var->{_false};
90 my $empty_string = $var->{_empty_string};
91  
92 =head2 Encapsulated
93 hash of private variables
94  
95 =cut
96  
97 my $dctcomp = {
98 _blocksize1 => '',
99 _blocksize2 => '',
100 _error => '',
101 _n1 => '',
102 _n2 => '',
103 _Step => '',
104 _note => '',
105  
106 };
107  
108 =head2 sub Step
109  
110 collects switches and assembles bash instructions
111 by adding the program name
112  
113 =cut
114  
115 sub Step {
116  
117 $dctcomp->{_Step} = 'dctcomp'.$dctcomp->{_Step};
118 return ( $dctcomp->{_Step} );
119  
120 }
121  
122  
123 =head2 sub note
124  
125 collects switches and assembles bash instructions
126 by adding the program name
127  
128 =cut
129  
130 sub note {
131  
132 $dctcomp->{_note} = 'dctcomp'.$dctcomp->{_note};
133 return ( $dctcomp->{_note} );
134  
135 }
136  
137  
138  
139 =head2 sub clear
140  
141 =cut
142  
143 sub clear {
144  
145 $dctcomp->{_blocksize1} = '';
146 $dctcomp->{_blocksize2} = '';
147 $dctcomp->{_error} = '';
148 $dctcomp->{_n1} = '';
149 $dctcomp->{_n2} = '';
150 $dctcomp->{_Step} = '';
151 $dctcomp->{_note} = '';
152 }
153  
154  
155 =head2 sub blocksize1
156  
157  
158 =cut
159  
160 sub blocksize1 {
161  
162 my ( $self,$blocksize1 ) = @_;
163 if ( $blocksize1 ne $empty_string ) {
164  
165 $dctcomp->{_blocksize1} = $blocksize1;
166 $dctcomp->{_note} = $dctcomp->{_note}.' blocksize1='.$dctcomp->{_blocksize1};
167 $dctcomp->{_Step} = $dctcomp->{_Step}.' blocksize1='.$dctcomp->{_blocksize1};
168  
169 } else {
170 print("dctcomp, blocksize1, missing blocksize1,\n");
171 }
172 }
173  
174  
175 =head2 sub blocksize2
176  
177  
178 =cut
179  
180 sub blocksize2 {
181  
182 my ( $self,$blocksize2 ) = @_;
183 if ( $blocksize2 ne $empty_string ) {
184  
185 $dctcomp->{_blocksize2} = $blocksize2;
186 $dctcomp->{_note} = $dctcomp->{_note}.' blocksize2='.$dctcomp->{_blocksize2};
187 $dctcomp->{_Step} = $dctcomp->{_Step}.' blocksize2='.$dctcomp->{_blocksize2};
188  
189 } else {
190 print("dctcomp, blocksize2, missing blocksize2,\n");
191 }
192 }
193  
194  
195 =head2 sub error
196  
197  
198 =cut
199  
200 sub error {
201  
202 my ( $self,$error ) = @_;
203 if ( $error ne $empty_string ) {
204  
205 $dctcomp->{_error} = $error;
206 $dctcomp->{_note} = $dctcomp->{_note}.' error='.$dctcomp->{_error};
207 $dctcomp->{_Step} = $dctcomp->{_Step}.' error='.$dctcomp->{_error};
208  
209 } else {
210 print("dctcomp, error, missing error,\n");
211 }
212 }
213  
214  
215 =head2 sub n1
216  
217  
218 =cut
219  
220 sub n1 {
221  
222 my ( $self,$n1 ) = @_;
223 if ( $n1 ne $empty_string ) {
224  
225 $dctcomp->{_n1} = $n1;
226 $dctcomp->{_note} = $dctcomp->{_note}.' n1='.$dctcomp->{_n1};
227 $dctcomp->{_Step} = $dctcomp->{_Step}.' n1='.$dctcomp->{_n1};
228  
229 } else {
230 print("dctcomp, n1, missing n1,\n");
231 }
232 }
233  
234  
235 =head2 sub n2
236  
237  
238 =cut
239  
240 sub n2 {
241  
242 my ( $self,$n2 ) = @_;
243 if ( $n2 ne $empty_string ) {
244  
245 $dctcomp->{_n2} = $n2;
246 $dctcomp->{_note} = $dctcomp->{_note}.' n2='.$dctcomp->{_n2};
247 $dctcomp->{_Step} = $dctcomp->{_Step}.' n2='.$dctcomp->{_n2};
248  
249 } else {
250 print("dctcomp, n2, missing n2,\n");
251 }
252 }
253  
254  
255 =head2 sub get_max_index
256  
257 max index = number of input variables -1
258
259 =cut
260
261 sub get_max_index {
262 my ($self) = @_;
263 my $max_index = 4;
264  
265 return($max_index);
266 }
267
268
269 1;