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

filter: Statementstmt 0.0% 0 / 43 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 61 CC 2 SCAR 10.0
CC
2
Cov
0%
trid
6.0
Step
2.0
note
2.0
CRAP 2.7
1 package App::SeismicUnixGui::sunix::data::suunpack2;
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 SUUNPACK2 - unpack segy trace data from shorts to floats
25  
26  
27  
28 suunpack2 <packed_file >unpacked_file
29  
30  
31  
32 suunpack2 is the approximate inverse of supack2
33  
34
35  
36 opt=null
37  
38  
39  
40  
41  
42 Credits:
43  
44 CWP: Jack K. Cohen, Shuki Ronen, Brian Sumner
45  
46  
47  
48 Revised: 7/4/95 Stewart A. Levin Mobil
49  
50 Changed decoding to parallel 2 byte encoding of supack2
51  
52  
53  
54 Caveats:
55  
56 This program is for single site use with supack2. See the
57  
58 supack2 header comments.
59  
60  
61  
62 Notes:
63  
64 ungpow and unscale are defined in segy.h
65  
66 trid = SHORTPACK is defined in su.h and segy.h
67  
68  
69  
70 Trace header fields accessed: ns, trid, ungpow, unscale
71  
72 Trace header fields modified: trid, ungpow, unscale
73  
74  
75  
76 =head2 User's notes (Juan Lorenzo)
77 untested
78  
79 =cut
80  
81  
82 =head2 CHANGES and their DATES
83  
84 =cut
85  
86 use Moose;
87 our $VERSION = '0.0.1';
88  
89  
90 =head2 Import packages
91  
92 =cut
93  
94 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
95  
96 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
97 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
98  
99  
100 =head2 instantiation of packages
101  
102 =cut
103  
104 my $get = L_SU_global_constants->new();
105 my $Project = Project_config->new();
106 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
107 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
108 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
109  
110 my $var = $get->var();
111 my $on = $var->{_on};
112 my $off = $var->{_off};
113 my $true = $var->{_true};
114 my $false = $var->{_false};
115 my $empty_string = $var->{_empty_string};
116  
117 =head2 Encapsulated
118 hash of private variables
119  
120 =cut
121  
122 my $suunpack2 = {
123 _opt => '',
124 _trid => '',
125 _Step => '',
126 _note => '',
127  
128 };
129  
130 =head2 sub Step
131  
132 collects switches and assembles bash instructions
133 by adding the program name
134  
135 =cut
136  
137 sub Step {
138  
139 $suunpack2->{_Step} = 'suunpack2'.$suunpack2->{_Step};
140 return ( $suunpack2->{_Step} );
141  
142 }
143  
144  
145 =head2 sub note
146  
147 collects switches and assembles bash instructions
148 by adding the program name
149  
150 =cut
151  
152 sub note {
153  
154 $suunpack2->{_note} = 'suunpack2'.$suunpack2->{_note};
155 return ( $suunpack2->{_note} );
156  
157 }
158  
159  
160  
161 =head2 sub clear
162  
163 =cut
164  
165 sub clear {
166  
167 $suunpack2->{_opt} = '';
168 $suunpack2->{_trid} = '';
169 $suunpack2->{_Step} = '';
170 $suunpack2->{_note} = '';
171 }
172  
173  
174 =head2 sub opt
175  
176  
177 =cut
178  
179 sub opt {
180  
181 my ( $self,$opt ) = @_;
182 # if ( $opt ne $empty_string ) {
183 #
184 # $suunpack2->{_opt} = $opt;
185 # $suunpack2->{_note} = $suunpack2->{_note}.' opt='.$suunpack2->{_opt};
186 # $suunpack2->{_Step} = $suunpack2->{_Step}.' opt='.$suunpack2->{_opt};
187 #
188 # } else {
189 # print("suunpack2, opt, missing opt,\n");
190 # }
191 }
192  
193  
194 =head2 sub trid
195  
196  
197 =cut
198  
199 sub trid {
200  
201 my ( $self,$trid ) = @_;
202 if ( $trid ne $empty_string ) {
203  
204 $suunpack2->{_trid} = $trid;
205 $suunpack2->{_note} = $suunpack2->{_note}.' trid='.$suunpack2->{_trid};
206 $suunpack2->{_Step} = $suunpack2->{_Step}.' trid='.$suunpack2->{_trid};
207  
208 } else {
209 print("suunpack2, trid, missing trid,\n");
210 }
211 }
212  
213  
214 =head2 sub get_max_index
215  
216 max index = number of input variables -1
217
218 =cut
219
220 sub get_max_index {
221 my ($self) = @_;
222 my $max_index = 0;
223  
224 return($max_index);
225 }
226
227
228 1;