lib/App/SeismicUnixGui/configs/big_streams/Sudipfilt_config.pm untested

filter: Statementstmt 0.0% 0 / 96 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 107 CC 1 SCAR 6.9
CC
1
Cov
0%
get_values
2.0
get_max_index
2.0
BEGIN
2.0
CRAP 2.0
1 package App::SeismicUnixGui::configs::big_streams::Sudipfilt_config;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PROGRAM NAME: Sudipfilt_config.pm
8 AUTHOR: Juan Lorenzo
9 DATE: July 1 2016
10
11 DESCRIPTION Upper-level variable
12 definitions for Sudipfilt
13 Package name is the same as the file name
14  
15 Package control corrects some values read
16 in by Config::Simple
17
18 Jan 11, 2018
19
20 remove dependency on Config::Simple
21  
22 =cut
23  
24 =head2 Notes
25  
26
27 =cut
28  
29 =head2 LOCAL VARIABLES FOR THIS PROJECT
30  
31 Values taken from the simple,local
32 file: Sudipfilt.config called
33 LOCAL VARIABLES FOR THIS PROJECT
34 =head2 LOCAL VARIABLES FOR THIS PROJECT
35  
36 Values taken from the simple,local
37 file: Sudipfilt.config called
38  
39 base_file_name = '11'
40 sudipfilter_1_dt = 1
41 sudipfilter_1_dx = 1
42 sudipfilter_1_bias = 0
43 sudipfilter_1_slopes ='3,8,15,25,80'
44 sudipfilter_1_slopes ='1,4,7,12,80'
45 sudipfilter_1_amps ='0,0,1,0,0'
46 sudipfilter_1_amps ='1,1,0,0,1'
47  
48 # second filter is not enacted
49 sudipfilter_2_dt = 1
50 sudipfilter_2_dx = 1
51 sudipfilter_2_bias = 0
52 sudipfilter_2_slopes = '-80,-20,-5,-1'
53 sudipfilter_2_slopes = '-40,-10,-3,0'
54  
55 sudipfilter_2_amps = '0,0,0,1'
56  
57 suinterp_ninterp = 1
58  
59 suwind_1_tmin = 0
60 suwind_1_tmax = 1
61  
62 suwind_2_key = 'tracl'
63 suwind_2_min = 1
64 suwind_2_max = 50
65  
66 suspecfk_1_dt = 1
67 suspecfk_1_dx = 1
68  
69 sufilter_1_freq = '0,3,80,200'
70 sufilter_1_amplitude = '1,1,1,0'
71  
72 #TOP_LEFT
73 TOP_LEFT_sugain_agc_switch = 1
74 TOP_LEFT_sugain_agc_width = .1
75 TOP_LEFT_sugain_pbal_switch = 10
76  
77 BOTTOM_RIGHT_suximage_absclip = 5
78
79 =cut
80  
81 use Moose;
82 our $VERSION = '1.0.0';
83 use App::SeismicUnixGui::misc::control '0.0.3';
84 use aliased 'App::SeismicUnixGui::misc::control';
85 use aliased 'App::SeismicUnixGui::misc::config_superflows';
86 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
87 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
88 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su);
89  
90 my $get = L_SU_global_constants->new();
91 my $config_superflows = config_superflows->new();
92 my $control = control->new();
93 my $Project = Project_config->new();
94  
95 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
96 my $superflow_config_names = $get->superflow_config_names_aref();
97  
98 # WARNING---- watch out for missing underscore!!
99 #print("1. Sudipfilt_config,fk superflow_config_name : @{$superflow_config_names}\n");
100  
101 =head2 private hash
102  
103 =cut
104  
105 my $Sudipfilt = {
106 _prog_name => '',
107 _values_aref => '',
108 };
109  
110 # set the superflow name: 0 is for fk-to-Sudipfilt
111  
112 sub get_values {
113 my ($self) = @_;
114  
115 # Warning: set using a scalar reference
116 $Sudipfilt->{_prog_name} = \@{$superflow_config_names}[0];
117  
118 print("Sudipfilt_config, get_values, prog_name : @{$superflow_config_names}[0]\n");
119  
120 $config_superflows->set_program_name( $Sudipfilt->{_prog_name} );
121  
122 # parameter values from superflow configuration file
123 $Sudipfilt->{_values_aref} = $config_superflows->get_values();
124  
125 # print("Sudipfilt_config,values=@{$Sudipfilt->{_values_aref}}\n");
126  
127 # remove single or double quotes
128 $Sudipfilt->{_values_aref} =
129 $control->get_no_quotes4array( $Sudipfilt->{_values_aref} );
130  
131 my $base_file_name = @{ $Sudipfilt->{_values_aref} }[0];
132 my $sudipfilter_1_dt = @{ $Sudipfilt->{_values_aref} }[1];
133 my $sudipfilter_1_dx = @{ $Sudipfilt->{_values_aref} }[2];
134 my $sudipfilter_1_bias = @{ $Sudipfilt->{_values_aref} }[3];
135 my $sudipfilter_1_slopes = @{ $Sudipfilt->{_values_aref} }[4];
136 my $sudipfilter_1_amps = @{ $Sudipfilt->{_values_aref} }[5];
137 my $sudipfilter_2_dt = @{ $Sudipfilt->{_values_aref} }[6];
138 my $sudipfilter_2_dx = @{ $Sudipfilt->{_values_aref} }[7];
139 my $sudipfilter_2_bias = @{ $Sudipfilt->{_values_aref} }[8];
140 my $sudipfilter_2_slopes = @{ $Sudipfilt->{_values_aref} }[9];
141 my $sudipfilter_2_amps = @{ $Sudipfilt->{_values_aref} }[10];
142 my $suinterp_ninterp = @{ $Sudipfilt->{_values_aref} }[11];
143 my $suwind_1_tmin = @{ $Sudipfilt->{_values_aref} }[12];
144 my $suwind_1_tmax = @{ $Sudipfilt->{_values_aref} }[13];
145 my $suwind_2_key = @{ $Sudipfilt->{_values_aref} }[14];
146 my $suwind_2_min = @{ $Sudipfilt->{_values_aref} }[15];
147 my $suwind_2_max = @{ $Sudipfilt->{_values_aref} }[16];
148 my $suspecfk_1_dt = @{ $Sudipfilt->{_values_aref} }[17];
149 my $suspecfk_1_dx = @{ $Sudipfilt->{_values_aref} }[18];
150 my $sufilter_1_freq = @{ $Sudipfilt->{_values_aref} }[19];
151 my $sufilter_1_amplitude = @{ $Sudipfilt->{_values_aref} }[20];
152 my $TOP_LEFT_sugain_pbal_switch = @{ $Sudipfilt->{_values_aref} }[21];
153 my $TOP_LEFT_sugain_agc_switch = @{ $Sudipfilt->{_values_aref} }[22];
154 my $TOP_LEFT_sugain_agc_width = @{ $Sudipfilt->{_values_aref} }[23];
155 my $BOTTOM_RIGHT_suximage_absclip = @{ $Sudipfilt->{_values_aref} }[24];
156  
157 # check on formats
158 # $freq = $control->commas(\$freq); # needed?
159  
160 # print(" Sudipfilt_config, base_file_name is $base_file_name\n\n");
161 # print ("Sudipfilt_config, pbal is $TOP_LEFT_sugain_pbal_switch\n\n");
162 # print ("Sudipfilt_config,suwind_1_tmin is $suwind_1_tmin\n\n");
163  
164 =pod Package control
165  
166 filename is file, without a suffix!
167 In some cases, some numbers must be
168 separated by commas
169  
170 =cut
171  
172 # print ("Sudipfilt_config.pl,base_file_name was $base_file_name\n\n");
173 # $base_file_name = $control->su_data_name($base_file_name);
174 # print ("3. Sudipfilt_config.pl,base_file_name is $base_file_name\n\n");
175 #$CFG[7] = $control->commas(\$CFG[7]);
176 #$CFG[11] = $control->commas(\$CFG[11]);
177 #$CFG[17] = $control->commas(\$CFG[17]);
178 #$CFG[21] = $control->commas(\$CFG[21]);
179 #$CFG[23] = $control->commas(\$CFG[23]);
180 #$CFG[25] = $control->commas(\$CFG[25]);
181  
182 =head2 Example LOCAL VARIABLES FOR THIS PROJECT
183  
184 =cut
185  
186 my $CFG = {
187 TOP_LEFT => {
188 sugain => {
189 agc_switch => $TOP_LEFT_sugain_agc_switch,
190 pbal_switch => $TOP_LEFT_sugain_pbal_switch,
191 agc_width => $TOP_LEFT_sugain_agc_width,
192 },
193 },
194 BOTTOM_RIGHT =>
195 { suximage => { absclip => $BOTTOM_RIGHT_suximage_absclip }, },
196 sudipfilter => {
197 1 => {
198 dt => $sudipfilter_1_dt,
199 dx => $sudipfilter_1_dx,
200 slopes => $sudipfilter_1_slopes,
201 bias => $sudipfilter_1_bias,
202 amps => $sudipfilter_1_amps,
203 },
204 2 => {
205 dt => $sudipfilter_2_dt,
206 dx => $sudipfilter_2_dx,
207 slopes => $sudipfilter_2_slopes,
208 bias => $sudipfilter_2_bias,
209 amps => $sudipfilter_2_amps,
210 },
211 },
212 suwind => {
213 1 => {
214 tmin => $suwind_1_tmin,
215 tmax => $suwind_1_tmax,
216 },
217 2 => {
218 key => $suwind_2_key,
219 min => $suwind_2_min,
220 max => $suwind_2_max,
221 },
222 },
223 sufilter => {
224 1 => {
225 freq => $sufilter_1_freq,
226 amplitude => $sufilter_1_amplitude,
227 },
228 },
229 suinterp => {
230 1 => {
231 ninterp => $suinterp_ninterp,
232 },
233 },
234 suspecfk => {
235 1 => {
236 dt => $suspecfk_1_dt,
237 dx => $suspecfk_1_dx,
238 }
239 },
240 base_file_name => $base_file_name,
241 inbound_directory => $DATA_SEISMIC_SU,
242  
243 }; # end of CFG hash
244  
245 return ( $CFG, $Sudipfilt->{_values_aref} ); # hash and arrary reference
246  
247 }; # end of sub get_values
248  
249 =head2 sub get_max_index
250  
251 max index = number of input variables -1
252  
253 =cut
254  
255 sub get_max_index {
256 my ($self) = @_;
257  
258 # only file_name : index=24
259 my $max_index = 24;
260  
261 return ($max_index);
262 }
263  
264 1;