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

filter: Statementstmt 0.0% 0 / 68 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 79 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::iPick_config;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PERL PROGRAM NAME: iPick_config.pm
8 AUTHOR: Juan Lorenzo
9 DATE: June 16, 2019
10 DESCRIPTION: Reads a seismic unix-formatted file
11 outputs a text file of the picks
12  
13 USED
14  
15 BASED ON:
16 Version 0.01 iTopMute_config.pm
17
18
19 Needs: Simple (ASCII) local configuration
20 file is iPick.config
21  
22 Package control:
23  
24 =cut
25  
26 =head2 EXAMPLE
27
28 contains all the configuration variables in
29 perl script
30  
31 base_file_name = 30Hz_All_geom_geom;
32 gather_header = fldr;
33 offset_type = tracl;
34 first_gather = 1;
35 gather_inc = 1;
36 last_gather = 100;
37 freq = '0,3,100,200;
38 gather_type = fldr;
39 min_amplitude = .0;
40 max_amplitude = .75;
41
42 =cut
43  
44 use Moose;
45 our $VERSION = '0.0.1';
46  
47 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
48 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
49 use App::SeismicUnixGui::misc::control '0.0.3';
50 use aliased 'App::SeismicUnixGui::misc::control';
51 use aliased 'App::SeismicUnixGui::misc::config_superflows';
52 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su);
53  
54 my $Project = Project_config->new();
55 my $control = control->new();
56 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
57 my $config_superflows = config_superflows->new();
58 my $get = L_SU_global_constants->new();
59 my $superflow_config_names = $get->superflow_config_names_aref();
60  
61 # WARNING---- watch out for missing underscore!!
62  
63 =head2 private hash
64  
65 =cut
66  
67 my $iPick_config = {
68 _prog_name => '',
69 _values_aref => '',
70 };
71 # set the superflow name: 11 is for iPick
72  
73 sub get_values {
74  
75 my ($self) = @_;
76  
77 # Warning: set using a scalar reference
78 $iPick_config->{_prog_name} = \@{$superflow_config_names}[11];
79  
80 # print("iPick_config, prog_name : @{$superflow_config_names}[11]\n");
81  
82 $config_superflows->set_program_name( $iPick_config->{_prog_name} );
83  
84 # parameter values from superflow configuration file
85 $iPick_config->{_values_aref} = $config_superflows->get_values();
86  
87 # print("iPick_config,values=@{$iPick_config->{_values_aref}}\n");
88  
89 my $base_file_name = @{ $iPick_config->{_values_aref} }[0];
90 my $gather_header = @{ $iPick_config->{_values_aref} }[1];
91 my $offset_type = @{ $iPick_config->{_values_aref} }[2];
92 my $first_gather = @{ $iPick_config->{_values_aref} }[3];
93 my $gather_inc = @{ $iPick_config->{_values_aref} }[4];
94 my $last_gather = @{ $iPick_config->{_values_aref} }[5];
95 my $freq = @{ $iPick_config->{_values_aref} }[6];
96 my $gather_type = @{ $iPick_config->{_values_aref} }[7];
97 my $min_amplitude = @{ $iPick_config->{_values_aref} }[8];
98 my $max_amplitude = @{ $iPick_config->{_values_aref} }[9];
99 my $min_x1 = @{ $iPick_config->{_values_aref} }[10];
100 my $max_x1 = @{ $iPick_config->{_values_aref} }[11];
101 my $purpose = @{ $iPick_config->{_values_aref} }[12];
102  
103 $base_file_name = $control->su_data_name( \$base_file_name );
104  
105 # print ("iPick_config, min_x1: $min_x1\n");
106  
107 =head2 Example LOCAL VARIABLES FOR THIS PROJECT
108  
109 =cut
110  
111 my $CFG = {
112 suximage => {
113 1 => {
114 gather_header => $gather_header,
115 offset_type => $offset_type,
116 first_gather => $first_gather,
117 gather_inc => $gather_inc,
118 last_gather => $last_gather,
119 freq => $freq,
120 gather_type => $gather_type,
121 min_amplitude => $min_amplitude,
122 max_amplitude => $max_amplitude,
123 min_x1 => $min_x1,
124 max_x1 => $max_x1,
125 purpose => $purpose,
126 },
127 },
128 sugain => { 1 => { freq => $freq }, },
129 base_file_name => $base_file_name,
130 }; # end of CFG hash
131  
132 return ( $CFG, $iPick_config->{_values_aref} ); # hash and arrary reference
133  
134 }; # end of sub get_values
135  
136 =head2 sub get_max_index
137  
138 max index = number of input variables -1
139  
140 =cut
141  
142 sub get_max_index {
143 my ($self) = @_;
144 my $max_index = 12;
145  
146 return ($max_index);
147 }
148  
149 1;