lib/App/SeismicUnixGui/sunix/filter/sutvband.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%
dt
6.0
f
6.0
tf
6.0
CRAP 3.7
1 package App::SeismicUnixGui::sunix::filter::sutvband;
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 SUTVBAND - time-variant bandpass filter (sine-squared taper)
25  
26  
27  
28 sutvband <stdin >stdout tf= f=
29  
30  
31  
32 Required parameters:
33  
34 dt = (from header) time sampling interval (sec)
35  
36 tf= times for which f-vector is specified
37  
38 f=f1,f2,f3,f4 Corner frequencies corresponding to the
39  
40 times in tf. Specify as many f= as
41  
42 there are entries in tf.
43  
44  
45  
46 The filters are applied in frequency domain.
47  
48  
49  
50 Example:
51  
52 sutvband <data tf=.2,1.5 f=10,12.5,40,50 f=10,12.5,30,40 | ...
53  
54  
55  
56 Credits:
57  
58 CWP: Jack, Ken
59  
60  
61  
62 Trace header fields accessed: ns, dt, delrt
63  
64  
65  
66 =head2 User's notes (Juan Lorenzo)
67 untested
68  
69 =cut
70  
71  
72 =head2 CHANGES and their DATES
73  
74 =cut
75  
76 use Moose;
77 our $VERSION = '0.0.1';
78  
79  
80 =head2 Import packages
81  
82 =cut
83  
84 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
85  
86 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
87 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
88  
89  
90 =head2 instantiation of packages
91  
92 =cut
93  
94 my $get = L_SU_global_constants->new();
95 my $Project = Project_config->new();
96 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
97 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
98 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
99  
100 my $PS_SEISMIC = $Project->PS_SEISMIC();
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 $sutvband = {
115 _dt => '',
116 _f => '',
117 _tf => '',
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 $sutvband->{_Step} = 'sutvband'.$sutvband->{_Step};
133 return ( $sutvband->{_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 $sutvband->{_note} = 'sutvband'.$sutvband->{_note};
148 return ( $sutvband->{_note} );
149  
150 }
151  
152  
153  
154 =head2 sub clear
155  
156 =cut
157  
158 sub clear {
159  
160 $sutvband->{_dt} = '';
161 $sutvband->{_f} = '';
162 $sutvband->{_tf} = '';
163 $sutvband->{_Step} = '';
164 $sutvband->{_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 $sutvband->{_dt} = $dt;
179 $sutvband->{_note} = $sutvband->{_note}.' dt='.$sutvband->{_dt};
180 $sutvband->{_Step} = $sutvband->{_Step}.' dt='.$sutvband->{_dt};
181  
182 } else {
183 print("sutvband, dt, missing dt,\n");
184 }
185 }
186  
187  
188 =head2 sub f
189  
190  
191 =cut
192  
193 sub f {
194  
195 my ( $self,$f ) = @_;
196 if ( $f ne $empty_string ) {
197  
198 $sutvband->{_f} = $f;
199 $sutvband->{_note} = $sutvband->{_note}.' f='.$sutvband->{_f};
200 $sutvband->{_Step} = $sutvband->{_Step}.' f='.$sutvband->{_f};
201  
202 } else {
203 print("sutvband, f, missing f,\n");
204 }
205 }
206  
207  
208 =head2 sub tf
209  
210  
211 =cut
212  
213 sub tf {
214  
215 my ( $self,$tf ) = @_;
216 if ( $tf ne $empty_string ) {
217  
218 $sutvband->{_tf} = $tf;
219 $sutvband->{_note} = $sutvband->{_note}.' tf='.$sutvband->{_tf};
220 $sutvband->{_Step} = $sutvband->{_Step}.' tf='.$sutvband->{_tf};
221  
222 } else {
223 print("sutvband, tf, missing tf,\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;