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

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