lib/App/SeismicUnixGui/sunix/par/cshotplot.pm untested

filter: Statementstmt 0.0% 0 / 63 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 12 Podpod 0.0% 0 / 8 totaltotal 0.0% 0 / 91 CC 5 SCAR 13.9
CC
5
Cov
0%
linecolor
6.0
n1
6.0
n2
6.0
CRAP 4.0
1 package App::SeismicUnixGui::sunix::par::cshotplot;
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 CSHOTPLOT - convert CSHOT data to files for CWP graphers
25  
26  
27  
28 cshotplot <cshot1plot [optional parameter file]
29  
30  
31  
32 Required parameters:
33  
34 none
35  
36  
37  
38 Optional parameter:
39  
40 outpar=/dev/tty output parameter file, contains:
41  
42 number of plots (n2=)
43  
44 points in each plot (n1=)
45  
46 colors for plots (linecolor=)
47  
48  
49  
50 =head2 User's notes (Juan Lorenzo)
51 untested
52  
53 =cut
54  
55  
56 =head2 CHANGES and their DATES
57  
58 =cut
59  
60 use Moose;
61 our $VERSION = '0.0.1';
62  
63  
64 =head2 Import packages
65  
66 =cut
67  
68 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
69  
70 use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su);
71 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
72  
73  
74 =head2 instantiation of packages
75  
76 =cut
77  
78 my $get = L_SU_global_constants->new();
79 my $Project = Project_config->new();
80 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
81 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
82 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
83  
84 my $PS_SEISMIC = $Project->PS_SEISMIC();
85  
86 my $var = $get->var();
87 my $on = $var->{_on};
88 my $off = $var->{_off};
89 my $true = $var->{_true};
90 my $false = $var->{_false};
91 my $empty_string = $var->{_empty_string};
92  
93 =head2 Encapsulated
94 hash of private variables
95  
96 =cut
97  
98 my $cshotplot = {
99 _linecolor => '',
100 _n1 => '',
101 _n2 => '',
102 _outpar => '',
103 _Step => '',
104 _note => '',
105  
106 };
107  
108 =head2 sub Step
109  
110 collects switches and assembles bash instructions
111 by adding the program name
112  
113 =cut
114  
115 sub Step {
116  
117 $cshotplot->{_Step} = 'cshotplot'.$cshotplot->{_Step};
118 return ( $cshotplot->{_Step} );
119  
120 }
121  
122  
123 =head2 sub note
124  
125 collects switches and assembles bash instructions
126 by adding the program name
127  
128 =cut
129  
130 sub note {
131  
132 $cshotplot->{_note} = 'cshotplot'.$cshotplot->{_note};
133 return ( $cshotplot->{_note} );
134  
135 }
136  
137  
138  
139 =head2 sub clear
140  
141 =cut
142  
143 sub clear {
144  
145 $cshotplot->{_linecolor} = '';
146 $cshotplot->{_n1} = '';
147 $cshotplot->{_n2} = '';
148 $cshotplot->{_outpar} = '';
149 $cshotplot->{_Step} = '';
150 $cshotplot->{_note} = '';
151 }
152  
153  
154 =head2 sub linecolor
155  
156  
157 =cut
158  
159 sub linecolor {
160  
161 my ( $self,$linecolor ) = @_;
162 if ( $linecolor ne $empty_string ) {
163  
164 $cshotplot->{_linecolor} = $linecolor;
165 $cshotplot->{_note} = $cshotplot->{_note}.' linecolor='.$cshotplot->{_linecolor};
166 $cshotplot->{_Step} = $cshotplot->{_Step}.' linecolor='.$cshotplot->{_linecolor};
167  
168 } else {
169 print("cshotplot, linecolor, missing linecolor,\n");
170 }
171 }
172  
173  
174 =head2 sub n1
175  
176  
177 =cut
178  
179 sub n1 {
180  
181 my ( $self,$n1 ) = @_;
182 if ( $n1 ne $empty_string ) {
183  
184 $cshotplot->{_n1} = $n1;
185 $cshotplot->{_note} = $cshotplot->{_note}.' n1='.$cshotplot->{_n1};
186 $cshotplot->{_Step} = $cshotplot->{_Step}.' n1='.$cshotplot->{_n1};
187  
188 } else {
189 print("cshotplot, n1, missing n1,\n");
190 }
191 }
192  
193  
194 =head2 sub n2
195  
196  
197 =cut
198  
199 sub n2 {
200  
201 my ( $self,$n2 ) = @_;
202 if ( $n2 ne $empty_string ) {
203  
204 $cshotplot->{_n2} = $n2;
205 $cshotplot->{_note} = $cshotplot->{_note}.' n2='.$cshotplot->{_n2};
206 $cshotplot->{_Step} = $cshotplot->{_Step}.' n2='.$cshotplot->{_n2};
207  
208 } else {
209 print("cshotplot, n2, missing n2,\n");
210 }
211 }
212  
213  
214 =head2 sub outpar
215  
216  
217 =cut
218  
219 sub outpar {
220  
221 my ( $self,$outpar ) = @_;
222 if ( $outpar ne $empty_string ) {
223  
224 $cshotplot->{_outpar} = $outpar;
225 $cshotplot->{_note} = $cshotplot->{_note}.' outpar='.$cshotplot->{_outpar};
226 $cshotplot->{_Step} = $cshotplot->{_Step}.' outpar='.$cshotplot->{_outpar};
227  
228 } else {
229 print("cshotplot, outpar, missing outpar,\n");
230 }
231 }
232  
233  
234 =head2 sub get_max_index
235  
236 max index = number of input variables -1
237
238 =cut
239
240 sub get_max_index {
241 my ($self) = @_;
242 my $max_index = 3;
243  
244 return($max_index);
245 }
246
247
248 1;