lib/App/SeismicUnixGui/sunix/plot/supsmovie.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::supsmovie;
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 SUPSMOVIE - PostScript MOVIE plot of a segy data set
25  
26  
27  
28 supsmovie <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 psmovie selfdoc for the remaining parameters.
103  
104  
105  
106 On NeXT: supsmovie < infile [optional parameters] | open
107  
108  
109  
110 Credits:
111  
112  
113  
114 CWP: Dave Hale and Zhiming Li (psmovie)
115  
116 Jack K. Cohen (suxmovie)
117  
118 John Stockwell (supsmovie)
119  
120  
121  
122 Notes:
123  
124 When n2 isn't getparred, we need to count the traces
125  
126 for psmovie. In this case:
127  
128 we are using tmpfile because on many machines it is
129  
130 implemented as a memory area instead of a disk file.
131  
132 Although we compute ntr, we don't allocate a 2-d array
133  
134 and content ourselves with copying trace by trace from
135  
136 the data "file" to the pipe into the plotting program.
137  
138 Although we could use tr.data, we allocate a trace buffer
139  
140 for code clarity.
141  
142  
143  
144 =head2 User's notes (Juan Lorenzo)
145  
146 untested
147 VERSION = '0.0.2'; Only redirection is allowed. 2.9.23
148  
149 =cut
150  
151  
152 =head2 CHANGES and their DATES
153  
154 =cut
155  
156 use Moose;
157 our $VERSION = '0.0.2';
158  
159  
160 =head2 Import packages
161  
162 =cut
163  
164 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
165  
166 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
167 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
168  
169  
170 =head2 instantiation of packages
171  
172 =cut
173  
174 my $get = L_SU_global_constants->new();
175 my $Project = Project_config->new();
176 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
177 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
178 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
179  
180 my $PS_SEISMIC = $Project->PS_SEISMIC();
181  
182 my $var = $get->var();
183 my $on = $var->{_on};
184 my $off = $var->{_off};
185 my $true = $var->{_true};
186 my $false = $var->{_false};
187 my $empty_string = $var->{_empty_string};
188  
189 =head2 Encapsulated
190 hash of private variables
191  
192 =cut
193  
194 my $supsmovie = {
195 _d1 => '',
196 _d2 => '',
197 _f1 => '',
198 _f2 => '',
199 _tmpdir => '',
200 _verbose => '',
201 _Step => '',
202 _note => '',
203  
204 };
205  
206 =head2 sub Step
207  
208 collects switches and assembles bash instructions
209 by adding the program name
210  
211 =cut
212  
213 sub Step {
214  
215 $supsmovie->{_Step} = 'supsmovie'.$supsmovie->{_Step};
216 return ( $supsmovie->{_Step} );
217  
218 }
219  
220  
221 =head2 sub note
222  
223 collects switches and assembles bash instructions
224 by adding the program name
225  
226 =cut
227  
228 sub note {
229  
230 $supsmovie->{_note} = 'supsmovie'.$supsmovie->{_note};
231 return ( $supsmovie->{_note} );
232  
233 }
234  
235  
236  
237 =head2 sub clear
238  
239 =cut
240  
241 sub clear {
242  
243 $supsmovie->{_d1} = '';
244 $supsmovie->{_d2} = '';
245 $supsmovie->{_f1} = '';
246 $supsmovie->{_f2} = '';
247 $supsmovie->{_tmpdir} = '';
248 $supsmovie->{_verbose} = '';
249 $supsmovie->{_Step} = '';
250 $supsmovie->{_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 $supsmovie->{_d1} = $d1;
265 $supsmovie->{_note} = $supsmovie->{_note}.' d1='.$supsmovie->{_d1};
266 $supsmovie->{_Step} = $supsmovie->{_Step}.' d1='.$supsmovie->{_d1};
267  
268 } else {
269 print("supsmovie, 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 $supsmovie->{_d2} = $d2;
285 $supsmovie->{_note} = $supsmovie->{_note}.' d2='.$supsmovie->{_d2};
286 $supsmovie->{_Step} = $supsmovie->{_Step}.' d2='.$supsmovie->{_d2};
287  
288 } else {
289 print("supsmovie, 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 $supsmovie->{_f1} = $f1;
305 $supsmovie->{_note} = $supsmovie->{_note}.' f1='.$supsmovie->{_f1};
306 $supsmovie->{_Step} = $supsmovie->{_Step}.' f1='.$supsmovie->{_f1};
307  
308 } else {
309 print("supsmovie, 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 $supsmovie->{_f2} = $f2;
325 $supsmovie->{_note} = $supsmovie->{_note}.' f2='.$supsmovie->{_f2};
326 $supsmovie->{_Step} = $supsmovie->{_Step}.' f2='.$supsmovie->{_f2};
327  
328 } else {
329 print("supsmovie, f2, missing f2,\n");
330 }
331 }
332  
333  
334 =head2 sub tmpdir
335  
336  
337 =cut
338  
339 sub tmpdir {
340  
341 my ( $self,$tmpdir ) = @_;
342 if ( $tmpdir ne $empty_string ) {
343  
344 $supsmovie->{_tmpdir} = $tmpdir;
345 $supsmovie->{_note} = $supsmovie->{_note}.' tmpdir='.$supsmovie->{_tmpdir};
346 $supsmovie->{_Step} = $supsmovie->{_Step}.' tmpdir='.$supsmovie->{_tmpdir};
347  
348 } else {
349 print("supsmovie, tmpdir, missing tmpdir,\n");
350 }
351 }
352  
353  
354 =head2 sub verbose
355  
356  
357 =cut
358  
359 sub verbose {
360  
361 my ( $self,$verbose ) = @_;
362 if ( $verbose ne $empty_string ) {
363  
364 $supsmovie->{_verbose} = $verbose;
365 $supsmovie->{_note} = $supsmovie->{_note}.' verbose='.$supsmovie->{_verbose};
366 $supsmovie->{_Step} = $supsmovie->{_Step}.' verbose='.$supsmovie->{_verbose};
367  
368 } else {
369 print("supsmovie, verbose, missing verbose,\n");
370 }
371 }
372  
373  
374 =head2 sub get_max_index
375  
376 max index = number of input variables -1
377
378 =cut
379
380 sub get_max_index {
381 my ($self) = @_;
382 my $max_index = 5;
383  
384 return($max_index);
385 }
386
387
388 1;