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

filter: Statementstmt 0.0% 0 / 56 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 80 CC 4 SCAR 13.1
CC
4
Cov
0%
dt
6.0
flip
6.0
rv
6.0
CRAP 3.7
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sureduce;
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 SUREDUCE - convert traces to display in reduced time ",
25  
26  
27  
28 sureduce <stdin >stdout rv=
29  
30  
31  
32 Required parameters:
33  
34 dt=tr.dt if not set in header, dt is mandatory
35  
36  
37  
38 Optional parameters:
39  
40 rv=8.0 reducing velocity in km/sec ",
41  
42  
43  
44 Note: Useful for plotting refraction seismic data.
45  
46 To remove reduction, do:
47  
48 suflip < reduceddata.su flip=3 | sureduce rv=RV > flip.su
49  
50 suflip < flip.su flip=3 > unreduceddata.su
51  
52  
53  
54 Trace header fields accessed: dt, ns, offset
55  
56 Trace header fields modified: none
57  
58  
59  
60  
61  
62 Author: UC Davis: Mike Begnaud March 1995
63  
64  
65  
66  
67  
68 Trace header fields accessed: ns, dt, offset
69  
70  
71  
72 =head2 User's notes (Juan Lorenzo)
73 untested
74  
75 =cut
76  
77  
78 =head2 CHANGES and their DATES
79  
80 =cut
81  
82 use Moose;
83 our $VERSION = '0.0.1';
84  
85  
86 =head2 Import packages
87  
88 =cut
89  
90 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
91  
92 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
93 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
94  
95  
96 =head2 instantiation of packages
97  
98 =cut
99  
100 my $get = L_SU_global_constants->new();
101 my $Project = Project_config->new();
102 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
103 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
104 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
105  
106 my $PS_SEISMIC = $Project->PS_SEISMIC();
107  
108 my $var = $get->var();
109 my $on = $var->{_on};
110 my $off = $var->{_off};
111 my $true = $var->{_true};
112 my $false = $var->{_false};
113 my $empty_string = $var->{_empty_string};
114  
115 =head2 Encapsulated
116 hash of private variables
117  
118 =cut
119  
120 my $sureduce = {
121 _dt => '',
122 _flip => '',
123 _rv => '',
124 _Step => '',
125 _note => '',
126  
127 };
128  
129 =head2 sub Step
130  
131 collects switches and assembles bash instructions
132 by adding the program name
133  
134 =cut
135  
136 sub Step {
137  
138 $sureduce->{_Step} = 'sureduce'.$sureduce->{_Step};
139 return ( $sureduce->{_Step} );
140  
141 }
142  
143  
144 =head2 sub note
145  
146 collects switches and assembles bash instructions
147 by adding the program name
148  
149 =cut
150  
151 sub note {
152  
153 $sureduce->{_note} = 'sureduce'.$sureduce->{_note};
154 return ( $sureduce->{_note} );
155  
156 }
157  
158  
159  
160 =head2 sub clear
161  
162 =cut
163  
164 sub clear {
165  
166 $sureduce->{_dt} = '';
167 $sureduce->{_flip} = '';
168 $sureduce->{_rv} = '';
169 $sureduce->{_Step} = '';
170 $sureduce->{_note} = '';
171 }
172  
173  
174 =head2 sub dt
175  
176  
177 =cut
178  
179 sub dt {
180  
181 my ( $self,$dt ) = @_;
182 if ( $dt ne $empty_string ) {
183  
184 $sureduce->{_dt} = $dt;
185 $sureduce->{_note} = $sureduce->{_note}.' dt='.$sureduce->{_dt};
186 $sureduce->{_Step} = $sureduce->{_Step}.' dt='.$sureduce->{_dt};
187  
188 } else {
189 print("sureduce, dt, missing dt,\n");
190 }
191 }
192  
193  
194 =head2 sub flip
195  
196  
197 =cut
198  
199 sub flip {
200  
201 my ( $self,$flip ) = @_;
202 if ( $flip ne $empty_string ) {
203  
204 $sureduce->{_flip} = $flip;
205 $sureduce->{_note} = $sureduce->{_note}.' flip='.$sureduce->{_flip};
206 $sureduce->{_Step} = $sureduce->{_Step}.' flip='.$sureduce->{_flip};
207  
208 } else {
209 print("sureduce, flip, missing flip,\n");
210 }
211 }
212  
213  
214 =head2 sub rv
215  
216  
217 =cut
218  
219 sub rv {
220  
221 my ( $self,$rv ) = @_;
222 if ( $rv ne $empty_string ) {
223  
224 $sureduce->{_rv} = $rv;
225 $sureduce->{_note} = $sureduce->{_note}.' rv='.$sureduce->{_rv};
226 $sureduce->{_Step} = $sureduce->{_Step}.' rv='.$sureduce->{_rv};
227  
228 } else {
229 print("sureduce, rv, missing rv,\n");
230 }
231 }
232  
233  
234 =head2 sub get_max_index
235  
236 max index = number of input variables -1
237
238 =cut
239
240 sub get_max_index {
241 my ($self) = @_;
242 my $max_index = 1;
243  
244 return($max_index);
245 }
246
247
248 1;