lib/App/SeismicUnixGui/sunix/header/surange.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 34 CC 2 SCAR 11.5
CC
2
Cov
0%
key
6.0
Step
2.0
note
2.0
CRAP 3.1
1 package App::SeismicUnixGui::sunix::header::surange;
2  
3 =head1 DOCUMENTATION
4  
5 =head2 SYNOPSIS
6  
7 PERL PROGRAM NAME: SURANGE - get max and min values for non-zero header entries
8
9 AUTHOR: Juan Lorenzo (Perl module only)
10
11 DATE:
12
13 DESCRIPTION:
14
15 Version:
16  
17 =head2 USE
18  
19 =head3 NOTES
20  
21 =head4 Examples
22  
23 =head3 SEISMIC UNIX NOTES
24  
25 SURANGE - get max and min values for non-zero header entries
26  
27 surange <stdin
28  
29 Optional parameters:
30 key= Header key(s) to range (default=all)
31  
32 Note: Gives partial results if interrupted
33  
34 Output is:
35 number of traces
36 keyword min max (first - last)
37 north-south-east-west limits of shot, receiver and midpoint
38  
39  
40 Credits:
41 Stanford: Stewart A. Levin
42 Added print of eastmost, northmost, westmost,
43 southmost coordinates of shots, receivers, and
44 midpoints. These coordinates have had any
45 nonzero coscal header value applied.
46 Geocon: Garry Perratt (output one header per line;
47 option to specify headers to range;
48 added first & last values where min<max)
49 Based upon original by:
50 SEP: Stew Levin
51 CWP: Jack K. Cohen
52  
53 Note: the use of "signal" is inherited from BSD days and may
54 break on some UNIXs. It is dicey in that the responsibility
55 for program termination is lateraled back to the main.
56  
57  
58 =head2 CHANGES and their DATES
59  
60 =cut
61  
62 use Moose;
63 our $VERSION = '0.0.1';
64  
65 my $surange = {
66 _key => '',
67 _Step => '',
68 _note => '',
69 };
70  
71 =head2 sub Step
72  
73 collects switches and assembles bash instructions
74 by adding the program name
75  
76 =cut
77  
78 sub Step {
79  
80 $surange->{_Step} = 'surange' . $surange->{_Step};
81 return ( $surange->{_Step} );
82  
83 }
84  
85 =head2 sub note
86  
87 collects switches and assembles bash instructions
88 by adding the program name
89  
90 =cut
91  
92 sub note {
93  
94 $surange->{_note} = 'surange' . $surange->{_note};
95 return ( $surange->{_note} );
96  
97 }
98  
99 =head2 sub clear
100  
101 =cut
102  
103 sub clear {
104  
105 $surange->{_key} = '';
106 $surange->{_Step} = '';
107 $surange->{_note} = '';
108 }
109  
110 =head2 sub key
111  
112  
113 =cut
114  
115 sub key {
116  
117 my ( $self, $key ) = @_;
118 if ($key) {
119  
120 $surange->{_key} = $key;
121 $surange->{_note} = $surange->{_note} . ' key=' . $surange->{_key};
122 $surange->{_Step} = $surange->{_Step} . ' key=' . $surange->{_key};
123  
124 }
125 else {
126 print("surange, key, missing key,\n");
127 }
128 }
129  
130 =head2 sub get_max_index
131 max index = number of input variables - 1
132
133 =cut
134  
135 sub get_max_index {
136 my ($self) = @_;
137 my $max_index = 0;
138  
139 return ($max_index);
140 }
141  
142 1;