« lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/sudmofk.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/NMO_Vel_Stk/sutaupnmo.pm »
| 1 | package App::SeismicUnixGui::sunix::NMO_Vel_Stk::sunmo_a; | ||
| 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 | SUNMO_a - NMO for an arbitrary velocity function of time and CDP with | ||
| 25 | |||
| 26 | experimental Anisotropy options | ||
| 27 | |||
| 28 | sunmo <stdin >stdout [optional parameters] | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Optional Parameters: | ||
| 33 | |||
| 34 | tnmo=0,... NMO times corresponding to velocities in vnmo | ||
| 35 | |||
| 36 | vnmo=1500,.. NMO velocities corresponding to times in tnmo | ||
| 37 | |||
| 38 | anis1=0 two anisotropy coefficients making up quartic term | ||
| 39 | |||
| 40 | anis2=0 in traveltime curve, corresponding to times in tnmo | ||
| 41 | |||
| 42 | cdp= CDPs for which vnmo & tnmo are specified (see Notes) | ||
| 43 | |||
| 44 | smute=1.5 samples with NMO stretch exceeding smute are zeroed | ||
| 45 | |||
| 46 | lmute=25 length (in samples) of linear ramp for stretch mute | ||
| 47 | |||
| 48 | sscale=1 =1 to divide output samples by NMO stretch factor | ||
| 49 | |||
| 50 | invert=0 =1 to perform (approximate) inverse NMO | ||
| 51 | |||
| 52 | upward=0 =1 to scan upward to find first sample to kill | ||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | Notes: | ||
| 57 | |||
| 58 | For constant-velocity NMO, specify only one vnmo=constant and omit tnmo. | ||
| 59 | |||
| 60 | |||
| 61 | |||
| 62 | NMO interpolation error is less than 1 0.000000or frequencies less than 600f | ||
| 63 | |||
| 64 | the Nyquist frequency. | ||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | Exact inverse NMO is impossible, particularly for early times at large | ||
| 69 | |||
| 70 | offsets and for frequencies near Nyquist with large interpolation errors. | ||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | The "offset" header field must be set. | ||
| 75 | |||
| 76 | Use suazimuth to set offset header field when sx,sy,gx,gy are all | ||
| 77 | |||
| 78 | nonzero. | ||
| 79 | |||
| 80 | |||
| 81 | |||
| 82 | For NMO with a velocity function of time only, specify the arrays | ||
| 83 | |||
| 84 | vnmo=v1,v2,... tnmo=t1,t2,... | ||
| 85 | |||
| 86 | where v1 is the velocity at time t1, v2 is the velocity at time t2, ... | ||
| 87 | |||
| 88 | The times specified in the tnmo array must be monotonically increasing. | ||
| 89 | |||
| 90 | Linear interpolation and constant extrapolation of the specified velocities | ||
| 91 | |||
| 92 | is used to compute the velocities at times not specified. | ||
| 93 | |||
| 94 | The same holds for the anisotropy coefficients as a function of time only. | ||
| 95 | |||
| 96 | |||
| 97 | |||
| 98 | For NMO with a velocity function of time and CDP, specify the array | ||
| 99 | |||
| 100 | cdp=cdp1,cdp2,... | ||
| 101 | |||
| 102 | and, for each CDP specified, specify the vnmo and tnmo arrays as described | ||
| 103 | |||
| 104 | above. The first (vnmo,tnmo) pair corresponds to the first cdp, and so on. | ||
| 105 | |||
| 106 | Linear interpolation and constant extrapolation of 1/velocity^2 is used | ||
| 107 | |||
| 108 | to compute velocities at CDPs not specified. | ||
| 109 | |||
| 110 | |||
| 111 | |||
| 112 | Anisotropy option: | ||
| 113 | |||
| 114 | Caveat, this is an experimental option, | ||
| 115 | |||
| 116 | |||
| 117 | |||
| 118 | The anisotropy coefficients anis1, anis2 permit non-hyperbolicity due | ||
| 119 | |||
| 120 | to layering, mode conversion, or anisotropy. Default is isotropic NMO. | ||
| 121 | |||
| 122 | |||
| 123 | |||
| 124 | The same holds for the anisotropy coefficients as a function of time and | ||
| 125 | |||
| 126 | CDP. | ||
| 127 | |||
| 128 | |||
| 129 | |||
| 130 | Moveout is defined by | ||
| 131 | |||
| 132 | |||
| 133 | |||
| 134 | 1 anis1 | ||
| 135 | |||
| 136 | --- x^2 + ------------- x^4. | ||
| 137 | |||
| 138 | v^2 1 + anis2 x^2 | ||
| 139 | |||
| 140 | |||
| 141 | |||
| 142 | Note: In general, the user should set the cdp parameter. The default is | ||
| 143 | |||
| 144 | to use tr.cdp from the first trace and assume only one cdp. | ||
| 145 | |||
| 146 | Caveat: | ||
| 147 | |||
| 148 | Nmo cannot handle negative moveout as in triplication caused by | ||
| 149 | |||
| 150 | anisotropy. But negative moveout happens necessarily for negative anis1 at | ||
| 151 | |||
| 152 | sufficiently large offsets. Then the error-negative moveout- is printed. | ||
| 153 | |||
| 154 | Check anis1. An error (anis2 too small) is also printed if the | ||
| 155 | |||
| 156 | denominator of the quartic term becomes negative. Check anis2. These errors | ||
| 157 | |||
| 158 | are prompted even if they occur in traces which would not survive the | ||
| 159 | |||
| 160 | NMO-stretch threshold. Chop off enough far-offset traces (e.g. with suwind) | ||
| 161 | |||
| 162 | if anis1, anis2 are fine for near-offset traces. | ||
| 163 | |||
| 164 | |||
| 165 | |||
| 166 | |||
| 167 | |||
| 168 | Credits: | ||
| 169 | |||
| 170 | SEP: Shuki, Chuck Sword | ||
| 171 | |||
| 172 | CWP: Shuki, Jack, Dave Hale, Bjoern Rommel | ||
| 173 | |||
| 174 | Modified: 08/08/98 - Carlos E. Theodoro - option for lateral offset | ||
| 175 | |||
| 176 | Modified: 07/11/02 - Sang-yong Suh - | ||
| 177 | |||
| 178 | added "upward" option to handle decreasing velocity function. | ||
| 179 | |||
| 180 | CWP: Sept 2010: John Stockwell | ||
| 181 | |||
| 182 | replaced Carlos Theodoro's fix | ||
| 183 | |||
| 184 | and added the instruction in the selfdoc to use suazimuth to set | ||
| 185 | |||
| 186 | offset so that it accounts for lateral offset | ||
| 187 | |||
| 188 | note that by the segy standard "scalel" does not scale the offset | ||
| 189 | |||
| 190 | field | ||
| 191 | |||
| 192 | Technical Reference: | ||
| 193 | |||
| 194 | The Common Depth Point Stack | ||
| 195 | |||
| 196 | William A. Schneider | ||
| 197 | |||
| 198 | Proc. IEEE, v. 72, n. 10, p. 1238-1254 | ||
| 199 | |||
| 200 | 1984 | ||
| 201 | |||
| 202 | |||
| 203 | |||
| 204 | Trace header fields accessed: ns, dt, delrt, offset, cdp, scalel | ||
| 205 | |||
| 206 | |||
| 207 | |||
| 208 | =head2 User's notes (Juan Lorenzo) | ||
| 209 | untested | ||
| 210 | |||
| 211 | =cut | ||
| 212 | |||
| 213 | |||
| 214 | =head2 CHANGES and their DATES | ||
| 215 | |||
| 216 | =cut | ||
| 217 | |||
| 218 | use Moose; | ||
| 219 | our $VERSION = '0.0.1'; | ||
| 220 | |||
| 221 | |||
| 222 | =head2 Import packages | ||
| 223 | |||
| 224 | =cut | ||
| 225 | |||
| 226 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 227 | |||
| 228 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 229 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 230 | |||
| 231 | |||
| 232 | =head2 instantiation of packages | ||
| 233 | |||
| 234 | =cut | ||
| 235 | |||
| 236 | my $get = L_SU_global_constants->new(); | ||
| 237 | my $Project = Project_config->new(); | ||
| 238 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 239 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 240 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 241 | |||
| 242 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 243 | |||
| 244 | my $var = $get->var(); | ||
| 245 | my $on = $var->{_on}; | ||
| 246 | my $off = $var->{_off}; | ||
| 247 | my $true = $var->{_true}; | ||
| 248 | my $false = $var->{_false}; | ||
| 249 | my $empty_string = $var->{_empty_string}; | ||
| 250 | |||
| 251 | =head2 Encapsulated | ||
| 252 | hash of private variables | ||
| 253 | |||
| 254 | =cut | ||
| 255 | |||
| 256 | my $sunmo_a = { | ||
| 257 | _anis1 => '', | ||
| 258 | _anis2 => '', | ||
| 259 | _cdp => '', | ||
| 260 | _invert => '', | ||
| 261 | _lmute => '', | ||
| 262 | _smute => '', | ||
| 263 | _sscale => '', | ||
| 264 | _tnmo => '', | ||
| 265 | _upward => '', | ||
| 266 | _vnmo => '', | ||
| 267 | _Step => '', | ||
| 268 | _note => '', | ||
| 269 | |||
| 270 | }; | ||
| 271 | |||
| 272 | =head2 sub Step | ||
| 273 | |||
| 274 | collects switches and assembles bash instructions | ||
| 275 | by adding the program name | ||
| 276 | |||
| 277 | =cut | ||
| 278 | |||
| 279 | sub Step { | ||
| 280 | |||
| 281 | $sunmo_a->{_Step} = 'sunmo_a'.$sunmo_a->{_Step}; | ||
| 282 | return ( $sunmo_a->{_Step} ); | ||
| 283 | |||
| 284 | } | ||
| 285 | |||
| 286 | |||
| 287 | =head2 sub note | ||
| 288 | |||
| 289 | collects switches and assembles bash instructions | ||
| 290 | by adding the program name | ||
| 291 | |||
| 292 | =cut | ||
| 293 | |||
| 294 | sub note { | ||
| 295 | |||
| 296 | $sunmo_a->{_note} = 'sunmo_a'.$sunmo_a->{_note}; | ||
| 297 | return ( $sunmo_a->{_note} ); | ||
| 298 | |||
| 299 | } | ||
| 300 | |||
| 301 | |||
| 302 | |||
| 303 | =head2 sub clear | ||
| 304 | |||
| 305 | =cut | ||
| 306 | |||
| 307 | sub clear { | ||
| 308 | |||
| 309 | $sunmo_a->{_anis1} = ''; | ||
| 310 | $sunmo_a->{_anis2} = ''; | ||
| 311 | $sunmo_a->{_cdp} = ''; | ||
| 312 | $sunmo_a->{_invert} = ''; | ||
| 313 | $sunmo_a->{_lmute} = ''; | ||
| 314 | $sunmo_a->{_smute} = ''; | ||
| 315 | $sunmo_a->{_sscale} = ''; | ||
| 316 | $sunmo_a->{_tnmo} = ''; | ||
| 317 | $sunmo_a->{_upward} = ''; | ||
| 318 | $sunmo_a->{_vnmo} = ''; | ||
| 319 | $sunmo_a->{_Step} = ''; | ||
| 320 | $sunmo_a->{_note} = ''; | ||
| 321 | } | ||
| 322 | |||
| 323 | |||
| 324 | =head2 sub anis1 | ||
| 325 | |||
| 326 | |||
| 327 | =cut | ||
| 328 | |||
| 329 | sub anis1 { | ||
| 330 | |||
| 331 | my ( $self,$anis1 ) = @_; | ||
| 332 | if ( $anis1 ne $empty_string ) { | ||
| 333 | |||
| 334 | $sunmo_a->{_anis1} = $anis1; | ||
| 335 | $sunmo_a->{_note} = $sunmo_a->{_note}.' anis1='.$sunmo_a->{_anis1}; | ||
| 336 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' anis1='.$sunmo_a->{_anis1}; | ||
| 337 | |||
| 338 | } else { | ||
| 339 | print("sunmo_a, anis1, missing anis1,\n"); | ||
| 340 | } | ||
| 341 | } | ||
| 342 | |||
| 343 | |||
| 344 | =head2 sub anis2 | ||
| 345 | |||
| 346 | |||
| 347 | =cut | ||
| 348 | |||
| 349 | sub anis2 { | ||
| 350 | |||
| 351 | my ( $self,$anis2 ) = @_; | ||
| 352 | if ( $anis2 ne $empty_string ) { | ||
| 353 | |||
| 354 | $sunmo_a->{_anis2} = $anis2; | ||
| 355 | $sunmo_a->{_note} = $sunmo_a->{_note}.' anis2='.$sunmo_a->{_anis2}; | ||
| 356 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' anis2='.$sunmo_a->{_anis2}; | ||
| 357 | |||
| 358 | } else { | ||
| 359 | print("sunmo_a, anis2, missing anis2,\n"); | ||
| 360 | } | ||
| 361 | } | ||
| 362 | |||
| 363 | |||
| 364 | =head2 sub cdp | ||
| 365 | |||
| 366 | |||
| 367 | =cut | ||
| 368 | |||
| 369 | sub cdp { | ||
| 370 | |||
| 371 | my ( $self,$cdp ) = @_; | ||
| 372 | if ( $cdp ne $empty_string ) { | ||
| 373 | |||
| 374 | $sunmo_a->{_cdp} = $cdp; | ||
| 375 | $sunmo_a->{_note} = $sunmo_a->{_note}.' cdp='.$sunmo_a->{_cdp}; | ||
| 376 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' cdp='.$sunmo_a->{_cdp}; | ||
| 377 | |||
| 378 | } else { | ||
| 379 | print("sunmo_a, cdp, missing cdp,\n"); | ||
| 380 | } | ||
| 381 | } | ||
| 382 | |||
| 383 | |||
| 384 | =head2 sub invert | ||
| 385 | |||
| 386 | |||
| 387 | =cut | ||
| 388 | |||
| 389 | sub invert { | ||
| 390 | |||
| 391 | my ( $self,$invert ) = @_; | ||
| 392 | if ( $invert ne $empty_string ) { | ||
| 393 | |||
| 394 | $sunmo_a->{_invert} = $invert; | ||
| 395 | $sunmo_a->{_note} = $sunmo_a->{_note}.' invert='.$sunmo_a->{_invert}; | ||
| 396 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' invert='.$sunmo_a->{_invert}; | ||
| 397 | |||
| 398 | } else { | ||
| 399 | print("sunmo_a, invert, missing invert,\n"); | ||
| 400 | } | ||
| 401 | } | ||
| 402 | |||
| 403 | |||
| 404 | =head2 sub lmute | ||
| 405 | |||
| 406 | |||
| 407 | =cut | ||
| 408 | |||
| 409 | sub lmute { | ||
| 410 | |||
| 411 | my ( $self,$lmute ) = @_; | ||
| 412 | if ( $lmute ne $empty_string ) { | ||
| 413 | |||
| 414 | $sunmo_a->{_lmute} = $lmute; | ||
| 415 | $sunmo_a->{_note} = $sunmo_a->{_note}.' lmute='.$sunmo_a->{_lmute}; | ||
| 416 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' lmute='.$sunmo_a->{_lmute}; | ||
| 417 | |||
| 418 | } else { | ||
| 419 | print("sunmo_a, lmute, missing lmute,\n"); | ||
| 420 | } | ||
| 421 | } | ||
| 422 | |||
| 423 | |||
| 424 | =head2 sub smute | ||
| 425 | |||
| 426 | |||
| 427 | =cut | ||
| 428 | |||
| 429 | sub smute { | ||
| 430 | |||
| 431 | my ( $self,$smute ) = @_; | ||
| 432 | if ( $smute ne $empty_string ) { | ||
| 433 | |||
| 434 | $sunmo_a->{_smute} = $smute; | ||
| 435 | $sunmo_a->{_note} = $sunmo_a->{_note}.' smute='.$sunmo_a->{_smute}; | ||
| 436 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' smute='.$sunmo_a->{_smute}; | ||
| 437 | |||
| 438 | } else { | ||
| 439 | print("sunmo_a, smute, missing smute,\n"); | ||
| 440 | } | ||
| 441 | } | ||
| 442 | |||
| 443 | |||
| 444 | =head2 sub sscale | ||
| 445 | |||
| 446 | |||
| 447 | =cut | ||
| 448 | |||
| 449 | sub sscale { | ||
| 450 | |||
| 451 | my ( $self,$sscale ) = @_; | ||
| 452 | if ( $sscale ne $empty_string ) { | ||
| 453 | |||
| 454 | $sunmo_a->{_sscale} = $sscale; | ||
| 455 | $sunmo_a->{_note} = $sunmo_a->{_note}.' sscale='.$sunmo_a->{_sscale}; | ||
| 456 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' sscale='.$sunmo_a->{_sscale}; | ||
| 457 | |||
| 458 | } else { | ||
| 459 | print("sunmo_a, sscale, missing sscale,\n"); | ||
| 460 | } | ||
| 461 | } | ||
| 462 | |||
| 463 | |||
| 464 | =head2 sub tnmo | ||
| 465 | |||
| 466 | |||
| 467 | =cut | ||
| 468 | |||
| 469 | sub tnmo { | ||
| 470 | |||
| 471 | my ( $self,$tnmo ) = @_; | ||
| 472 | if ( $tnmo ne $empty_string ) { | ||
| 473 | |||
| 474 | $sunmo_a->{_tnmo} = $tnmo; | ||
| 475 | $sunmo_a->{_note} = $sunmo_a->{_note}.' tnmo='.$sunmo_a->{_tnmo}; | ||
| 476 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' tnmo='.$sunmo_a->{_tnmo}; | ||
| 477 | |||
| 478 | } else { | ||
| 479 | print("sunmo_a, tnmo, missing tnmo,\n"); | ||
| 480 | } | ||
| 481 | } | ||
| 482 | |||
| 483 | |||
| 484 | =head2 sub upward | ||
| 485 | |||
| 486 | |||
| 487 | =cut | ||
| 488 | |||
| 489 | sub upward { | ||
| 490 | |||
| 491 | my ( $self,$upward ) = @_; | ||
| 492 | if ( $upward ne $empty_string ) { | ||
| 493 | |||
| 494 | $sunmo_a->{_upward} = $upward; | ||
| 495 | $sunmo_a->{_note} = $sunmo_a->{_note}.' upward='.$sunmo_a->{_upward}; | ||
| 496 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' upward='.$sunmo_a->{_upward}; | ||
| 497 | |||
| 498 | } else { | ||
| 499 | print("sunmo_a, upward, missing upward,\n"); | ||
| 500 | } | ||
| 501 | } | ||
| 502 | |||
| 503 | |||
| 504 | =head2 sub vnmo | ||
| 505 | |||
| 506 | |||
| 507 | =cut | ||
| 508 | |||
| 509 | sub vnmo { | ||
| 510 | |||
| 511 | my ( $self,$vnmo ) = @_; | ||
| 512 | if ( $vnmo ne $empty_string ) { | ||
| 513 | |||
| 514 | $sunmo_a->{_vnmo} = $vnmo; | ||
| 515 | $sunmo_a->{_note} = $sunmo_a->{_note}.' vnmo='.$sunmo_a->{_vnmo}; | ||
| 516 | $sunmo_a->{_Step} = $sunmo_a->{_Step}.' vnmo='.$sunmo_a->{_vnmo}; | ||
| 517 | |||
| 518 | } else { | ||
| 519 | print("sunmo_a, vnmo, missing vnmo,\n"); | ||
| 520 | } | ||
| 521 | } | ||
| 522 | |||
| 523 | |||
| 524 | =head2 sub get_max_index | ||
| 525 | |||
| 526 | max index = number of input variables -1 | ||
| 527 | |||
| 528 | =cut | ||
| 529 | |||
| 530 | sub get_max_index { | ||
| 531 | my ($self) = @_; | ||
| 532 | my $max_index = 9; | ||
| 533 | |||
| 534 | return($max_index); | ||
| 535 | } | ||
| 536 | |||
| 537 | |||
| 538 | 1; |