lib/App/SeismicUnixGui/sunix/transform/suifft.pm untested

filter: Statementstmt 0.0% 0 / 52 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 68 CC 2 SCAR 10.3
CC
2
Cov
0%
sign
6.0
Step
2.0
note
2.0
CRAP 2.8
1 package App::SeismicUnixGui::sunix::transform::suifft;
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 SUIFFT - fft complex frequency traces to real time traces
25  
26  
27  
28 suiftt <stdin >sdout sign=-1
29  
30  
31  
32 Required parameters:
33  
34 none
35  
36  
37  
38 Optional parameter:
39  
40 sign=-1 sign in exponent of inverse fft
41  
42  
43  
44 Output traces are normalized by 1/N where N is the fft size.
45  
46  
47  
48 Note: sufft | suifft is not quite a no-op since the trace
49  
50 length will usually be longer due to fft padding.
51  
52  
53  
54  
55  
56 Credits:
57  
58  
59  
60 CWP: Shuki, Chris, Jack
61  
62  
63  
64 Trace header fields accessed: ns, trid
65  
66 Trace header fields modified: ns, trid
67  
68  
69  
70 =head2 CHANGES and their DATES
71  
72 =cut
73  
74 use Moose;
75 our $VERSION = '0.0.1';
76  
77  
78 =head2 Import packages
79  
80 =cut
81  
82 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
83  
84 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
85 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
86  
87  
88 =head2 instantiation of packages
89  
90 =cut
91  
92 my $get = L_SU_global_constants->new();
93 my $Project = Project_config->new();
94 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
95 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
96 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
97  
98 my $var = $get->var();
99 my $on = $var->{_on};
100 my $off = $var->{_off};
101 my $true = $var->{_true};
102 my $false = $var->{_false};
103 my $empty_string = $var->{_empty_string};
104  
105 =head2 Encapsulated
106 hash of private variables
107  
108 =cut
109  
110 my $suifft = {
111 _sign => '',
112 _Step => '',
113 _note => '',
114  
115 };
116  
117 =head2 sub Step
118  
119 collects switches and assembles bash instructions
120 by adding the program name
121  
122 =cut
123  
124 sub Step {
125  
126 $suifft->{_Step} = 'suifft'.$suifft->{_Step};
127 return ( $suifft->{_Step} );
128  
129 }
130  
131  
132 =head2 sub note
133  
134 collects switches and assembles bash instructions
135 by adding the program name
136  
137 =cut
138  
139 sub note {
140  
141 $suifft->{_note} = 'suifft'.$suifft->{_note};
142 return ( $suifft->{_note} );
143  
144 }
145  
146  
147  
148 =head2 sub clear
149  
150 =cut
151  
152 sub clear {
153 $suifft->{__sign} = '';
154 $suifft->{_empty_string} = '';
155 $suifft->{_false} = '';
156 $suifft->{_get} = '';
157 $suifft->{_index} = '';
158 $suifft->{_max_index} = '';
159 $suifft->{_off} = '';
160 $suifft->{_on} = '';
161 $suifft->{_sign} = '';
162 $suifft->{_suifft} = '';
163 $suifft->{_true} = '';
164 $suifft->{_var} = '';
165 $suifft->{_Step} = '';
166 $suifft->{_note} = '';
167 }
168  
169  
170 =head2 sub sign
171  
172  
173 =cut
174  
175 sub sign {
176  
177 my ( $self,$sign ) = @_;
178 if ( $sign ne $empty_string ) {
179  
180 $suifft->{_sign} = $sign;
181 $suifft->{_note} = $suifft->{_note}.' sign='.$suifft->{_sign};
182 $suifft->{_Step} = $suifft->{_Step}.' sign='.$suifft->{_sign};
183  
184 } else {
185 print("suifft, sign, missing sign,\n");
186 }
187 }
188  
189  
190 =head2 sub get_max_index
191  
192 max index = number of input variables -1
193
194 =cut
195
196 sub get_max_index {
197 my ($self) = @_;
198 my $max_index = 0;
199  
200 return($max_index);
201 }
202
203
204 1;