lib/App/SeismicUnixGui/sunix/header/suedit.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::suedit;
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 SUEDIT - examine segy diskfiles and edit headers
25  
26  
27  
28 suedit diskfile (open for possible header modification if writable)
29  
30 suedit <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] ximage plot the trace [traces tr1 to tr2]
53  
54 w [tr1 tr2] xwigb plot the trace [traces tr1 to tr2]
55  
56 f [tr1 tr2] ximage plot the amplitude spectra of the trace
57  
58 u [tr1 tr2] apply user pipeline to specified traces
59  
60 ! key=val change a value in a field (e.g. ! tracr=101)
61  
62 ? print help file
63  
64 q quit
65  
66  
67  
68 NOTE: sample numbers are 1-based (first sample is 1).
69  
70  
71  
72 'u 1000000 1000100 suwind >subset.su' will quickly extract a few
73  
74 traces from the middle of a large dataset
75  
76  
77  
78  
79  
80 Credits:
81  
82 SEP: Einar Kjartansson, Shuki Ronen, Stew Levin
83  
84 CWP: Jack K. Cohen
85  
86 Unocal: Reg Beardsley
87  
88 Trace header fields accessed: ns
89  
90 Trace header fields modified: ntr (only for internal plotting)
91  
92  
93  
94 =head2 User's notes (Juan Lorenzo)
95 untested
96  
97 =cut
98  
99  
100 =head2 CHANGES and their DATES
101  
102 =cut
103  
104 use Moose;
105 our $VERSION = '0.0.1';
106  
107  
108 =head2 Import packages
109  
110 =cut
111  
112 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
113  
114 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
115 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
116  
117  
118 =head2 instantiation of packages
119  
120 =cut
121  
122 my $get = L_SU_global_constants->new();
123 my $Project = Project_config->new();
124 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
125 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
126 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
127  
128 my $PS_SEISMIC = $Project->PS_SEISMIC();
129  
130 my $var = $get->var();
131 my $on = $var->{_on};
132 my $off = $var->{_off};
133 my $true = $var->{_true};
134 my $false = $var->{_false};
135 my $empty_string = $var->{_empty_string};
136  
137 =head2 Encapsulated
138 hash of private variables
139  
140 =cut
141  
142 my $suedit = {
143 _key => '',
144 _Step => '',
145 _note => '',
146  
147 };
148  
149 =head2 sub Step
150  
151 collects switches and assembles bash instructions
152 by adding the program name
153  
154 =cut
155  
156 sub Step {
157  
158 $suedit->{_Step} = 'suedit'.$suedit->{_Step};
159 return ( $suedit->{_Step} );
160  
161 }
162  
163  
164 =head2 sub note
165  
166 collects switches and assembles bash instructions
167 by adding the program name
168  
169 =cut
170  
171 sub note {
172  
173 $suedit->{_note} = 'suedit'.$suedit->{_note};
174 return ( $suedit->{_note} );
175  
176 }
177  
178  
179  
180 =head2 sub clear
181  
182 =cut
183  
184 sub clear {
185  
186 $suedit->{_key} = '';
187 $suedit->{_Step} = '';
188 $suedit->{_note} = '';
189 }
190  
191  
192 =head2 sub key
193  
194  
195 =cut
196  
197 sub key {
198  
199 my ( $self,$key ) = @_;
200 if ( $key ne $empty_string ) {
201  
202 $suedit->{_key} = $key;
203 $suedit->{_note} = $suedit->{_note}.' key='.$suedit->{_key};
204 $suedit->{_Step} = $suedit->{_Step}.' key='.$suedit->{_key};
205  
206 } else {
207 print("suedit, key, missing key,\n");
208 }
209 }
210  
211  
212 =head2 sub get_max_index
213  
214 max index = number of input variables -1
215
216 =cut
217
218 sub get_max_index {
219 my ($self) = @_;
220 my $max_index = 0;
221  
222 return($max_index);
223 }
224
225
226 1;