lib/App/SeismicUnixGui/sunix/filter/sugroll.pm untested

filter: Statementstmt 0.0% 0 / 77 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 10 totaltotal 0.0% 0 / 113 CC 7 SCAR 14.8
CC
7
Cov
0%
dt
6.0
nrot
6.0
nx
6.0
CRAP 4.4
1 package App::SeismicUnixGui::sunix::filter::sugroll;
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 SUGROLL - Ground roll supression using Karhunen-Loeve transform
25  
26  
27  
28 sugroll <infile >outfile [optional parameters]
29  
30  
31  
32 Optional Parameters:
33  
34 dt=tr.dt (from header) time sampling interval (secs)
35  
36 nx=ntr (counted from data) number of horizontal samples (traces)
37  
38 sb=0 1 for the graund-roll
39  
40 verbose=0 verbose = 1 echoes information
41  
42 nrot=3 the principal components for the m largest eigenvalues
43  
44 tmpdir= if non-empty, use the value as a directory path
45  
46 prefix for storing temporary files; else if the
47  
48 the CWP_TMPDIR environment variable is set use
49  
50 its value for the path; else use tmpfile()
51  
52  
53  
54 Notes:
55  
56 The method developed here is to extract the ground-roll from the
57  
58 common-shot gathers using Karhunen-Loeve transform, and then to substract
59  
60 it from the original data. The advantage is the ground-roll is suppresed
61  
62 with negligible distortion of the signal.
63  
64  
65  
66  
67  
68  
69  
70 Credits: BRGM: Adnand Bitri, 1999.
71  
72  
73  
74 Reference:
75  
76 Xuewei Liu, F., 1999, Ground roll supresion using the Karhunen-Loeve transform
77  
78 Geophysics vol. 64 No. 2 pp 564-566
79  
80  
81  
82 Trace header fields accessed: ns, dt
83  
84 Trace header fields modified: dt
85  
86  
87  
88 =head2 User's notes (Juan Lorenzo)
89 untested
90  
91 =cut
92  
93  
94 =head2 CHANGES and their DATES
95  
96 =cut
97  
98 use Moose;
99 our $VERSION = '0.0.1';
100  
101  
102 =head2 Import packages
103  
104 =cut
105  
106 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
107  
108 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
109 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
110  
111  
112 =head2 instantiation of packages
113  
114 =cut
115  
116 my $get = L_SU_global_constants->new();
117 my $Project = Project_config->new();
118 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
119 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
120 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
121  
122 my $PS_SEISMIC = $Project->PS_SEISMIC();
123  
124 my $var = $get->var();
125 my $on = $var->{_on};
126 my $off = $var->{_off};
127 my $true = $var->{_true};
128 my $false = $var->{_false};
129 my $empty_string = $var->{_empty_string};
130  
131 =head2 Encapsulated
132 hash of private variables
133  
134 =cut
135  
136 my $sugroll = {
137 _dt => '',
138 _nrot => '',
139 _nx => '',
140 _sb => '',
141 _tmpdir => '',
142 _verbose => '',
143 _Step => '',
144 _note => '',
145  
146 };
147  
148 =head2 sub Step
149  
150 collects switches and assembles bash instructions
151 by adding the program name
152  
153 =cut
154  
155 sub Step {
156  
157 $sugroll->{_Step} = 'sugroll'.$sugroll->{_Step};
158 return ( $sugroll->{_Step} );
159  
160 }
161  
162  
163 =head2 sub note
164  
165 collects switches and assembles bash instructions
166 by adding the program name
167  
168 =cut
169  
170 sub note {
171  
172 $sugroll->{_note} = 'sugroll'.$sugroll->{_note};
173 return ( $sugroll->{_note} );
174  
175 }
176  
177  
178  
179 =head2 sub clear
180  
181 =cut
182  
183 sub clear {
184  
185 $sugroll->{_dt} = '';
186 $sugroll->{_nrot} = '';
187 $sugroll->{_nx} = '';
188 $sugroll->{_sb} = '';
189 $sugroll->{_tmpdir} = '';
190 $sugroll->{_verbose} = '';
191 $sugroll->{_Step} = '';
192 $sugroll->{_note} = '';
193 }
194  
195  
196 =head2 sub dt
197  
198  
199 =cut
200  
201 sub dt {
202  
203 my ( $self,$dt ) = @_;
204 if ( $dt ne $empty_string ) {
205  
206 $sugroll->{_dt} = $dt;
207 $sugroll->{_note} = $sugroll->{_note}.' dt='.$sugroll->{_dt};
208 $sugroll->{_Step} = $sugroll->{_Step}.' dt='.$sugroll->{_dt};
209  
210 } else {
211 print("sugroll, dt, missing dt,\n");
212 }
213 }
214  
215  
216 =head2 sub nrot
217  
218  
219 =cut
220  
221 sub nrot {
222  
223 my ( $self,$nrot ) = @_;
224 if ( $nrot ne $empty_string ) {
225  
226 $sugroll->{_nrot} = $nrot;
227 $sugroll->{_note} = $sugroll->{_note}.' nrot='.$sugroll->{_nrot};
228 $sugroll->{_Step} = $sugroll->{_Step}.' nrot='.$sugroll->{_nrot};
229  
230 } else {
231 print("sugroll, nrot, missing nrot,\n");
232 }
233 }
234  
235  
236 =head2 sub nx
237  
238  
239 =cut
240  
241 sub nx {
242  
243 my ( $self,$nx ) = @_;
244 if ( $nx ne $empty_string ) {
245  
246 $sugroll->{_nx} = $nx;
247 $sugroll->{_note} = $sugroll->{_note}.' nx='.$sugroll->{_nx};
248 $sugroll->{_Step} = $sugroll->{_Step}.' nx='.$sugroll->{_nx};
249  
250 } else {
251 print("sugroll, nx, missing nx,\n");
252 }
253 }
254  
255  
256 =head2 sub sb
257  
258  
259 =cut
260  
261 sub sb {
262  
263 my ( $self,$sb ) = @_;
264 if ( $sb ne $empty_string ) {
265  
266 $sugroll->{_sb} = $sb;
267 $sugroll->{_note} = $sugroll->{_note}.' sb='.$sugroll->{_sb};
268 $sugroll->{_Step} = $sugroll->{_Step}.' sb='.$sugroll->{_sb};
269  
270 } else {
271 print("sugroll, sb, missing sb,\n");
272 }
273 }
274  
275  
276 =head2 sub tmpdir
277  
278  
279 =cut
280  
281 sub tmpdir {
282  
283 my ( $self,$tmpdir ) = @_;
284 if ( $tmpdir ne $empty_string ) {
285  
286 $sugroll->{_tmpdir} = $tmpdir;
287 $sugroll->{_note} = $sugroll->{_note}.' tmpdir='.$sugroll->{_tmpdir};
288 $sugroll->{_Step} = $sugroll->{_Step}.' tmpdir='.$sugroll->{_tmpdir};
289  
290 } else {
291 print("sugroll, tmpdir, missing tmpdir,\n");
292 }
293 }
294  
295  
296 =head2 sub verbose
297  
298  
299 =cut
300  
301 sub verbose {
302  
303 my ( $self,$verbose ) = @_;
304 if ( $verbose ne $empty_string ) {
305  
306 $sugroll->{_verbose} = $verbose;
307 $sugroll->{_note} = $sugroll->{_note}.' verbose='.$sugroll->{_verbose};
308 $sugroll->{_Step} = $sugroll->{_Step}.' verbose='.$sugroll->{_verbose};
309  
310 } else {
311 print("sugroll, verbose, missing verbose,\n");
312 }
313 }
314  
315  
316 =head2 sub get_max_index
317  
318 max index = number of input variables -1
319
320 =cut
321
322 sub get_max_index {
323 my ($self) = @_;
324 my $max_index = 5;
325  
326 return($max_index);
327 }
328
329
330 1;