lib/App/SeismicUnixGui/big_streams/iSave_top_mute_picks.pm untested

filter: Statementstmt 0.0% 0 / 53 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 12 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 79 CC 5 SCAR 13.9
CC
5
Cov
0%
file_in
6.0
gather_num
6.0
gather_type
6.0
CRAP 4.0
1 package App::SeismicUnixGui::big_streams::iSave_top_mute_picks;
2  
3 use Moose;
4 our $VERSION = '0.0.1';
5  
6 =head1 DOCUMENTATION
7  
8 =head2 SYNOPSIS
9  
10 PROGRAM NAME:iSave_top_mute_picks.pm
11 AUTHOR: Juan Lorenzo
12 DATE: September 2015
13 Version: 3.0
14  
15 DESCRIPTION:Originally to Save final Top Mute of Data
16  
17 =head2 USE
18  
19 =head4
20  
21 Examples
22  
23 =head2 SEISMIC UNIX NOTES
24  
25 =head4 CHANGES and their DATES
26  
27 V1 May 5 2009
28 V2. change top mute parameters to toptom mute parameters
29 Aug 12, 2011
30 V3.0 September 2015 :
31 updated to oop
32 introduced Tk widgets
33 Made all event-driven
34  
35 =head2 STEPS
36  
37 use the local library of the user
38 bring is user variables from a local file
39 create instances of the needed subroutines
40  
41 =cut
42  
43 =head2
44  
45 needed packages
46  
47 =cut
48  
49 use aliased 'App::SeismicUnixGui::misc::message';
50 use aliased 'App::SeismicUnixGui::misc::flow';
51 use aliased 'App::SeismicUnixGui::sunix::shell::cp';
52 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
53 use App::SeismicUnixGui::misc::SeismicUnix qw($itemp_top_mute_picks_sorted_par_
54 $itop_mute_file_list $itop_mute_par_ $suffix_txt);
55  
56 =head2
57  
58 instantiate classes
59  
60 =cut
61  
62 my $log = message->new();
63 my $run = flow->new();
64 my $cp = cp->new();
65 my $Project = Project_config->new();
66  
67 =head2
68
69 declare variables types
70 establish just the locally scoped variables
71  
72 =cut
73  
74 my ( @flow, @cp, @items );
75  
76 =head2
77  
78 create hash with important variables
79  
80 =cut
81  
82 my $iSave_top_mute_picks = {
83 _gather_num => '',
84 _gather_type => '',
85 _gather_header => '',
86 _file_in => '',
87 _inbound => '',
88 _itop_mute_file_list => $itop_mute_file_list,
89 _outbound => ''
90 };
91  
92 =head2
93  
94 Import directory definitions
95  
96 =cut
97  
98 my ($DATA_SEISMIC_TXT) = $Project->DATA_SEISMIC_TXT();
99  
100 =head2 subroutine clear
101  
102 sets all variable strings to ''
103  
104 =cut
105  
106 sub clear {
107 $iSave_top_mute_picks->{_gather_num} = '';
108 $iSave_top_mute_picks->{_gather_type} = '';
109 $iSave_top_mute_picks->{_gather_header} = '';
110 $iSave_top_mute_picks->{_inbound} = '';
111 $iSave_top_mute_picks->{_itop_mute_file_list} = '';
112 $iSave_top_mute_picks->{_outbound} = '';
113 }
114  
115 =head2 subroutine file_in
116  
117 Required file name
118 on which to pick top mute values
119  
120 =cut
121  
122 sub file_in {
123 my ( $variable, $file_in ) = @_;
124 $iSave_top_mute_picks->{_file_in} = $file_in if defined($file_in);
125  
126 #print("file name is $iSave_top_mute_picks->{_file_in} \n\n");
127  
128 }
129  
130 =head2 subroutine gather
131  
132 sets gather number to consider
133  
134 =cut
135  
136 sub gather_num {
137 my ( $variable, $gather_num ) = @_;
138 $iSave_top_mute_picks->{_gather_num} = $gather_num
139 if defined($gather_num);
140 }
141  
142 =head2 subroutine gather_type
143  
144 sets gather_type number to consider
145  
146 =cut
147  
148 sub gather_type {
149 my ( $variable, $gather_type ) = @_;
150 $iSave_top_mute_picks->{_gather_type} = $gather_type
151 if defined($gather_type);
152 }
153  
154 =head2 subroutine gather_header
155  
156 sets gather_header number to consider
157  
158 =cut
159  
160 sub gather_header {
161 my ( $variable, $gather_header ) = @_;
162 $iSave_top_mute_picks->{_gather_header} = $gather_header
163 if defined($gather_header);
164 }
165  
166 =head2 sub calc
167  
168 rewrite sorted picks into a permanent file
169  
170 =cut
171  
172 sub calc { #
173 my $suffix;
174  
175 $suffix = '_'
176 . $iSave_top_mute_picks->{_gather_header}
177 . $iSave_top_mute_picks->{_gather_num};
178  
179 $iSave_top_mute_picks->{_inbound} =
180 $DATA_SEISMIC_TXT . '/'
181 . $itemp_top_mute_picks_sorted_par_
182 . $iSave_top_mute_picks->{_file_in};
183  
184 $iSave_top_mute_picks->{_outbound} =
185 $DATA_SEISMIC_TXT . '/'
186 . $itop_mute_par_
187 . $iSave_top_mute_picks->{_file_in}
188 . $suffix;
189  
190 $cp->from( $iSave_top_mute_picks->{_inbound} );
191 $cp->to( $iSave_top_mute_picks->{_outbound} );
192 $cp[1] = $cp->Step();
193  
194 =head2
195  
196 append file name to an output list
197 itop_mute_file_list
198
199 =cut
200  
201 my $append = ("echo $itop_mute_par_$iSave_top_mute_picks->{_file_in}$suffix >>\\
202 $DATA_SEISMIC_TXT/$itop_mute_file_list$suffix_txt");
203
204 system($append);
205 print("$append\n");
206  
207 =head2
208  
209 DEFINE FLOW(S)
210  
211 =cut
212  
213 @items = ( $cp[1] );
214 $flow[1] = $run->modules( \@items );
215  
216 =head2
217  
218 RUN FLOW(S)
219  
220 =cut
221  
222 $run->flow( \$flow[1] );
223  
224 =head2
225  
226 LOG FLOW(S)TO SCREEN AND FILE
227  
228 =cut
229  
230 # print "$flow[1]\n";
231 #$log->file($flow[1]);
232  
233 } # end calc subroutine
234 1;