lib/App/SeismicUnixGui/sunix/filter/suphase.pm untested

filter: Statementstmt 0.0% 0 / 56 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 / 80 CC 4 SCAR 13.1
CC
4
Cov
0%
a
6.0
b
6.0
c
6.0
CRAP 3.7
1 package App::SeismicUnixGui::sunix::filter::suphase;
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 SUPHASE - PHASE manipulation by linear transformation
25  
26  
27  
28 suphase <stdin >sdout
29  
30  
31  
32 Required parameters:
33  
34 none
35  
36 Optional parameters:
37  
38 a=90 constant phase shift
39  
40 b=180/PI linear phase shift
41  
42 c=0.0 phase = a +b*(old_phase)+c*f;
43  
44  
45  
46 Notes:
47  
48 A program that allows the user to experiment with changes in the phase
49  
50 spectrum of a signal.
51  
52  
53  
54 =head2 User's notes (Juan Lorenzo)
55 untested
56  
57 =cut
58  
59  
60 =head2 CHANGES and their DATES
61  
62 =cut
63  
64 use Moose;
65 our $VERSION = '0.0.1';
66  
67  
68 =head2 Import packages
69  
70 =cut
71  
72 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
73  
74 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
75 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
76  
77  
78 =head2 instantiation of packages
79  
80 =cut
81  
82 my $get = L_SU_global_constants->new();
83 my $Project = Project_config->new();
84 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
85 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
86 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
87  
88 my $PS_SEISMIC = $Project->PS_SEISMIC();
89  
90 my $var = $get->var();
91 my $on = $var->{_on};
92 my $off = $var->{_off};
93 my $true = $var->{_true};
94 my $false = $var->{_false};
95 my $empty_string = $var->{_empty_string};
96  
97 =head2 Encapsulated
98 hash of private variables
99  
100 =cut
101  
102 my $suphase = {
103 _a => '',
104 _b => '',
105 _c => '',
106 _Step => '',
107 _note => '',
108  
109 };
110  
111 =head2 sub Step
112  
113 collects switches and assembles bash instructions
114 by adding the program name
115  
116 =cut
117  
118 sub Step {
119  
120 $suphase->{_Step} = 'suphase'.$suphase->{_Step};
121 return ( $suphase->{_Step} );
122  
123 }
124  
125  
126 =head2 sub note
127  
128 collects switches and assembles bash instructions
129 by adding the program name
130  
131 =cut
132  
133 sub note {
134  
135 $suphase->{_note} = 'suphase'.$suphase->{_note};
136 return ( $suphase->{_note} );
137  
138 }
139  
140  
141  
142 =head2 sub clear
143  
144 =cut
145  
146 sub clear {
147  
148 $suphase->{_a} = '';
149 $suphase->{_b} = '';
150 $suphase->{_c} = '';
151 $suphase->{_Step} = '';
152 $suphase->{_note} = '';
153 }
154  
155  
156 =head2 sub a
157  
158  
159 =cut
160  
161 sub a {
162  
163 my ( $self,$a ) = @_;
164 if ( $a ne $empty_string ) {
165  
166 $suphase->{_a} = $a;
167 $suphase->{_note} = $suphase->{_note}.' a='.$suphase->{_a};
168 $suphase->{_Step} = $suphase->{_Step}.' a='.$suphase->{_a};
169  
170 } else {
171 print("suphase, a, missing a,\n");
172 }
173 }
174  
175  
176 =head2 sub b
177  
178  
179 =cut
180  
181 sub b {
182  
183 my ( $self,$b ) = @_;
184 if ( $b ne $empty_string ) {
185  
186 $suphase->{_b} = $b;
187 $suphase->{_note} = $suphase->{_note}.' b='.$suphase->{_b};
188 $suphase->{_Step} = $suphase->{_Step}.' b='.$suphase->{_b};
189  
190 } else {
191 print("suphase, b, missing b,\n");
192 }
193 }
194  
195  
196 =head2 sub c
197  
198  
199 =cut
200  
201 sub c {
202  
203 my ( $self,$c ) = @_;
204 if ( $c ne $empty_string ) {
205  
206 $suphase->{_c} = $c;
207 $suphase->{_note} = $suphase->{_note}.' c='.$suphase->{_c};
208 $suphase->{_Step} = $suphase->{_Step}.' c='.$suphase->{_c};
209  
210 } else {
211 print("suphase, c, missing c,\n");
212 }
213 }
214  
215  
216 =head2 sub get_max_index
217  
218 max index = number of input variables -1
219
220 =cut
221
222 sub get_max_index {
223 my ($self) = @_;
224 my $max_index = 2;
225  
226 return($max_index);
227 }
228
229
230 1;