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

filter: Statementstmt 0.0% 0 / 73 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 82 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::iVA_config;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PROGRAM NAME: iVA_config.pm
8 AUTHOR: Juan Lorenzo
9 DATE: Aug 18 2016
10 July 19 2017
11 Jan 7 2017
12 Jan 13 2020
13 DESCRIPTION Combines configuration variables
14 both from a simple text file and from
15 from additional packages.
16  
17 USED FOR IVA (interactive velocity analysis)
18  
19 Derives from iVA_config.pl
20
21 Version 2 based on Sucat.pm June 29 2016
22 Added a simple configuration file readable
23 and writable using Config::Simple (CPAN)
24  
25 package control replaces commas in strings
26 needed by Seismic Unix
27
28 July 19 2017 - added tmax_s parameter to configuration file
29 January 7, 2017 - remove outside dependency on Config-Simple
30
31 Jan 13 2020: data_scale removed from gui; max_index=11
32
33  
34 =cut
35  
36 =head2 LOCAL VARIABLES FOR THIS PROJECT
37  
38 Values taken from the simple,local
39 file: iVA.config called
40 LOCAL VARIABLES FOR THIS PROJECT
41 base_file_name = 'All_cmp'
42 cdp_first = 15
43 cdp_inc = 1
44 cdp_last = 100
45 tmax_s = .2
46 dt_s = .004
47 freq = '0,3,100,200'
48 number_of_velocities = 300
49 first_velocity = 3
50 velocity_increment = 10
51 min_semblance = .0
52 max_semblance = .75
53
54 =cut
55  
56 use Moose;
57 our $VERSION = '1.0.1';
58 use aliased 'App::SeismicUnixGui::misc::config_superflows';
59  
60 use App::SeismicUnixGui::misc::control '0.0.3';
61 use aliased 'App::SeismicUnixGui::misc::control';
62  
63 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
64  
65 my $get = L_SU_global_constants->new();
66 my $control = control->new();
67 my $config_superflows = config_superflows->new();
68 my $superflow_config_names = $get->superflow_config_names_aref();
69  
70 #WARNING---- watch out for missing underscore!!
71 # set the correct index manually for this superflow
72 # print("1. iVA_config, alias_superflow_config_name : $$alias_superflow_config_name[4].config\n");
73  
74 =head2 private hash
75  
76  
77 =cut
78  
79 my $iVA = {
80 _prog_name => '',
81 _names_aref => '',
82 _values_aref => '',
83  
84 #_check_buttons_settings_aref => '',
85 #_check_buttons_settings_aref => '',
86 _superflows_first_idx => '',
87 _superflows_length => '',
88 };
89  
90 # set the superflow name: 4 is for iVA
91 # print("iVA_config, prog_name : @{$superflow_config_names}[4]\n");
92 # Warning: set using a scalar reference
93  
94 sub get_values {
95 my ($self) = @_;
96 $iVA->{_prog_name} = \@{$superflow_config_names}[4];
97  
98 $config_superflows->set_program_name( $iVA->{_prog_name} );
99  
100 # parameter names from superflow configuration file
101 $iVA->{_names_aref} = $config_superflows->get_names();
102 # print("iVA_config,prog=@{$iVA->{_names_aref}}\n");
103  
104 # parameter values from superflow configuration file
105 $iVA->{_values_aref} = $config_superflows->get_values();
106  
107 # print("iVA_config,values=@{$iVA->{_values_aref}}\n");
108  
109 # $iVA->{_check_buttons_settings_aref} = $config_superflows->get_check_buttons_settings();
110 # print("iVA_config,chkb=@{$iVA->{_check_buttons_settings_aref}}\n");
111  
112 $iVA->{_superflows_first_idx} = $config_superflows->first_idx();
113 $iVA->{_superflows_length} = $config_superflows->length();
114  
115 my $base_file_name = @{ $iVA->{_values_aref} }[0];
116 my $cdp_first = @{ $iVA->{_values_aref} }[1];
117 my $cdp_inc = @{ $iVA->{_values_aref} }[2];
118 my $cdp_last = @{ $iVA->{_values_aref} }[3];
119 my $dt_s = @{ $iVA->{_values_aref} }[4];
120 my $tmax_s = @{ $iVA->{_values_aref} }[5];
121 my $freq = @{ $iVA->{_values_aref} }[6];
122 my $number_of_velocities = @{ $iVA->{_values_aref} }[7];
123 my $first_velocity = @{ $iVA->{_values_aref} }[8];
124 my $velocity_increment = @{ $iVA->{_values_aref} }[9];
125 my $min_semblance = @{ $iVA->{_values_aref} }[10];
126 my $max_semblance = @{ $iVA->{_values_aref} }[11];
127 my $anis1 = @{ $iVA->{_values_aref} }[12];
128 my $anis2 = @{ $iVA->{_values_aref} }[13];
129 my $dtratio = @{ $iVA->{_values_aref} }[14];
130 my $nsmooth = @{ $iVA->{_values_aref} }[15];
131 my $pwr = @{ $iVA->{_values_aref} }[16];
132 my $smute = @{ $iVA->{_values_aref} }[17];
133  
134 # check on formats
135 $freq = $control->commas( \$freq ); # needed?
136  
137 # print(" 1. iVA_config for iVA, base_file_name is $base_file_name\n\n");
138 $base_file_name = $control->su_data_name( \$base_file_name );
139  
140 # print(" 2. VA_config, for iVA, base_file_name is $base_file_name \n\n");
141  
142 # private hash variable
143 my $CFG_h = {
144 iva => {
145 1 => {
146 base_file_name => $base_file_name,
147 cdp_first => $cdp_first,
148 cdp_inc => $cdp_inc,
149 cdp_last => $cdp_last,
150 dt_s => $dt_s,
151 tmax_s => $tmax_s,
152 freq => $freq,
153 number_of_velocities => $number_of_velocities,
154 first_velocity => $first_velocity,
155 velocity_increment => $velocity_increment,
156 min_semblance => $min_semblance,
157 max_semblance => $max_semblance,
158 anis1 => $anis1,
159 anis2 => $anis2,
160 dtratio => $dtratio,
161 nsmooth => $nsmooth,
162 pwr => $pwr,
163 smute => $smute,
164 }
165 }
166 };
167  
168 return ( $CFG_h, $iVA->{_values_aref} ); # hash and arrary reference
169 } # end of sub get_values
170  
171 =head2 sub get_max_index
172  
173 max index = number of input variables -1
174  
175 =cut
176  
177 sub get_max_index {
178 my ($self) = @_;
179  
180 my $max_index = 17;
181  
182 return ($max_index);
183 }
184  
185 1;
186