« lib/App/SeismicUnixGui/misc/premmod.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/supws.pm »
| 1 | package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sulog; | ||
| 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 | SULOG -- time axis log-stretch of seismic traces | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | sulog [optional parameters] <stdin >stdout | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Required parameters: | ||
| 33 | |||
| 34 | none | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | Optional parameters: | ||
| 39 | |||
| 40 | ntmin= .1*nt minimum time sample of interest | ||
| 41 | |||
| 42 | outpar=/dev/tty output parameter file, contains: | ||
| 43 | |||
| 44 | number of samples (nt=) | ||
| 45 | |||
| 46 | minimum time sample (ntmin=) | ||
| 47 | |||
| 48 | output number of samples (ntau=) | ||
| 49 | |||
| 50 | m=3 length of stretched data | ||
| 51 | |||
| 52 | is set according to | ||
| 53 | |||
| 54 | ntau = nextpow(m*nt) | ||
| 55 | |||
| 56 | ntau= pow of 2 override for length of stretched | ||
| 57 | |||
| 58 | data (useful for padding zeros | ||
| 59 | |||
| 60 | to avoid aliasing) | ||
| 61 | |||
| 62 | |||
| 63 | |||
| 64 | NOTES: | ||
| 65 | |||
| 66 | ntmin is required to avoid taking log of zero and to | ||
| 67 | |||
| 68 | keep number of outsamples (ntau) from becoming enormous. | ||
| 69 | |||
| 70 | Data above ntmin is zeroed out. | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | The output parameters will be needed by suilog to | ||
| 75 | |||
| 76 | reconstruct the original data. | ||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | EXAMPLE PROCESSING SEQUENCE: | ||
| 81 | |||
| 82 | sulog outpar=logpar <data1 >data2 | ||
| 83 | |||
| 84 | suilog par=logpar <data2 >data3 | ||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | Credits: | ||
| 91 | |||
| 92 | CWP: Shuki, Chris | ||
| 93 | |||
| 94 | |||
| 95 | |||
| 96 | Caveats: | ||
| 97 | |||
| 98 | Amplitudes are not well preserved. | ||
| 99 | |||
| 100 | |||
| 101 | |||
| 102 | Trace header fields accessed: ns, dt | ||
| 103 | |||
| 104 | Trace header fields modified: ns, dt | ||
| 105 | |||
| 106 | |||
| 107 | |||
| 108 | =head2 User's notes (Juan Lorenzo) | ||
| 109 | untested | ||
| 110 | |||
| 111 | =cut | ||
| 112 | |||
| 113 | |||
| 114 | =head2 CHANGES and their DATES | ||
| 115 | |||
| 116 | =cut | ||
| 117 | |||
| 118 | use Moose; | ||
| 119 | our $VERSION = '0.0.1'; | ||
| 120 | |||
| 121 | |||
| 122 | =head2 Import packages | ||
| 123 | |||
| 124 | =cut | ||
| 125 | |||
| 126 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 127 | |||
| 128 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 129 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 130 | |||
| 131 | |||
| 132 | =head2 instantiation of packages | ||
| 133 | |||
| 134 | =cut | ||
| 135 | |||
| 136 | my $get = L_SU_global_constants->new(); | ||
| 137 | my $Project = Project_config->new(); | ||
| 138 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 139 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 140 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 141 | |||
| 142 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 143 | |||
| 144 | my $var = $get->var(); | ||
| 145 | my $on = $var->{_on}; | ||
| 146 | my $off = $var->{_off}; | ||
| 147 | my $true = $var->{_true}; | ||
| 148 | my $false = $var->{_false}; | ||
| 149 | my $empty_string = $var->{_empty_string}; | ||
| 150 | |||
| 151 | =head2 Encapsulated | ||
| 152 | hash of private variables | ||
| 153 | |||
| 154 | =cut | ||
| 155 | |||
| 156 | my $sulog = { | ||
| 157 | _m => '', | ||
| 158 | _nt => '', | ||
| 159 | _ntau => '', | ||
| 160 | _ntmin => '', | ||
| 161 | _outpar => '', | ||
| 162 | _par => '', | ||
| 163 | _Step => '', | ||
| 164 | _note => '', | ||
| 165 | |||
| 166 | }; | ||
| 167 | |||
| 168 | =head2 sub Step | ||
| 169 | |||
| 170 | collects switches and assembles bash instructions | ||
| 171 | by adding the program name | ||
| 172 | |||
| 173 | =cut | ||
| 174 | |||
| 175 | sub Step { | ||
| 176 | |||
| 177 | $sulog->{_Step} = 'sulog'.$sulog->{_Step}; | ||
| 178 | return ( $sulog->{_Step} ); | ||
| 179 | |||
| 180 | } | ||
| 181 | |||
| 182 | |||
| 183 | =head2 sub note | ||
| 184 | |||
| 185 | collects switches and assembles bash instructions | ||
| 186 | by adding the program name | ||
| 187 | |||
| 188 | =cut | ||
| 189 | |||
| 190 | sub note { | ||
| 191 | |||
| 192 | $sulog->{_note} = 'sulog'.$sulog->{_note}; | ||
| 193 | return ( $sulog->{_note} ); | ||
| 194 | |||
| 195 | } | ||
| 196 | |||
| 197 | |||
| 198 | |||
| 199 | =head2 sub clear | ||
| 200 | |||
| 201 | =cut | ||
| 202 | |||
| 203 | sub clear { | ||
| 204 | |||
| 205 | $sulog->{_m} = ''; | ||
| 206 | $sulog->{_nt} = ''; | ||
| 207 | $sulog->{_ntau} = ''; | ||
| 208 | $sulog->{_ntmin} = ''; | ||
| 209 | $sulog->{_outpar} = ''; | ||
| 210 | $sulog->{_par} = ''; | ||
| 211 | $sulog->{_Step} = ''; | ||
| 212 | $sulog->{_note} = ''; | ||
| 213 | } | ||
| 214 | |||
| 215 | |||
| 216 | =head2 sub m | ||
| 217 | |||
| 218 | |||
| 219 | =cut | ||
| 220 | |||
| 221 | sub m { | ||
| 222 | |||
| 223 | my ( $self,$m ) = @_; | ||
| 224 | if ( $m ne $empty_string ) { | ||
| 225 | |||
| 226 | $sulog->{_m} = $m; | ||
| 227 | $sulog->{_note} = $sulog->{_note}.' m='.$sulog->{_m}; | ||
| 228 | $sulog->{_Step} = $sulog->{_Step}.' m='.$sulog->{_m}; | ||
| 229 | |||
| 230 | } else { | ||
| 231 | print("sulog, m, missing m,\n"); | ||
| 232 | } | ||
| 233 | } | ||
| 234 | |||
| 235 | |||
| 236 | =head2 sub nt | ||
| 237 | |||
| 238 | |||
| 239 | =cut | ||
| 240 | |||
| 241 | sub nt { | ||
| 242 | |||
| 243 | my ( $self,$nt ) = @_; | ||
| 244 | if ( $nt ne $empty_string ) { | ||
| 245 | |||
| 246 | $sulog->{_nt} = $nt; | ||
| 247 | $sulog->{_note} = $sulog->{_note}.' nt='.$sulog->{_nt}; | ||
| 248 | $sulog->{_Step} = $sulog->{_Step}.' nt='.$sulog->{_nt}; | ||
| 249 | |||
| 250 | } else { | ||
| 251 | print("sulog, nt, missing nt,\n"); | ||
| 252 | } | ||
| 253 | } | ||
| 254 | |||
| 255 | |||
| 256 | =head2 sub ntau | ||
| 257 | |||
| 258 | |||
| 259 | =cut | ||
| 260 | |||
| 261 | sub ntau { | ||
| 262 | |||
| 263 | my ( $self,$ntau ) = @_; | ||
| 264 | if ( $ntau ne $empty_string ) { | ||
| 265 | |||
| 266 | $sulog->{_ntau} = $ntau; | ||
| 267 | $sulog->{_note} = $sulog->{_note}.' ntau='.$sulog->{_ntau}; | ||
| 268 | $sulog->{_Step} = $sulog->{_Step}.' ntau='.$sulog->{_ntau}; | ||
| 269 | |||
| 270 | } else { | ||
| 271 | print("sulog, ntau, missing ntau,\n"); | ||
| 272 | } | ||
| 273 | } | ||
| 274 | |||
| 275 | |||
| 276 | =head2 sub ntmin | ||
| 277 | |||
| 278 | |||
| 279 | =cut | ||
| 280 | |||
| 281 | sub ntmin { | ||
| 282 | |||
| 283 | my ( $self,$ntmin ) = @_; | ||
| 284 | if ( $ntmin ne $empty_string ) { | ||
| 285 | |||
| 286 | $sulog->{_ntmin} = $ntmin; | ||
| 287 | $sulog->{_note} = $sulog->{_note}.' ntmin='.$sulog->{_ntmin}; | ||
| 288 | $sulog->{_Step} = $sulog->{_Step}.' ntmin='.$sulog->{_ntmin}; | ||
| 289 | |||
| 290 | } else { | ||
| 291 | print("sulog, ntmin, missing ntmin,\n"); | ||
| 292 | } | ||
| 293 | } | ||
| 294 | |||
| 295 | |||
| 296 | =head2 sub outpar | ||
| 297 | |||
| 298 | |||
| 299 | =cut | ||
| 300 | |||
| 301 | sub outpar { | ||
| 302 | |||
| 303 | my ( $self,$outpar ) = @_; | ||
| 304 | if ( $outpar ne $empty_string ) { | ||
| 305 | |||
| 306 | $sulog->{_outpar} = $outpar; | ||
| 307 | $sulog->{_note} = $sulog->{_note}.' outpar='.$sulog->{_outpar}; | ||
| 308 | $sulog->{_Step} = $sulog->{_Step}.' outpar='.$sulog->{_outpar}; | ||
| 309 | |||
| 310 | } else { | ||
| 311 | print("sulog, outpar, missing outpar,\n"); | ||
| 312 | } | ||
| 313 | } | ||
| 314 | |||
| 315 | |||
| 316 | =head2 sub par | ||
| 317 | |||
| 318 | |||
| 319 | =cut | ||
| 320 | |||
| 321 | sub par { | ||
| 322 | |||
| 323 | my ( $self,$par ) = @_; | ||
| 324 | if ( $par ne $empty_string ) { | ||
| 325 | |||
| 326 | $sulog->{_par} = $par; | ||
| 327 | $sulog->{_note} = $sulog->{_note}.' par='.$sulog->{_par}; | ||
| 328 | $sulog->{_Step} = $sulog->{_Step}.' par='.$sulog->{_par}; | ||
| 329 | |||
| 330 | } else { | ||
| 331 | print("sulog, par, missing par,\n"); | ||
| 332 | } | ||
| 333 | } | ||
| 334 | |||
| 335 | |||
| 336 | =head2 sub get_max_index | ||
| 337 | |||
| 338 | max index = number of input variables -1 | ||
| 339 | |||
| 340 | =cut | ||
| 341 | |||
| 342 | sub get_max_index { | ||
| 343 | my ($self) = @_; | ||
| 344 | my $max_index = 5; | ||
| 345 | |||
| 346 | return($max_index); | ||
| 347 | } | ||
| 348 | |||
| 349 | |||
| 350 | 1; |