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