lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/sushift.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
fill
6.0
tmax
6.0
CRAP 4.2
1 package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sushift;
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 SUSHIFT - shifted/windowed traces in time
25  
26  
27  
28 sushift <stdin >stdout [tmin= ] [tmax= ]
29  
30  
31  
32 tmin= min time to pass
33  
34 tmax= max time to pass
35  
36 dt= sample rate in microseconds
37  
38 fill=0.0 value to place in padded samples
39  
40  
41  
42 (defaults for tmin and tmax are calculated from the first trace.
43  
44 verbose= 1 echos parameters to stdout
45  
46  
47  
48 Background :
49  
50 tmin and tmax must be given in seconds
51  
52  
53  
54 In the high resolution single channel seismic profiling the sample
55  
56 interval is short, the shot rate and the number of samples are high.
57  
58 To reduce the file size the delrt time is changed during a profiling
59  
60 trip. To process and display a seismic section a constant delrt is
61  
62 needed. This program does this job.
63  
64  
65  
66 The SEG-Y header variable delrt (delay in ms) is a short integer.
67  
68 That's why in the example shown below delrt is rounded to 123 !
69  
70  
71  
72 ... | sushift tmin=0.1234 tmax=0.2234 | ...
73  
74  
75  
76 The dt= and fill= options are intended for manipulating velocity
77  
78 volumes in trace format. In particular models which were hung
79  
80 from the water bottom when created & which then need to have the
81  
82 water layer added.
83  
84  
85  
86  
87  
88  
89  
90 Author:
91  
92  
93  
94 Toralf Foerster
95  
96 Institut fuer Ostseeforschung Warnemuende
97  
98 Sektion Marine Geologie
99  
100 Seestrasse 15
101  
102 D-18119 Rostock, Germany
103  
104  
105  
106 Trace header fields accessed: ns, delrt
107  
108 Trace header fields modified: ns, delrt
109  
110  
111  
112 =head2 User's notes (Juan Lorenzo)
113 untested
114  
115 =cut
116  
117  
118 =head2 CHANGES and their DATES
119  
120 =cut
121  
122 use Moose;
123 our $VERSION = '0.0.1';
124  
125  
126 =head2 Import packages
127  
128 =cut
129  
130 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
131  
132 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
133 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
134  
135  
136 =head2 instantiation of packages
137  
138 =cut
139  
140 my $get = L_SU_global_constants->new();
141 my $Project = Project_config->new();
142 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
143 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
144 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
145  
146 my $PS_SEISMIC = $Project->PS_SEISMIC();
147  
148 my $var = $get->var();
149 my $on = $var->{_on};
150 my $off = $var->{_off};
151 my $true = $var->{_true};
152 my $false = $var->{_false};
153 my $empty_string = $var->{_empty_string};
154  
155 =head2 Encapsulated
156 hash of private variables
157  
158 =cut
159  
160 my $sushift = {
161 _dt => '',
162 _fill => '',
163 _tmax => '',
164 _tmin => '',
165 _verbose => '',
166 _Step => '',
167 _note => '',
168  
169 };
170  
171 =head2 sub Step
172  
173 collects switches and assembles bash instructions
174 by adding the program name
175  
176 =cut
177  
178 sub Step {
179  
180 $sushift->{_Step} = 'sushift'.$sushift->{_Step};
181 return ( $sushift->{_Step} );
182  
183 }
184  
185  
186 =head2 sub note
187  
188 collects switches and assembles bash instructions
189 by adding the program name
190  
191 =cut
192  
193 sub note {
194  
195 $sushift->{_note} = 'sushift'.$sushift->{_note};
196 return ( $sushift->{_note} );
197  
198 }
199  
200  
201  
202 =head2 sub clear
203  
204 =cut
205  
206 sub clear {
207  
208 $sushift->{_dt} = '';
209 $sushift->{_fill} = '';
210 $sushift->{_tmax} = '';
211 $sushift->{_tmin} = '';
212 $sushift->{_verbose} = '';
213 $sushift->{_Step} = '';
214 $sushift->{_note} = '';
215 }
216  
217  
218 =head2 sub dt
219  
220  
221 =cut
222  
223 sub dt {
224  
225 my ( $self,$dt ) = @_;
226 if ( $dt ne $empty_string ) {
227  
228 $sushift->{_dt} = $dt;
229 $sushift->{_note} = $sushift->{_note}.' dt='.$sushift->{_dt};
230 $sushift->{_Step} = $sushift->{_Step}.' dt='.$sushift->{_dt};
231  
232 } else {
233 print("sushift, dt, missing dt,\n");
234 }
235 }
236  
237  
238 =head2 sub fill
239  
240  
241 =cut
242  
243 sub fill {
244  
245 my ( $self,$fill ) = @_;
246 if ( $fill ne $empty_string ) {
247  
248 $sushift->{_fill} = $fill;
249 $sushift->{_note} = $sushift->{_note}.' fill='.$sushift->{_fill};
250 $sushift->{_Step} = $sushift->{_Step}.' fill='.$sushift->{_fill};
251  
252 } else {
253 print("sushift, fill, missing fill,\n");
254 }
255 }
256  
257  
258 =head2 sub tmax
259  
260  
261 =cut
262  
263 sub tmax {
264  
265 my ( $self,$tmax ) = @_;
266 if ( $tmax ne $empty_string ) {
267  
268 $sushift->{_tmax} = $tmax;
269 $sushift->{_note} = $sushift->{_note}.' tmax='.$sushift->{_tmax};
270 $sushift->{_Step} = $sushift->{_Step}.' tmax='.$sushift->{_tmax};
271  
272 } else {
273 print("sushift, tmax, missing tmax,\n");
274 }
275 }
276  
277  
278 =head2 sub tmin
279  
280  
281 =cut
282  
283 sub tmin {
284  
285 my ( $self,$tmin ) = @_;
286 if ( $tmin ne $empty_string ) {
287  
288 $sushift->{_tmin} = $tmin;
289 $sushift->{_note} = $sushift->{_note}.' tmin='.$sushift->{_tmin};
290 $sushift->{_Step} = $sushift->{_Step}.' tmin='.$sushift->{_tmin};
291  
292 } else {
293 print("sushift, tmin, missing tmin,\n");
294 }
295 }
296  
297  
298 =head2 sub verbose
299  
300  
301 =cut
302  
303 sub verbose {
304  
305 my ( $self,$verbose ) = @_;
306 if ( $verbose ne $empty_string ) {
307  
308 $sushift->{_verbose} = $verbose;
309 $sushift->{_note} = $sushift->{_note}.' verbose='.$sushift->{_verbose};
310 $sushift->{_Step} = $sushift->{_Step}.' verbose='.$sushift->{_verbose};
311  
312 } else {
313 print("sushift, verbose, missing verbose,\n");
314 }
315 }
316  
317  
318 =head2 sub get_max_index
319  
320 max index = number of input variables -1
321
322 =cut
323
324 sub get_max_index {
325 my ($self) = @_;
326 my $max_index = 4;
327  
328 return($max_index);
329 }
330
331
332 1;