| 1 | package App::SeismicUnixGui::sunix::transform::suspecfk; | ||
| 2 | use Moose; | ||
| 3 | our $VERSION = '0.0.1'; | ||
| 4 | |||
| 5 | =head1 DOCUMENTATION | ||
| 6 | |||
| 7 | =head2 SYNOPSIS | ||
| 8 | |||
| 9 | PROGRAM NAME: suspecfk | ||
| 10 | AUTHOR: Juan Lorenzo (Perl module only) | ||
| 11 | DATE: July 1 2016 | ||
| 12 | DESCRIPTION: A package that makes using and understanding suspecfk easier | ||
| 13 | VERSION: 0.1 | ||
| 14 | |||
| 15 | =head2 USE | ||
| 16 | |||
| 17 | =head2 Notes | ||
| 18 | |||
| 19 | This Program derives from suspecfk in Seismic Unix | ||
| 20 | '_note' keeps track of actions for use in graphics | ||
| 21 | '_Step' keeps track of actions for execution in the system | ||
| 22 | |||
| 23 | =head2 Example | ||
| 24 | |||
| 25 | =head2 Seismic Unix Notes | ||
| 26 | |||
| 27 | SUSPECFK - F-K Fourier SPECtrum of data set | ||
| 28 | |||
| 29 | suspecfk <infile >outfile [optional parameters] | ||
| 30 | |||
| 31 | Optional parameters: | ||
| 32 | |||
| 33 | dt=from header time sampling interval | ||
| 34 | dx=from header(d2) or 1.0 spatial sampling interval | ||
| 35 | |||
| 36 | verbose=0 verbose = 1 echoes information | ||
| 37 | |||
| 38 | tmpdir= if non-empty, use the value as a directory path | ||
| 39 | prefix for storing temporary files; else if the | ||
| 40 | the CWP_TMPDIR environment variable is set use | ||
| 41 | its value for the path; else use tmpfile() | ||
| 42 | |||
| 43 | Note: To facilitate further processing, the sampling intervals | ||
| 44 | in frequency and wavenumber as well as the first | ||
| 45 | frequency (0) and the first wavenumber are set in the | ||
| 46 | output header (as respectively d1, d2, f1, f2). | ||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | Note: The relation: w = 2 pi F is well known, but there | ||
| 51 | doesn't seem to be a commonly used letter corresponding | ||
| 52 | to F for the spatial conjugate transform variable. We | ||
| 53 | use K for this. More specifically we assume a phase: | ||
| 54 | i(w t - k x) = 2 pi i(F t - K x). | ||
| 55 | and F, K define our notion of frequency, wavenumber. | ||
| 56 | |||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | my $suspecfk = { | ||
| 61 | _dt => '', | ||
| 62 | _dx => '', | ||
| 63 | _note => '', | ||
| 64 | _Step => '', | ||
| 65 | _tmpdir => '', | ||
| 66 | _verbose => '' | ||
| 67 | }; | ||
| 68 | |||
| 69 | =pod | ||
| 70 | |||
| 71 | =head1 Description of Subroutines | ||
| 72 | |||
| 73 | =head2 Subroutine clear | ||
| 74 | |||
| 75 | Sets all variable strings to '' (nothing) | ||
| 76 | |||
| 77 | =cut | ||
| 78 | |||
| 79 | sub clear { | ||
| 80 | $suspecfk->{_dt} = ''; | ||
| 81 | $suspecfk->{_dx} = ''; | ||
| 82 | $suspecfk->{_note} = ''; | ||
| 83 | $suspecfk->{_Step} = ''; | ||
| 84 | $suspecfk->{_tmpdir} = ''; | ||
| 85 | $suspecfk->{_verbose} = ''; | ||
| 86 | } | ||
| 87 | |||
| 88 | =head2 Subroutine dt | ||
| 89 | |||
| 90 | sampling interval | ||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | sub dt { | ||
| 95 | my ( $sub, $dt ) = @_; | ||
| 96 | if ($dt) { | ||
| 97 | $suspecfk->{_dt} = $dt if defined($dt); | ||
| 98 | $suspecfk->{_note} = $suspecfk->{_note} . ' dt=' . $suspecfk->{_dt}; | ||
| 99 | $suspecfk->{_Step} = $suspecfk->{_Step} . ' dt=' . $suspecfk->{_dt}; | ||
| 100 | } | ||
| 101 | } | ||
| 102 | |||
| 103 | =head2 Subroutine dx | ||
| 104 | |||
| 105 | sparation between traces | ||
| 106 | |||
| 107 | =cut | ||
| 108 | |||
| 109 | sub dx { | ||
| 110 | my ( $sub, $dx ) = @_; | ||
| 111 | if ($dx) { | ||
| 112 | $suspecfk->{_dx} = $dx if defined($dx); | ||
| 113 | $suspecfk->{_note} = $suspecfk->{_note} . ' dx=' . $suspecfk->{_dx}; | ||
| 114 | $suspecfk->{_Step} = $suspecfk->{_Step} . ' dx=' . $suspecfk->{_dx}; | ||
| 115 | } | ||
| 116 | } | ||
| 117 | |||
| 118 | =head2 Subroutine tmpdir | ||
| 119 | |||
| 120 | work directory which can be defined | ||
| 121 | |||
| 122 | =cut | ||
| 123 | |||
| 124 | sub tmpdir { | ||
| 125 | my ( $sub, $tmpdir ) = @_; | ||
| 126 | if ($tmpdir) { | ||
| 127 | $suspecfk->{_tmpdir} = $tmpdir if defined($tmpdir); | ||
| 128 | $suspecfk->{_note} = | ||
| 129 | $suspecfk->{_note} . ' tmpdir=' . $suspecfk->{_tmpdir}; | ||
| 130 | $suspecfk->{_Step} = | ||
| 131 | $suspecfk->{_Step} . ' tmpdir=' . $suspecfk->{_tmpdir}; | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 135 | =head2 Subroutine verbose | ||
| 136 | |||
| 137 | echoes steps during progress of filtering | ||
| 138 | |||
| 139 | =cut | ||
| 140 | |||
| 141 | sub verbose { | ||
| 142 | my ( $sub, $verbose ) = @_; | ||
| 143 | if ($verbose) { | ||
| 144 | $suspecfk->{_verbose} = $verbose if defined($verbose); | ||
| 145 | $suspecfk->{_note} = | ||
| 146 | $suspecfk->{_note} . ' verbose=' . $suspecfk->{_verbose}; | ||
| 147 | $suspecfk->{_Step} = | ||
| 148 | $suspecfk->{_Step} . ' verbose=' . $suspecfk->{_verbose}; | ||
| 149 | } | ||
| 150 | } | ||
| 151 | |||
| 152 | =head2 Subroutine Step | ||
| 153 | |||
| 154 | Keeps track of actions for execution in the system | ||
| 155 | |||
| 156 | =cut | ||
| 157 | |||
| 158 | sub Step { | ||
| 159 | $suspecfk->{_Step} = 'suspecfk' . $suspecfk->{_Step}; | ||
| 160 | return $suspecfk->{_Step}; | ||
| 161 | } | ||
| 162 | |||
| 163 | =head2 Subroutine note | ||
| 164 | |||
| 165 | Keeps track of actions for possible use in graphics | ||
| 166 | |||
| 167 | =cut | ||
| 168 | |||
| 169 | sub note { | ||
| 170 | $suspecfk->{_note} = $suspecfk->{_note}; | ||
| 171 | return $suspecfk->{_note}; | ||
| 172 | } | ||
| 173 | |||
| 174 | =head2 sub get_max_index | ||
| 175 | |||
| 176 | max index = number of input variables -1 | ||
| 177 | |||
| 178 | =cut | ||
| 179 | |||
| 180 | sub get_max_index { | ||
| 181 | my ($self) = @_; | ||
| 182 | |||
| 183 | # only file_name : index=6 | ||
| 184 | my $max_index = 6; | ||
| 185 | |||
| 186 | return ($max_index); | ||
| 187 | } | ||
| 188 | |||
| 189 | 1; |