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