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

filter: Statementstmt 0.0% 0 / 42 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 58 CC 2 SCAR 10.3
CC
2
Cov
0%
key
6.0
Step
2.0
note
2.0
CRAP 2.8
1 package App::SeismicUnixGui::sunix::header::suxedit;
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 SUXEDIT - examine segy diskfiles and edit headers
25  
26  
27  
28 suxedit diskfile (open for possible header modification if writable)
29  
30 suxedit <diskfile (open read only)
31  
32  
33  
34 The following commands are recognized:
35  
36 number read in that trace and print nonzero header words
37  
38 <CR> go to trace one step away (step is initially -1)
39  
40 + read in next trace (step is set to +1)
41  
42 - read in previous trace (step is set to -1)
43  
44 dN advance N traces (step is set to N)
45  
46 % print some percentiles of the trace data
47  
48 r print some ranks (rank[j] = jth smallest datum)
49  
50 p [n1 [n2]] tab plot sample n1 to n2 on current trace
51  
52 g [tr1 tr2] ["opts"] wiggle plot (graph) the trace
53  
54 [traces tr1 to tr2]
55  
56 f wiggle plot the Fourier transform of the trace
57  
58 ! key=val change a value in a field (e.g. ! tracr=101)
59  
60 ? print help file
61  
62 q quit
63  
64  
65  
66 NOTE: sample numbers are 1-based (first sample is 1).
67  
68  
69  
70  
71  
72 Credits:
73  
74 SEP: Einar Kjartansson, Shuki Ronen, Stew Levin
75  
76 CWP: Jack K. Cohen
77  
78  
79  
80 Trace header fields accessed: ns
81  
82 Trace header fields modified: ntr (only for internal plotting)
83  
84  
85  
86 =head2 User's notes (Juan Lorenzo)
87 untested
88  
89 =cut
90  
91  
92 =head2 CHANGES and their DATES
93  
94 =cut
95  
96 use Moose;
97 our $VERSION = '0.0.1';
98  
99  
100 =head2 Import packages
101  
102 =cut
103  
104 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
105 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
106 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
107  
108  
109 =head2 instantiation of packages
110  
111 =cut
112  
113 my $get = L_SU_global_constants->new();
114 my $Project = Project_config->new();
115 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
116 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
117 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
118  
119 my $PS_SEISMIC = $Project->PS_SEISMIC();
120  
121 my $var = $get->var();
122 my $on = $var->{_on};
123 my $off = $var->{_off};
124 my $true = $var->{_true};
125 my $false = $var->{_false};
126 my $empty_string = $var->{_empty_string};
127  
128 =head2 Encapsulated
129 hash of private variables
130  
131 =cut
132  
133 my $suxedit = {
134 _key => '',
135 _Step => '',
136 _note => '',
137  
138 };
139  
140 =head2 sub Step
141  
142 collects switches and assembles bash instructions
143 by adding the program name
144  
145 =cut
146  
147 sub Step {
148  
149 $suxedit->{_Step} = 'suxedit'.$suxedit->{_Step};
150 return ( $suxedit->{_Step} );
151  
152 }
153  
154  
155 =head2 sub note
156  
157 collects switches and assembles bash instructions
158 by adding the program name
159  
160 =cut
161  
162 sub note {
163  
164 $suxedit->{_note} = 'suxedit'.$suxedit->{_note};
165 return ( $suxedit->{_note} );
166  
167 }
168  
169  
170  
171 =head2 sub clear
172  
173 =cut
174  
175 sub clear {
176  
177 $suxedit->{_key} = '';
178 $suxedit->{_Step} = '';
179 $suxedit->{_note} = '';
180 }
181  
182  
183 =head2 sub key
184  
185  
186 =cut
187  
188 sub key {
189  
190 my ( $self,$key ) = @_;
191 if ( $key ne $empty_string ) {
192  
193 $suxedit->{_key} = $key;
194 $suxedit->{_note} = $suxedit->{_note}.' key='.$suxedit->{_key};
195 $suxedit->{_Step} = $suxedit->{_Step}.' key='.$suxedit->{_key};
196  
197 } else {
198 print("suxedit, key, missing key,\n");
199 }
200 }
201  
202  
203 =head2 sub get_max_index
204  
205 max index = number of input variables -1
206
207 =cut
208
209 sub get_max_index {
210 my ($self) = @_;
211 my $max_index = 0;
212  
213 return($max_index);
214 }
215
216
217 1;