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