lib/App/SeismicUnixGui/sunix/plot/suxcontour.pm untested

filter: Statementstmt 0.0% 0 / 91 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 16 Podpod 0.0% 0 / 12 totaltotal 0.0% 0 / 135 CC 9 SCAR 15.4
CC
9
Cov
0%
d1
6.0
d2
6.0
f1
6.0
CRAP 4.7
1 package App::SeismicUnixGui::sunix::plot::suxcontour;
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 SUXCONTOUR - X CONTOUR plot of Seismic UNIX tracefile via vector plot call
25  
26  
27  
28 suxwigb <stdin [optional parameters] | ...
29  
30  
31  
32 Optional parameters:
33  
34 key=(keyword) if set, the values of x2 are set from header field
35  
36 specified by keyword
37  
38 n2=tr.ntr or number of traces in the data set (ntr is an alias for n2)
39  
40 d1=tr.d1 or tr.dt/10^6 sampling interval in the fast dimension
41  
42 =.004 for seismic (if not set)
43  
44 =1.0 for nonseismic (if not set)
45  
46 d2=tr.d2 sampling interval in the slow dimension
47  
48 =1.0 (if not set)
49  
50 f1=tr.f1 or tr.delrt/10^3 or 0.0 first sample in the fast dimension
51  
52 f2=tr.f2 or tr.tracr or tr.tracl first sample in the slow dimension
53  
54 =1.0 for seismic (if not set)
55  
56 =d2 for nonseismic (if not set)
57  
58  
59  
60 verbose=0 =1 to print some useful information
61  
62  
63  
64 tmpdir= if non-empty, use the value as a directory path
65  
66 prefix for storing temporary files; else if the
67  
68 the CWP_TMPDIR environment variable is set use
69  
70 its value for the path; else use tmpfile()
71  
72  
73  
74 Note that for seismic time domain data, the "fast dimension" is
75  
76 time and the "slow dimension" is usually trace number or range.
77  
78 Also note that "foreign" data tapes may have something unexpected
79  
80 in the d2,f2 fields, use segyclean to clear these if you can afford
81  
82 the processing time or use d2= f2= to override the header values if
83  
84 not.
85  
86  
87  
88 If key=keyword is set, then the values of x2 are taken from the header
89  
90 field represented by the keyword (for example key=offset, will show
91  
92 traces in true offset). This permit unequally spaced traces to be plotted.
93  
94 Type sukeyword -o to see the complete list of SU keywords.
95  
96  
97  
98 This program is really just a wrapper for the plotting program: xcontour
99  
100 See the xcontour selfdoc for the remaining parameters.
101  
102  
103  
104  
105  
106  
107  
108 Credits:
109  
110  
111  
112 CWP: Dave Hale and Zhiming Li (xwigb, etc.)
113  
114 Jack Cohen and John Stockwell (suxwigb, etc.)
115  
116 Delphi: Alexander Koek, added support for irregularly spaced traces
117  
118 Aarhus University: Morten W. Pedersen copied everything from the xwigb
119  
120 source and just replaced all occurencies of the word
121  
122 xwigb with xcountour ;-)
123  
124  
125  
126 Notes:
127  
128 When the number of traces isn't known, we need to count
129  
130 the traces for xcontour. You can make this value "known"
131  
132 either by getparring n2 or by having the ntr field set
133  
134 in the trace header. A getparred value takes precedence
135  
136 over the value in the trace header.
137  
138  
139  
140 When we must compute ntr, we don't allocate a 2-d array,
141  
142 but just content ourselves with copying trace by trace from
143  
144 the data "file" to the pipe into the plotting program.
145  
146 Although we could use tr.data, we allocate a trace buffer
147  
148 for code clarity.
149  
150  
151  
152 =head2 User's notes (Juan Lorenzo)
153 untested
154  
155 =cut
156  
157  
158 =head2 CHANGES and their DATES
159  
160 =cut
161  
162 use Moose;
163 our $VERSION = '0.0.1';
164  
165  
166 =head2 Import packages
167  
168 =cut
169  
170 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
171  
172 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
173 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
174  
175  
176 =head2 instantiation of packages
177  
178 =cut
179  
180 my $get = L_SU_global_constants->new();
181 my $Project = Project_config->new();
182 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
183 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
184 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
185  
186 my $PS_SEISMIC = $Project->PS_SEISMIC();
187  
188 my $var = $get->var();
189 my $on = $var->{_on};
190 my $off = $var->{_off};
191 my $true = $var->{_true};
192 my $false = $var->{_false};
193 my $empty_string = $var->{_empty_string};
194  
195 =head2 Encapsulated
196 hash of private variables
197  
198 =cut
199  
200 my $suxcontour = {
201 _d1 => '',
202 _d2 => '',
203 _f1 => '',
204 _f2 => '',
205 _key => '',
206 _n2 => '',
207 _tmpdir => '',
208 _verbose => '',
209 _Step => '',
210 _note => '',
211  
212 };
213  
214 =head2 sub Step
215  
216 collects switches and assembles bash instructions
217 by adding the program name
218  
219 =cut
220  
221 sub Step {
222  
223 $suxcontour->{_Step} = 'suxcontour'.$suxcontour->{_Step};
224 return ( $suxcontour->{_Step} );
225  
226 }
227  
228  
229 =head2 sub note
230  
231 collects switches and assembles bash instructions
232 by adding the program name
233  
234 =cut
235  
236 sub note {
237  
238 $suxcontour->{_note} = 'suxcontour'.$suxcontour->{_note};
239 return ( $suxcontour->{_note} );
240  
241 }
242  
243  
244  
245 =head2 sub clear
246  
247 =cut
248  
249 sub clear {
250  
251 $suxcontour->{_d1} = '';
252 $suxcontour->{_d2} = '';
253 $suxcontour->{_f1} = '';
254 $suxcontour->{_f2} = '';
255 $suxcontour->{_key} = '';
256 $suxcontour->{_n2} = '';
257 $suxcontour->{_tmpdir} = '';
258 $suxcontour->{_verbose} = '';
259 $suxcontour->{_Step} = '';
260 $suxcontour->{_note} = '';
261 }
262  
263  
264 =head2 sub d1
265  
266  
267 =cut
268  
269 sub d1 {
270  
271 my ( $self,$d1 ) = @_;
272 if ( $d1 ne $empty_string ) {
273  
274 $suxcontour->{_d1} = $d1;
275 $suxcontour->{_note} = $suxcontour->{_note}.' d1='.$suxcontour->{_d1};
276 $suxcontour->{_Step} = $suxcontour->{_Step}.' d1='.$suxcontour->{_d1};
277  
278 } else {
279 print("suxcontour, d1, missing d1,\n");
280 }
281 }
282  
283  
284 =head2 sub d2
285  
286  
287 =cut
288  
289 sub d2 {
290  
291 my ( $self,$d2 ) = @_;
292 if ( $d2 ne $empty_string ) {
293  
294 $suxcontour->{_d2} = $d2;
295 $suxcontour->{_note} = $suxcontour->{_note}.' d2='.$suxcontour->{_d2};
296 $suxcontour->{_Step} = $suxcontour->{_Step}.' d2='.$suxcontour->{_d2};
297  
298 } else {
299 print("suxcontour, d2, missing d2,\n");
300 }
301 }
302  
303  
304 =head2 sub f1
305  
306  
307 =cut
308  
309 sub f1 {
310  
311 my ( $self,$f1 ) = @_;
312 if ( $f1 ne $empty_string ) {
313  
314 $suxcontour->{_f1} = $f1;
315 $suxcontour->{_note} = $suxcontour->{_note}.' f1='.$suxcontour->{_f1};
316 $suxcontour->{_Step} = $suxcontour->{_Step}.' f1='.$suxcontour->{_f1};
317  
318 } else {
319 print("suxcontour, f1, missing f1,\n");
320 }
321 }
322  
323  
324 =head2 sub f2
325  
326  
327 =cut
328  
329 sub f2 {
330  
331 my ( $self,$f2 ) = @_;
332 if ( $f2 ne $empty_string ) {
333  
334 $suxcontour->{_f2} = $f2;
335 $suxcontour->{_note} = $suxcontour->{_note}.' f2='.$suxcontour->{_f2};
336 $suxcontour->{_Step} = $suxcontour->{_Step}.' f2='.$suxcontour->{_f2};
337  
338 } else {
339 print("suxcontour, f2, missing f2,\n");
340 }
341 }
342  
343  
344 =head2 sub key
345  
346  
347 =cut
348  
349 sub key {
350  
351 my ( $self,$key ) = @_;
352 if ( $key ne $empty_string ) {
353  
354 $suxcontour->{_key} = $key;
355 $suxcontour->{_note} = $suxcontour->{_note}.' key='.$suxcontour->{_key};
356 $suxcontour->{_Step} = $suxcontour->{_Step}.' key='.$suxcontour->{_key};
357  
358 } else {
359 print("suxcontour, key, missing key,\n");
360 }
361 }
362  
363  
364 =head2 sub n2
365  
366  
367 =cut
368  
369 sub n2 {
370  
371 my ( $self,$n2 ) = @_;
372 if ( $n2 ne $empty_string ) {
373  
374 $suxcontour->{_n2} = $n2;
375 $suxcontour->{_note} = $suxcontour->{_note}.' n2='.$suxcontour->{_n2};
376 $suxcontour->{_Step} = $suxcontour->{_Step}.' n2='.$suxcontour->{_n2};
377  
378 } else {
379 print("suxcontour, n2, missing n2,\n");
380 }
381 }
382  
383  
384 =head2 sub tmpdir
385  
386  
387 =cut
388  
389 sub tmpdir {
390  
391 my ( $self,$tmpdir ) = @_;
392 if ( $tmpdir ne $empty_string ) {
393  
394 $suxcontour->{_tmpdir} = $tmpdir;
395 $suxcontour->{_note} = $suxcontour->{_note}.' tmpdir='.$suxcontour->{_tmpdir};
396 $suxcontour->{_Step} = $suxcontour->{_Step}.' tmpdir='.$suxcontour->{_tmpdir};
397  
398 } else {
399 print("suxcontour, tmpdir, missing tmpdir,\n");
400 }
401 }
402  
403  
404 =head2 sub verbose
405  
406  
407 =cut
408  
409 sub verbose {
410  
411 my ( $self,$verbose ) = @_;
412 if ( $verbose ne $empty_string ) {
413  
414 $suxcontour->{_verbose} = $verbose;
415 $suxcontour->{_note} = $suxcontour->{_note}.' verbose='.$suxcontour->{_verbose};
416 $suxcontour->{_Step} = $suxcontour->{_Step}.' verbose='.$suxcontour->{_verbose};
417  
418 } else {
419 print("suxcontour, verbose, missing verbose,\n");
420 }
421 }
422  
423  
424 =head2 sub get_max_index
425  
426 max index = number of input variables -1
427
428 =cut
429
430 sub get_max_index {
431 my ($self) = @_;
432 my $max_index = 7;
433  
434 return($max_index);
435 }
436
437
438 1;