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

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