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

filter: Statementstmt 0.0% 0 / 40 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 55 CC 3 SCAR 13.3
CC
3
Cov
0%
cdp_num
6.0
file_in
6.0
clear
2.0
CRAP 3.8
1 package App::SeismicUnixGui::big_streams::iWrite_All_iva_out;
2  
3 use Moose;
4 our $VERSION = '0.0.1';
5  
6 =pod
7  
8 =head1 DOCUMENTATION
9  
10 =head2 SYNOPSIS
11  
12 PERL PROGRAM NAME: iWrite_All_iva_out
13 AUTHOR: Juan Lorenzo
14 DATE: April 9 2009
15 sept. 13 2013
16 oct. 21 2013
17 July 15 2015
18 Purpose: Write out best vpicked files from iWrite_All_iva_out
19  
20 DESCRIPTION:
21 Version: 1.1
22 update to oop
23  
24 =head2 USE
25  
26 =head3 NOTES
27  
28 =head4
29 Examples
30  
31 =head3 SEISMIC UNIX NOTES
32  
33 =head4 CHANGES and their DATES
34  
35  
36 =cut
37  
38 =pod
39  
40 =head3 STEPS
41  
42 1. define the types of variables you are using
43 these would be the values you enter into
44 each of the Seismic Unix programs each of the
45 Seismic Unix programs
46  
47 2. build a list or hash with all the possible variable
48 names you may use and you can even change them
49  
50 =cut
51  
52 =pod
53  
54 set defaults
55  
56 VELAN DATA
57 m/s
58  
59
60 =cut
61  
62 my $iWrite_All_iva_out = {
63 _cdp_num => '',
64 _file_in => ''
65 };
66  
67 =pod =head3
68  
69 Import directory definitions
70  
71 =cut
72  
73 use App::SeismicUnixGui::misc::SeismicUnix qw($on $off $in $to $go);
74 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
75 my $Project = Project_config->new();
76 my ($PL_SEISMIC) = $Project->PL_SEISMIC();
77  
78 =head2 subroutine clear
79  
80 sets all variable strings to ''
81  
82 =cut
83  
84 sub clear {
85 $iWrite_All_iva_out->{_cdp_num} = '';
86 $iWrite_All_iva_out->{_file_in} = '';
87 }
88  
89 =pod
90  
91 declare local variables
92  
93 =cut
94  
95 my ( @sufile_in, @suffix, @vpicks_stdin );
96 my ( @cpfile_in, @cpfile_out, @catfile_inbound );
97 my ( @storefile_outbound, @flow );
98 my ( @textfile_in, @duplicatefile_in, @duplicatefile_out );
99 my ( @Tvel_duplicate_inbound, @Tvel_duplicate_outbound );
100  
101 =pod
102  
103 =head2 subroutine cdp
104  
105 sets cdp number to consider
106  
107 =cut
108  
109 sub cdp_num {
110 my ( $variable, $cdp_num ) = @_;
111 $iWrite_All_iva_out->{_cdp_num} = $cdp_num if defined($cdp_num);
112 }
113  
114 =pod =head3
115  
116 subroutine file_in
117 Required file name
118 on which to perform velocity analyses
119  
120 =cut
121  
122 sub file_in {
123 my ( $variable, $file_in ) = @_;
124 $iWrite_All_iva_out->{_file_in} = $file_in if defined($file_in);
125  
126 #print("file name is $iWrite_All_iva_out->{_file_in} \n\n");
127 }
128  
129 =pod =head3
130  
131 subroutine flows
132 read in : ivpicks_old from the PL directory
133 write out: 'Final_ivpicks_iva' to the PL directory
134  
135 'ivpicks_old' is stored locally
136  
137 =cut
138  
139 sub flows {
140  
141 # sufile names
142 $sufile_in[1] = $iWrite_All_iva_out->{_file_in};
143  
144 # file suffixes
145 $suffix[1] = '_cdp' . $iWrite_All_iva_out->{_cdp_num};
146 $vpicks_stdin[1] = 'ivpicks_old';
147  
148 # cp text file names
149 $cpfile_in[1] = $vpicks_stdin[1];
150 $cpfile_out[1] = 'Final_ivpicks_iva';
151  
152 # cat file names
153 $catfile_inbound[1] =
154 $PL_SEISMIC . '/' . $cpfile_in[1] . '_' . $sufile_in[1] . $suffix[1];
155 $storefile_outbound[1] =
156 $PL_SEISMIC . '/' . $cpfile_out[1] . '_' . $sufile_in[1] . $suffix[1];
157  
158 $textfile_in[1] =
159 'ivpicks_old' . '_' . $iWrite_All_iva_out->{_file_in} . $suffix[1];
160  
161 $duplicatefile_in[1] =
162 'ivpicks_' . $iWrite_All_iva_out->{_file_in} . $suffix[1];
163  
164 $Tvel_duplicate_inbound[1] = $PL_SEISMIC . '/' . $duplicatefile_in[1];
165  
166 $duplicatefile_out[1] =
167 'ivpicks_old' . '_' . $iWrite_All_iva_out->{_file_in} . $suffix[1];
168  
169 $Tvel_duplicate_outbound[1] = $PL_SEISMIC . '/' . $duplicatefile_out[1];
170  
171 # DEFINE FLOW(S)
172  
173 $flow[1] = (
174 " \\
175 cp $Tvel_duplicate_inbound[1] $Tvel_duplicate_outbound[1]; \\
176 "
177 );
178 $flow[2] = (
179 " \\
180 cp $catfile_inbound[1] $storefile_outbound[1]; \\
181 "
182 );
183  
184 # RUN FLOW(S)
185 system $flow[1];
186 system $flow[2];
187  
188 # system 'echo', $flow[1];
189 # system 'echo', $flow[2];
190  
191 } #end flows
192  
193 1;