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

filter: Statementstmt 0.0% 0 / 84 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 15 Podpod 0.0% 0 / 11 totaltotal 0.0% 0 / 124 CC 8 SCAR 15.1
CC
8
Cov
0%
dr
6.0
dzratio
6.0
fr
6.0
CRAP 4.5
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::surelan;
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 SURELAN - compute residual-moveout semblance for cdp gathers based
25  
26 on z(h)*z(h) = z(0)*z(0) + r*h*h where z depth and h offset.
27  
28  
29  
30 surelan <stdin >stdout [optional parameters]
31  
32  
33  
34 Optional Parameters:
35  
36 nr=51 number of r-parameter samples
37  
38 dr=0.01 r-parameter sampling interval
39  
40 fr=-0.25 first value of b-parameter
41  
42 smute=1.5 samples with RMO stretch exceeding smute are zeroed
43  
44 dzratio=5 ratio of output to input depth sampling intervals
45  
46 nsmooth=dzratio*2+1 length of semblance num and den smoothing window
47  
48 verbose=0 =1 for diagnostic print on stderr
49  
50  
51  
52 Note:
53  
54 1. This program is part of Zhenyue Liu's velocity analysis technique.
55  
56 2. Input migrated traces should be sorted by cdp - surelan outputs a
57  
58 group of semblance traces every time cdp changes. Therefore, the
59  
60 output will be useful only if cdp gathers are input.
61  
62 3. The parameter r may take negative values. The range of r can be
63  
64 controlled by maximum of (z(h)*z(h)-z(0)*z(0))/(h*h)
65  
66 =head2 User's notes (Juan Lorenzo)
67 untested
68  
69 =cut
70  
71  
72 =head2 CHANGES and their DATES
73  
74 =cut
75  
76 use Moose;
77 our $VERSION = '0.0.1';
78  
79  
80 =head2 Import packages
81  
82 =cut
83  
84 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
85  
86 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
87 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
88  
89  
90 =head2 instantiation of packages
91  
92 =cut
93  
94 my $get = L_SU_global_constants->new();
95 my $Project = Project_config->new();
96 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
97 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
98 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
99  
100 my $PS_SEISMIC = $Project->PS_SEISMIC();
101  
102 my $var = $get->var();
103 my $on = $var->{_on};
104 my $off = $var->{_off};
105 my $true = $var->{_true};
106 my $false = $var->{_false};
107 my $empty_string = $var->{_empty_string};
108  
109 =head2 Encapsulated
110 hash of private variables
111  
112 =cut
113  
114 my $surelan = {
115 _dr => '',
116 _dzratio => '',
117 _fr => '',
118 _nr => '',
119 _nsmooth => '',
120 _smute => '',
121 _verbose => '',
122 _Step => '',
123 _note => '',
124  
125 };
126  
127 =head2 sub Step
128  
129 collects switches and assembles bash instructions
130 by adding the program name
131  
132 =cut
133  
134 sub Step {
135  
136 $surelan->{_Step} = 'surelan'.$surelan->{_Step};
137 return ( $surelan->{_Step} );
138  
139 }
140  
141  
142 =head2 sub note
143  
144 collects switches and assembles bash instructions
145 by adding the program name
146  
147 =cut
148  
149 sub note {
150  
151 $surelan->{_note} = 'surelan'.$surelan->{_note};
152 return ( $surelan->{_note} );
153  
154 }
155  
156  
157  
158 =head2 sub clear
159  
160 =cut
161  
162 sub clear {
163  
164 $surelan->{_dr} = '';
165 $surelan->{_dzratio} = '';
166 $surelan->{_fr} = '';
167 $surelan->{_nr} = '';
168 $surelan->{_nsmooth} = '';
169 $surelan->{_smute} = '';
170 $surelan->{_verbose} = '';
171 $surelan->{_Step} = '';
172 $surelan->{_note} = '';
173 }
174  
175  
176 =head2 sub dr
177  
178  
179 =cut
180  
181 sub dr {
182  
183 my ( $self,$dr ) = @_;
184 if ( $dr ne $empty_string ) {
185  
186 $surelan->{_dr} = $dr;
187 $surelan->{_note} = $surelan->{_note}.' dr='.$surelan->{_dr};
188 $surelan->{_Step} = $surelan->{_Step}.' dr='.$surelan->{_dr};
189  
190 } else {
191 print("surelan, dr, missing dr,\n");
192 }
193 }
194  
195  
196 =head2 sub dzratio
197  
198  
199 =cut
200  
201 sub dzratio {
202  
203 my ( $self,$dzratio ) = @_;
204 if ( $dzratio ne $empty_string ) {
205  
206 $surelan->{_dzratio} = $dzratio;
207 $surelan->{_note} = $surelan->{_note}.' dzratio='.$surelan->{_dzratio};
208 $surelan->{_Step} = $surelan->{_Step}.' dzratio='.$surelan->{_dzratio};
209  
210 } else {
211 print("surelan, dzratio, missing dzratio,\n");
212 }
213 }
214  
215  
216 =head2 sub fr
217  
218  
219 =cut
220  
221 sub fr {
222  
223 my ( $self,$fr ) = @_;
224 if ( $fr ne $empty_string ) {
225  
226 $surelan->{_fr} = $fr;
227 $surelan->{_note} = $surelan->{_note}.' fr='.$surelan->{_fr};
228 $surelan->{_Step} = $surelan->{_Step}.' fr='.$surelan->{_fr};
229  
230 } else {
231 print("surelan, fr, missing fr,\n");
232 }
233 }
234  
235  
236 =head2 sub nr
237  
238  
239 =cut
240  
241 sub nr {
242  
243 my ( $self,$nr ) = @_;
244 if ( $nr ne $empty_string ) {
245  
246 $surelan->{_nr} = $nr;
247 $surelan->{_note} = $surelan->{_note}.' nr='.$surelan->{_nr};
248 $surelan->{_Step} = $surelan->{_Step}.' nr='.$surelan->{_nr};
249  
250 } else {
251 print("surelan, nr, missing nr,\n");
252 }
253 }
254  
255  
256 =head2 sub nsmooth
257  
258  
259 =cut
260  
261 sub nsmooth {
262  
263 my ( $self,$nsmooth ) = @_;
264 if ( $nsmooth ne $empty_string ) {
265  
266 $surelan->{_nsmooth} = $nsmooth;
267 $surelan->{_note} = $surelan->{_note}.' nsmooth='.$surelan->{_nsmooth};
268 $surelan->{_Step} = $surelan->{_Step}.' nsmooth='.$surelan->{_nsmooth};
269  
270 } else {
271 print("surelan, nsmooth, missing nsmooth,\n");
272 }
273 }
274  
275  
276 =head2 sub smute
277  
278  
279 =cut
280  
281 sub smute {
282  
283 my ( $self,$smute ) = @_;
284 if ( $smute ne $empty_string ) {
285  
286 $surelan->{_smute} = $smute;
287 $surelan->{_note} = $surelan->{_note}.' smute='.$surelan->{_smute};
288 $surelan->{_Step} = $surelan->{_Step}.' smute='.$surelan->{_smute};
289  
290 } else {
291 print("surelan, smute, missing smute,\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 $surelan->{_verbose} = $verbose;
307 $surelan->{_note} = $surelan->{_note}.' verbose='.$surelan->{_verbose};
308 $surelan->{_Step} = $surelan->{_Step}.' verbose='.$surelan->{_verbose};
309  
310 } else {
311 print("surelan, 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 = 6;
325  
326 return($max_index);
327 }
328
329
330 1;