lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/suilog.pm untested

filter: Statementstmt 0.0% 0 / 70 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 9 totaltotal 0.0% 0 / 102 CC 6 SCAR 14.4
CC
6
Cov
0%
dt
6.0
nt
6.0
ntmin
6.0
CRAP 4.2
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::suilog;
2  
3 =head2 SYNOPSIS
4  
5 PERL PROGRAM NAME:
6  
7 AUTHOR: Juan Lorenzo (Perl module only)
8  
9 DATE:
10  
11 DESCRIPTION:
12  
13 Version:
14  
15 =head2 USE
16  
17 =head3 NOTES
18  
19 =head4 Examples
20  
21 =head2 SYNOPSIS
22  
23 =head3 SEISMIC UNIX NOTES
24 SUILOG -- time axis inverse log-stretch of seismic traces
25  
26  
27  
28 suilog nt= ntmin= <stdin >stdout
29  
30  
31  
32 Required parameters:
33  
34 nt= nt output from sulog prog
35  
36 ntmin= ntmin output from sulog prog
37  
38 dt= dt output from sulog prog
39  
40 Optional parameters:
41  
42 none
43  
44  
45  
46 NOTE: Parameters needed by suilog to reconstruct the
47  
48 original data may be input via a parameter file.
49  
50  
51  
52 EXAMPLE PROCESSING SEQUENCE:
53  
54 sulog outpar=logpar <data1 >data2
55  
56 suilog par=logpar <data2 >data3
57  
58  
59  
60 where logpar is the parameter file
61  
62  
63  
64  
65  
66
67  
68 Credits:
69  
70 CWP: Shuki Ronen, Chris Liner
71  
72  
73  
74 Caveats:
75  
76 amplitudes are not well preserved
77  
78  
79  
80 Trace header fields accessed: ns, dt
81  
82 Trace header fields modified: ns, dt
83  
84  
85  
86 =head2 User's notes (Juan Lorenzo)
87 untested
88  
89 =cut
90  
91  
92 =head2 CHANGES and their DATES
93  
94 =cut
95  
96 use Moose;
97 our $VERSION = '0.0.1';
98  
99  
100 =head2 Import packages
101  
102 =cut
103  
104 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
105  
106 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
107 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
108  
109  
110 =head2 instantiation of packages
111  
112 =cut
113  
114 my $get = L_SU_global_constants->new();
115 my $Project = Project_config->new();
116 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
117 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
118 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
119  
120 my $PS_SEISMIC = $Project->PS_SEISMIC();
121  
122 my $var = $get->var();
123 my $on = $var->{_on};
124 my $off = $var->{_off};
125 my $true = $var->{_true};
126 my $false = $var->{_false};
127 my $empty_string = $var->{_empty_string};
128  
129 =head2 Encapsulated
130 hash of private variables
131  
132 =cut
133  
134 my $suilog = {
135 _dt => '',
136 _nt => '',
137 _ntmin => '',
138 _outpar => '',
139 _par => '',
140 _Step => '',
141 _note => '',
142  
143 };
144  
145 =head2 sub Step
146  
147 collects switches and assembles bash instructions
148 by adding the program name
149  
150 =cut
151  
152 sub Step {
153  
154 $suilog->{_Step} = 'suilog'.$suilog->{_Step};
155 return ( $suilog->{_Step} );
156  
157 }
158  
159  
160 =head2 sub note
161  
162 collects switches and assembles bash instructions
163 by adding the program name
164  
165 =cut
166  
167 sub note {
168  
169 $suilog->{_note} = 'suilog'.$suilog->{_note};
170 return ( $suilog->{_note} );
171  
172 }
173  
174  
175  
176 =head2 sub clear
177  
178 =cut
179  
180 sub clear {
181  
182 $suilog->{_dt} = '';
183 $suilog->{_nt} = '';
184 $suilog->{_ntmin} = '';
185 $suilog->{_outpar} = '';
186 $suilog->{_par} = '';
187 $suilog->{_Step} = '';
188 $suilog->{_note} = '';
189 }
190  
191  
192 =head2 sub dt
193  
194  
195 =cut
196  
197 sub dt {
198  
199 my ( $self,$dt ) = @_;
200 if ( $dt ne $empty_string ) {
201  
202 $suilog->{_dt} = $dt;
203 $suilog->{_note} = $suilog->{_note}.' dt='.$suilog->{_dt};
204 $suilog->{_Step} = $suilog->{_Step}.' dt='.$suilog->{_dt};
205  
206 } else {
207 print("suilog, dt, missing dt,\n");
208 }
209 }
210  
211  
212 =head2 sub nt
213  
214  
215 =cut
216  
217 sub nt {
218  
219 my ( $self,$nt ) = @_;
220 if ( $nt ne $empty_string ) {
221  
222 $suilog->{_nt} = $nt;
223 $suilog->{_note} = $suilog->{_note}.' nt='.$suilog->{_nt};
224 $suilog->{_Step} = $suilog->{_Step}.' nt='.$suilog->{_nt};
225  
226 } else {
227 print("suilog, nt, missing nt,\n");
228 }
229 }
230  
231  
232 =head2 sub ntmin
233  
234  
235 =cut
236  
237 sub ntmin {
238  
239 my ( $self,$ntmin ) = @_;
240 if ( $ntmin ne $empty_string ) {
241  
242 $suilog->{_ntmin} = $ntmin;
243 $suilog->{_note} = $suilog->{_note}.' ntmin='.$suilog->{_ntmin};
244 $suilog->{_Step} = $suilog->{_Step}.' ntmin='.$suilog->{_ntmin};
245  
246 } else {
247 print("suilog, ntmin, missing ntmin,\n");
248 }
249 }
250  
251  
252 =head2 sub outpar
253  
254  
255 =cut
256  
257 sub outpar {
258  
259 my ( $self,$outpar ) = @_;
260 if ( $outpar ne $empty_string ) {
261  
262 $suilog->{_outpar} = $outpar;
263 $suilog->{_note} = $suilog->{_note}.' outpar='.$suilog->{_outpar};
264 $suilog->{_Step} = $suilog->{_Step}.' outpar='.$suilog->{_outpar};
265  
266 } else {
267 print("suilog, outpar, missing outpar,\n");
268 }
269 }
270  
271  
272 =head2 sub par
273  
274  
275 =cut
276  
277 sub par {
278  
279 my ( $self,$par ) = @_;
280 if ( $par ne $empty_string ) {
281  
282 $suilog->{_par} = $par;
283 $suilog->{_note} = $suilog->{_note}.' par='.$suilog->{_par};
284 $suilog->{_Step} = $suilog->{_Step}.' par='.$suilog->{_par};
285  
286 } else {
287 print("suilog, par, missing par,\n");
288 }
289 }
290  
291  
292 =head2 sub get_max_index
293  
294 max index = number of input variables -1
295
296 =cut
297
298 sub get_max_index {
299 my ($self) = @_;
300 my $max_index = 4;
301  
302 return($max_index);
303 }
304
305
306 1;