« lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/sureduce.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/data/wpccompress.pm »
| 1 | package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sutsq; | ||
| 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 | SUTSQ -- time axis time-squared stretch of seismic traces | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | sutsq [optional parameters] <stdin >stdout | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Required parameters: | ||
| 33 | |||
| 34 | none | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | Optional parameters: | ||
| 39 | |||
| 40 | tmin= .1*nt*dt minimum time sample of interest | ||
| 41 | |||
| 42 | (only needed for forward transform) | ||
| 43 | |||
| 44 | dt= .004 output sample rate | ||
| 45 | |||
| 46 | (only needed for inverse transform) | ||
| 47 | |||
| 48 | flag= 1 1 means forward transform: time to time squared | ||
| 49 | |||
| 50 | -1 means inverse transform: time squared to time | ||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | Note: The output of the forward transform always starts with | ||
| 55 | |||
| 56 | time squared equal to zero. 'tmin' is used to avoid aliasing | ||
| 57 | |||
| 58 | the early times. | ||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | Caveats: | ||
| 67 | |||
| 68 | Amplitudes are not well preserved. | ||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | Trace header fields accessed: ns, dt | ||
| 73 | |||
| 74 | Trace header fields modified: ns, dt | ||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | =head2 User's notes (Juan Lorenzo) | ||
| 79 | untested | ||
| 80 | |||
| 81 | =cut | ||
| 82 | |||
| 83 | |||
| 84 | =head2 CHANGES and their DATES | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | use Moose; | ||
| 89 | our $VERSION = '0.0.1'; | ||
| 90 | |||
| 91 | |||
| 92 | =head2 Import packages | ||
| 93 | |||
| 94 | =cut | ||
| 95 | |||
| 96 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 97 | |||
| 98 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out | ||
| 99 | $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 100 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 101 | |||
| 102 | |||
| 103 | =head2 instantiation of packages | ||
| 104 | |||
| 105 | =cut | ||
| 106 | |||
| 107 | my $get = L_SU_global_constants->new(); | ||
| 108 | my $Project = Project_config->new(); | ||
| 109 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 110 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 111 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 112 | |||
| 113 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 114 | |||
| 115 | my $var = $get->var(); | ||
| 116 | my $on = $var->{_on}; | ||
| 117 | my $off = $var->{_off}; | ||
| 118 | my $true = $var->{_true}; | ||
| 119 | my $false = $var->{_false}; | ||
| 120 | my $empty_string = $var->{_empty_string}; | ||
| 121 | |||
| 122 | =head2 Encapsulated | ||
| 123 | hash of private variables | ||
| 124 | |||
| 125 | =cut | ||
| 126 | |||
| 127 | my $sutsq = { | ||
| 128 | _dt => '', | ||
| 129 | _flag => '', | ||
| 130 | _tmin => '', | ||
| 131 | _Step => '', | ||
| 132 | _note => '', | ||
| 133 | |||
| 134 | }; | ||
| 135 | |||
| 136 | =head2 sub Step | ||
| 137 | |||
| 138 | collects switches and assembles bash instructions | ||
| 139 | by adding the program name | ||
| 140 | |||
| 141 | =cut | ||
| 142 | |||
| 143 | sub Step { | ||
| 144 | |||
| 145 | $sutsq->{_Step} = 'sutsq'.$sutsq->{_Step}; | ||
| 146 | return ( $sutsq->{_Step} ); | ||
| 147 | |||
| 148 | } | ||
| 149 | |||
| 150 | |||
| 151 | =head2 sub note | ||
| 152 | |||
| 153 | collects switches and assembles bash instructions | ||
| 154 | by adding the program name | ||
| 155 | |||
| 156 | =cut | ||
| 157 | |||
| 158 | sub note { | ||
| 159 | |||
| 160 | $sutsq->{_note} = 'sutsq'.$sutsq->{_note}; | ||
| 161 | return ( $sutsq->{_note} ); | ||
| 162 | |||
| 163 | } | ||
| 164 | |||
| 165 | |||
| 166 | |||
| 167 | =head2 sub clear | ||
| 168 | |||
| 169 | =cut | ||
| 170 | |||
| 171 | sub clear { | ||
| 172 | |||
| 173 | $sutsq->{_dt} = ''; | ||
| 174 | $sutsq->{_flag} = ''; | ||
| 175 | $sutsq->{_tmin} = ''; | ||
| 176 | $sutsq->{_Step} = ''; | ||
| 177 | $sutsq->{_note} = ''; | ||
| 178 | } | ||
| 179 | |||
| 180 | |||
| 181 | |||
| 182 | =head2 sub dt | ||
| 183 | |||
| 184 | |||
| 185 | =cut | ||
| 186 | |||
| 187 | sub dt { | ||
| 188 | |||
| 189 | my ( $self,$dt ) = @_; | ||
| 190 | if ( $dt ne $empty_string ) { | ||
| 191 | |||
| 192 | $sutsq->{_dt} = $dt; | ||
| 193 | $sutsq->{_note} = $sutsq->{_note}.' dt='.$sutsq->{_dt}; | ||
| 194 | $sutsq->{_Step} = $sutsq->{_Step}.' dt='.$sutsq->{_dt}; | ||
| 195 | |||
| 196 | } else { | ||
| 197 | print("sutsq, dt, missing dt,\n"); | ||
| 198 | } | ||
| 199 | } | ||
| 200 | |||
| 201 | |||
| 202 | =head2 sub flag | ||
| 203 | |||
| 204 | |||
| 205 | =cut | ||
| 206 | |||
| 207 | sub flag { | ||
| 208 | |||
| 209 | my ( $self,$flag ) = @_; | ||
| 210 | if ( $flag ne $empty_string ) { | ||
| 211 | |||
| 212 | $sutsq->{_flag} = $flag; | ||
| 213 | $sutsq->{_note} = $sutsq->{_note}.' flag='.$sutsq->{_flag}; | ||
| 214 | $sutsq->{_Step} = $sutsq->{_Step}.' flag='.$sutsq->{_flag}; | ||
| 215 | |||
| 216 | } else { | ||
| 217 | print("sutsq, flag, missing flag,\n"); | ||
| 218 | } | ||
| 219 | } | ||
| 220 | |||
| 221 | |||
| 222 | =head2 sub tmin | ||
| 223 | |||
| 224 | |||
| 225 | =cut | ||
| 226 | |||
| 227 | sub tmin { | ||
| 228 | |||
| 229 | my ( $self,$tmin ) = @_; | ||
| 230 | if ( $tmin ne $empty_string ) { | ||
| 231 | |||
| 232 | $sutsq->{_tmin} = $tmin; | ||
| 233 | $sutsq->{_note} = $sutsq->{_note}.' tmin='.$sutsq->{_tmin}; | ||
| 234 | $sutsq->{_Step} = $sutsq->{_Step}.' tmin='.$sutsq->{_tmin}; | ||
| 235 | |||
| 236 | } else { | ||
| 237 | print("sutsq, tmin, missing tmin,\n"); | ||
| 238 | } | ||
| 239 | } | ||
| 240 | |||
| 241 | |||
| 242 | =head2 sub get_max_index | ||
| 243 | |||
| 244 | max index = number of input variables -1 | ||
| 245 | |||
| 246 | =cut | ||
| 247 | |||
| 248 | sub get_max_index { | ||
| 249 | my ($self) = @_; | ||
| 250 | my $max_index = 3; | ||
| 251 | |||
| 252 | return($max_index); | ||
| 253 | } | ||
| 254 | |||
| 255 | |||
| 256 | 1; |