lib/App/SeismicUnixGui/sunix/header/suchart.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%
key1
6.0
key2
6.0
linewidth
6.0
CRAP 4.4
1 package App::SeismicUnixGui::sunix::header::suchart;
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 SUCHART - prepare data for x vs. y plot
25  
26  
27  
28 suchart <stdin >stdout key1=sx key2=gx
29  
30  
31  
32 Required parameters:
33  
34 none
35  
36  
37  
38 Optional parameters:
39  
40 key1=sx abscissa
41  
42 key2=gx ordinate
43  
44 outpar=null name of parameter file
45  
46  
47  
48 The output is the (x, y) pairs of binary floats
49  
50  
51  
52 Examples:
53  
54 suchart < sudata outpar=pfile >plot_data
55  
56 psgraph <plot_data par=pfile title="CMG" \\
57  
58 linewidth=0 marksize=2 mark=8 | ...
59  
60 rm plot_data
61  
62  
63  
64 suchart < sudata | psgraph n=1024 d1=.004 \\
65  
66 linewidth=0 marksize=2 mark=8 | ...
67  
68  
69  
70 fold chart:
71  
72 suchart < stacked_data key1=cdp key2=nhs |
73  
74 psgraph n=NUMBER_OF_TRACES d1=.004 \\
75  
76 linewidth=0 marksize=2 mark=8 > chart.ps
77  
78  
79  
80  
81  
82  
83  
84 Credits:
85  
86 SEP: Einar Kjartansson
87  
88 CWP: Jack K. Cohen
89  
90  
91  
92 Notes:
93  
94 The vtof routine from valpkge converts values to floats.
95  
96  
97  
98 =head2 User's notes (Juan Lorenzo)
99 untested
100  
101 =cut
102  
103  
104 =head2 CHANGES and their DATES
105  
106 =cut
107  
108 use Moose;
109 our $VERSION = '0.0.1';
110  
111  
112 =head2 Import packages
113  
114 =cut
115  
116 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
117  
118 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
119 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
120  
121  
122 =head2 instantiation of packages
123  
124 =cut
125  
126 my $get = L_SU_global_constants->new();
127 my $Project = Project_config->new();
128 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
129 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
130 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
131  
132 my $PS_SEISMIC = $Project->PS_SEISMIC();
133  
134 my $var = $get->var();
135 my $on = $var->{_on};
136 my $off = $var->{_off};
137 my $true = $var->{_true};
138 my $false = $var->{_false};
139 my $empty_string = $var->{_empty_string};
140  
141 =head2 Encapsulated
142 hash of private variables
143  
144 =cut
145  
146 my $suchart = {
147 _key1 => '',
148 _key2 => '',
149 _linewidth => '',
150 _n => '',
151 _outpar => '',
152 _par => '',
153 _Step => '',
154 _note => '',
155  
156 };
157  
158 =head2 sub Step
159  
160 collects switches and assembles bash instructions
161 by adding the program name
162  
163 =cut
164  
165 sub Step {
166  
167 $suchart->{_Step} = 'suchart'.$suchart->{_Step};
168 return ( $suchart->{_Step} );
169  
170 }
171  
172  
173 =head2 sub note
174  
175 collects switches and assembles bash instructions
176 by adding the program name
177  
178 =cut
179  
180 sub note {
181  
182 $suchart->{_note} = 'suchart'.$suchart->{_note};
183 return ( $suchart->{_note} );
184  
185 }
186  
187  
188  
189 =head2 sub clear
190  
191 =cut
192  
193 sub clear {
194  
195 $suchart->{_key1} = '';
196 $suchart->{_key2} = '';
197 $suchart->{_linewidth} = '';
198 $suchart->{_n} = '';
199 $suchart->{_outpar} = '';
200 $suchart->{_par} = '';
201 $suchart->{_Step} = '';
202 $suchart->{_note} = '';
203 }
204  
205  
206 =head2 sub key1
207  
208  
209 =cut
210  
211 sub key1 {
212  
213 my ( $self,$key1 ) = @_;
214 if ( $key1 ne $empty_string ) {
215  
216 $suchart->{_key1} = $key1;
217 $suchart->{_note} = $suchart->{_note}.' key1='.$suchart->{_key1};
218 $suchart->{_Step} = $suchart->{_Step}.' key1='.$suchart->{_key1};
219  
220 } else {
221 print("suchart, key1, missing key1,\n");
222 }
223 }
224  
225  
226 =head2 sub key2
227  
228  
229 =cut
230  
231 sub key2 {
232  
233 my ( $self,$key2 ) = @_;
234 if ( $key2 ne $empty_string ) {
235  
236 $suchart->{_key2} = $key2;
237 $suchart->{_note} = $suchart->{_note}.' key2='.$suchart->{_key2};
238 $suchart->{_Step} = $suchart->{_Step}.' key2='.$suchart->{_key2};
239  
240 } else {
241 print("suchart, key2, missing key2,\n");
242 }
243 }
244  
245  
246 =head2 sub linewidth
247  
248  
249 =cut
250  
251 sub linewidth {
252  
253 my ( $self,$linewidth ) = @_;
254 if ( $linewidth ne $empty_string ) {
255  
256 $suchart->{_linewidth} = $linewidth;
257 $suchart->{_note} = $suchart->{_note}.' linewidth='.$suchart->{_linewidth};
258 $suchart->{_Step} = $suchart->{_Step}.' linewidth='.$suchart->{_linewidth};
259  
260 } else {
261 print("suchart, linewidth, missing linewidth,\n");
262 }
263 }
264  
265  
266 =head2 sub n
267  
268  
269 =cut
270  
271 sub n {
272  
273 my ( $self,$n ) = @_;
274 if ( $n ne $empty_string ) {
275  
276 $suchart->{_n} = $n;
277 $suchart->{_note} = $suchart->{_note}.' n='.$suchart->{_n};
278 $suchart->{_Step} = $suchart->{_Step}.' n='.$suchart->{_n};
279  
280 } else {
281 print("suchart, n, missing n,\n");
282 }
283 }
284  
285  
286 =head2 sub outpar
287  
288  
289 =cut
290  
291 sub outpar {
292  
293 my ( $self,$outpar ) = @_;
294 if ( $outpar ne $empty_string ) {
295  
296 $suchart->{_outpar} = $outpar;
297 $suchart->{_note} = $suchart->{_note}.' outpar='.$suchart->{_outpar};
298 $suchart->{_Step} = $suchart->{_Step}.' outpar='.$suchart->{_outpar};
299  
300 } else {
301 print("suchart, outpar, missing outpar,\n");
302 }
303 }
304  
305  
306 =head2 sub par
307  
308  
309 =cut
310  
311 sub par {
312  
313 my ( $self,$par ) = @_;
314 if ( $par ne $empty_string ) {
315  
316 $suchart->{_par} = $par;
317 $suchart->{_note} = $suchart->{_note}.' par='.$suchart->{_par};
318 $suchart->{_Step} = $suchart->{_Step}.' par='.$suchart->{_par};
319  
320 } else {
321 print("suchart, par, missing par,\n");
322 }
323 }
324  
325  
326 =head2 sub get_max_index
327  
328 max index = number of input variables -1
329
330 =cut
331
332 sub get_max_index {
333 my ($self) = @_;
334 my $max_index = 5;
335  
336 return($max_index);
337 }
338
339
340 1;