lib/App/SeismicUnixGui/sunix/data/supack2.pm untested

filter: Statementstmt 0.0% 0 / 48 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 68 CC 3 SCAR 12.0
CC
3
Cov
0%
gpow
6.0
trid
6.0
Step
2.0
CRAP 3.3
1 package App::SeismicUnixGui::sunix::data::supack2;
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 SUPACK2 - pack segy trace data into 2 byte shorts
25  
26  
27  
28 supack2 <segy_file >packed_file gpow=0.5
29  
30  
31  
32 Required parameters:
33  
34 none
35  
36  
37  
38 Optional parameter:
39  
40 gpow=0.5 exponent used to compress the dynamic
41  
42 range of the traces
43  
44  
45  
46  
47  
48 Credits:
49  
50 CWP: Jack K. Cohen, Shuki Ronen, Brian Sumner
51  
52  
53  
54 Revised: 7/4/95 Stewart A. Levin Mobil
55  
56 Changed encoding to ensure 2 byte length (short is
57  
58 8 bytes on Cray).
59  
60  
61  
62 Caveats:
63  
64 This program is for single site use. Use segywrite to make
65  
66 a portable tape.
67  
68  
69  
70 We are storing the local header words, ungpow and unscale,
71  
72 required by suunpack2 as floats.
73  
74
75  
76 Notes:
77  
78 ungpow and unscale are defined in segy.h
79  
80 trid = SHORTPACK is defined in su.h and segy.h
81  
82  
83  
84 Trace header fields accessed: ns
85  
86 Trace header fields modified: ungpow, unscale, trid
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($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
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 $var = $get->var();
125 my $on = $var->{_on};
126 my $off = $var->{_off};
127 my $true = $var->{_true};
128 my $false = $var->{_false};
129 my $empty_string = $var->{_empty_string};
130  
131 =head2 Encapsulated
132 hash of private variables
133  
134 =cut
135  
136 my $supack2 = {
137 _gpow => '',
138 _trid => '',
139 _Step => '',
140 _note => '',
141  
142 };
143  
144 =head2 sub Step
145  
146 collects switches and assembles bash instructions
147 by adding the program name
148  
149 =cut
150  
151 sub Step {
152  
153 $supack2->{_Step} = 'supack2'.$supack2->{_Step};
154 return ( $supack2->{_Step} );
155  
156 }
157  
158  
159 =head2 sub note
160  
161 collects switches and assembles bash instructions
162 by adding the program name
163  
164 =cut
165  
166 sub note {
167  
168 $supack2->{_note} = 'supack2'.$supack2->{_note};
169 return ( $supack2->{_note} );
170  
171 }
172  
173  
174  
175 =head2 sub clear
176  
177 =cut
178  
179 sub clear {
180  
181 $supack2->{_gpow} = '';
182 $supack2->{_trid} = '';
183 $supack2->{_Step} = '';
184 $supack2->{_note} = '';
185 }
186  
187  
188 =head2 sub gpow
189  
190  
191 =cut
192  
193 sub gpow {
194  
195 my ( $self,$gpow ) = @_;
196 if ( $gpow ne $empty_string ) {
197  
198 $supack2->{_gpow} = $gpow;
199 $supack2->{_note} = $supack2->{_note}.' gpow='.$supack2->{_gpow};
200 $supack2->{_Step} = $supack2->{_Step}.' gpow='.$supack2->{_gpow};
201  
202 } else {
203 print("supack2, gpow, missing gpow,\n");
204 }
205 }
206  
207  
208 =head2 sub trid
209  
210  
211 =cut
212  
213 sub trid {
214  
215 my ( $self,$trid ) = @_;
216 if ( $trid ne $empty_string ) {
217  
218 $supack2->{_trid} = $trid;
219 $supack2->{_note} = $supack2->{_note}.' trid='.$supack2->{_trid};
220 $supack2->{_Step} = $supack2->{_Step}.' trid='.$supack2->{_trid};
221  
222 } else {
223 print("supack2, trid, missing trid,\n");
224 }
225 }
226  
227  
228 =head2 sub get_max_index
229  
230 max index = number of input variables -1
231
232 =cut
233
234 sub get_max_index {
235 my ($self) = @_;
236 my $max_index = 0;
237  
238 return($max_index);
239 }
240
241
242 1;