« lib/App/SeismicUnixGui/sunix/model/elatriuni.pm
↑ Summary
lib/App/SeismicUnixGui/big_streams/iSelect_tr_Sumute_bottom.pm »
| 1 | package App::SeismicUnixGui::sunix::model::suimp2d; | ||
| 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 | SUIMP2D - generate shot records for a line scatterer | ||
| 25 | |||
| 26 | embedded in three dimensions using the Born | ||
| 27 | |||
| 28 | integral equation ", | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | suimp2d [optional parameters] >stdout | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | Optional parameters | ||
| 37 | |||
| 38 | nshot=1 number of shots | ||
| 39 | |||
| 40 | nrec=1 number of receivers | ||
| 41 | |||
| 42 | c=5000 speed | ||
| 43 | |||
| 44 | dt=.004 sampling rate | ||
| 45 | |||
| 46 | nt=256 number of samples | ||
| 47 | |||
| 48 | x0=1000 point scatterer location | ||
| 49 | |||
| 50 | z0=1000 point scatterer location | ||
| 51 | |||
| 52 | sxmin=0 first shot location | ||
| 53 | |||
| 54 | szmin=0 first shot location | ||
| 55 | |||
| 56 | gxmin=0 first receiver location | ||
| 57 | |||
| 58 | gzmin=0 first receiver location | ||
| 59 | |||
| 60 | dsx=100 x-step in shot location | ||
| 61 | |||
| 62 | dsz=0 z-step in shot location | ||
| 63 | |||
| 64 | dgx=100 x-step in receiver location | ||
| 65 | |||
| 66 | dgz=0 z-step in receiver location | ||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | Example: | ||
| 71 | |||
| 72 | suimp2d nrec=32 | sufilter | supswigp | ... | ||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | Credits: | ||
| 79 | |||
| 80 | CWP: Norm Bleistein, Jack K. Cohen | ||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | Theory: Use the 3D Born integral equation (e.g., Geophysics, | ||
| 87 | |||
| 88 | v51, n8, p1554(7)). Use 2-D delta function for alpha and do | ||
| 89 | |||
| 90 | remaining y-integral by stationary phase. | ||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | Note: Setting a 2D offset in a single offset field beats the | ||
| 95 | |||
| 96 | hell out of us. We did _something_. | ||
| 97 | |||
| 98 | |||
| 99 | |||
| 100 | Trace header fields set: ns, dt, tracl, tracr, fldr, sx, selev, | ||
| 101 | |||
| 102 | gx, gelev, offset | ||
| 103 | |||
| 104 | |||
| 105 | |||
| 106 | =head2 User's notes (Juan Lorenzo) | ||
| 107 | untested | ||
| 108 | |||
| 109 | =cut | ||
| 110 | |||
| 111 | |||
| 112 | =head2 CHANGES and their DATES | ||
| 113 | |||
| 114 | =cut | ||
| 115 | |||
| 116 | use Moose; | ||
| 117 | our $VERSION = '0.0.1'; | ||
| 118 | |||
| 119 | |||
| 120 | =head2 Import packages | ||
| 121 | |||
| 122 | =cut | ||
| 123 | |||
| 124 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 125 | |||
| 126 | use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin); | ||
| 127 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 128 | |||
| 129 | |||
| 130 | =head2 instantiation of packages | ||
| 131 | |||
| 132 | =cut | ||
| 133 | |||
| 134 | my $get = L_SU_global_constants->new(); | ||
| 135 | my $Project = Project_config->new(); | ||
| 136 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 137 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 138 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 139 | |||
| 140 | my $var = $get->var(); | ||
| 141 | my $on = $var->{_on}; | ||
| 142 | my $off = $var->{_off}; | ||
| 143 | my $true = $var->{_true}; | ||
| 144 | my $false = $var->{_false}; | ||
| 145 | my $empty_string = $var->{_empty_string}; | ||
| 146 | |||
| 147 | =head2 Encapsulated | ||
| 148 | hash of private variables | ||
| 149 | |||
| 150 | =cut | ||
| 151 | |||
| 152 | my $suimp2d = { | ||
| 153 | _c => '', | ||
| 154 | _dgx => '', | ||
| 155 | _dgz => '', | ||
| 156 | _dsx => '', | ||
| 157 | _dsz => '', | ||
| 158 | _dt => '', | ||
| 159 | _gxmin => '', | ||
| 160 | _gzmin => '', | ||
| 161 | _nrec => '', | ||
| 162 | _nshot => '', | ||
| 163 | _nt => '', | ||
| 164 | _sxmin => '', | ||
| 165 | _szmin => '', | ||
| 166 | _x0 => '', | ||
| 167 | _z0 => '', | ||
| 168 | _Step => '', | ||
| 169 | _note => '', | ||
| 170 | |||
| 171 | }; | ||
| 172 | |||
| 173 | =head2 sub Step | ||
| 174 | |||
| 175 | collects switches and assembles bash instructions | ||
| 176 | by adding the program name | ||
| 177 | |||
| 178 | =cut | ||
| 179 | |||
| 180 | sub Step { | ||
| 181 | |||
| 182 | $suimp2d->{_Step} = 'suimp2d'.$suimp2d->{_Step}; | ||
| 183 | return ( $suimp2d->{_Step} ); | ||
| 184 | |||
| 185 | } | ||
| 186 | |||
| 187 | |||
| 188 | =head2 sub note | ||
| 189 | |||
| 190 | collects switches and assembles bash instructions | ||
| 191 | by adding the program name | ||
| 192 | |||
| 193 | =cut | ||
| 194 | |||
| 195 | sub note { | ||
| 196 | |||
| 197 | $suimp2d->{_note} = 'suimp2d'.$suimp2d->{_note}; | ||
| 198 | return ( $suimp2d->{_note} ); | ||
| 199 | |||
| 200 | } | ||
| 201 | |||
| 202 | |||
| 203 | |||
| 204 | =head2 sub clear | ||
| 205 | |||
| 206 | =cut | ||
| 207 | |||
| 208 | sub clear { | ||
| 209 | |||
| 210 | $suimp2d->{_c} = ''; | ||
| 211 | $suimp2d->{_dgx} = ''; | ||
| 212 | $suimp2d->{_dgz} = ''; | ||
| 213 | $suimp2d->{_dsx} = ''; | ||
| 214 | $suimp2d->{_dsz} = ''; | ||
| 215 | $suimp2d->{_dt} = ''; | ||
| 216 | $suimp2d->{_gxmin} = ''; | ||
| 217 | $suimp2d->{_gzmin} = ''; | ||
| 218 | $suimp2d->{_nrec} = ''; | ||
| 219 | $suimp2d->{_nshot} = ''; | ||
| 220 | $suimp2d->{_nt} = ''; | ||
| 221 | $suimp2d->{_sxmin} = ''; | ||
| 222 | $suimp2d->{_szmin} = ''; | ||
| 223 | $suimp2d->{_x0} = ''; | ||
| 224 | $suimp2d->{_z0} = ''; | ||
| 225 | $suimp2d->{_Step} = ''; | ||
| 226 | $suimp2d->{_note} = ''; | ||
| 227 | } | ||
| 228 | |||
| 229 | |||
| 230 | =head2 sub c | ||
| 231 | |||
| 232 | |||
| 233 | =cut | ||
| 234 | |||
| 235 | sub c { | ||
| 236 | |||
| 237 | my ( $self,$c ) = @_; | ||
| 238 | if ( $c ne $empty_string ) { | ||
| 239 | |||
| 240 | $suimp2d->{_c} = $c; | ||
| 241 | $suimp2d->{_note} = $suimp2d->{_note}.' c='.$suimp2d->{_c}; | ||
| 242 | $suimp2d->{_Step} = $suimp2d->{_Step}.' c='.$suimp2d->{_c}; | ||
| 243 | |||
| 244 | } else { | ||
| 245 | print("suimp2d, c, missing c,\n"); | ||
| 246 | } | ||
| 247 | } | ||
| 248 | |||
| 249 | |||
| 250 | =head2 sub dgx | ||
| 251 | |||
| 252 | |||
| 253 | =cut | ||
| 254 | |||
| 255 | sub dgx { | ||
| 256 | |||
| 257 | my ( $self,$dgx ) = @_; | ||
| 258 | if ( $dgx ne $empty_string ) { | ||
| 259 | |||
| 260 | $suimp2d->{_dgx} = $dgx; | ||
| 261 | $suimp2d->{_note} = $suimp2d->{_note}.' dgx='.$suimp2d->{_dgx}; | ||
| 262 | $suimp2d->{_Step} = $suimp2d->{_Step}.' dgx='.$suimp2d->{_dgx}; | ||
| 263 | |||
| 264 | } else { | ||
| 265 | print("suimp2d, dgx, missing dgx,\n"); | ||
| 266 | } | ||
| 267 | } | ||
| 268 | |||
| 269 | |||
| 270 | =head2 sub dgz | ||
| 271 | |||
| 272 | |||
| 273 | =cut | ||
| 274 | |||
| 275 | sub dgz { | ||
| 276 | |||
| 277 | my ( $self,$dgz ) = @_; | ||
| 278 | if ( $dgz ne $empty_string ) { | ||
| 279 | |||
| 280 | $suimp2d->{_dgz} = $dgz; | ||
| 281 | $suimp2d->{_note} = $suimp2d->{_note}.' dgz='.$suimp2d->{_dgz}; | ||
| 282 | $suimp2d->{_Step} = $suimp2d->{_Step}.' dgz='.$suimp2d->{_dgz}; | ||
| 283 | |||
| 284 | } else { | ||
| 285 | print("suimp2d, dgz, missing dgz,\n"); | ||
| 286 | } | ||
| 287 | } | ||
| 288 | |||
| 289 | |||
| 290 | =head2 sub dsx | ||
| 291 | |||
| 292 | |||
| 293 | =cut | ||
| 294 | |||
| 295 | sub dsx { | ||
| 296 | |||
| 297 | my ( $self,$dsx ) = @_; | ||
| 298 | if ( $dsx ne $empty_string ) { | ||
| 299 | |||
| 300 | $suimp2d->{_dsx} = $dsx; | ||
| 301 | $suimp2d->{_note} = $suimp2d->{_note}.' dsx='.$suimp2d->{_dsx}; | ||
| 302 | $suimp2d->{_Step} = $suimp2d->{_Step}.' dsx='.$suimp2d->{_dsx}; | ||
| 303 | |||
| 304 | } else { | ||
| 305 | print("suimp2d, dsx, missing dsx,\n"); | ||
| 306 | } | ||
| 307 | } | ||
| 308 | |||
| 309 | |||
| 310 | =head2 sub dsz | ||
| 311 | |||
| 312 | |||
| 313 | =cut | ||
| 314 | |||
| 315 | sub dsz { | ||
| 316 | |||
| 317 | my ( $self,$dsz ) = @_; | ||
| 318 | if ( $dsz ne $empty_string ) { | ||
| 319 | |||
| 320 | $suimp2d->{_dsz} = $dsz; | ||
| 321 | $suimp2d->{_note} = $suimp2d->{_note}.' dsz='.$suimp2d->{_dsz}; | ||
| 322 | $suimp2d->{_Step} = $suimp2d->{_Step}.' dsz='.$suimp2d->{_dsz}; | ||
| 323 | |||
| 324 | } else { | ||
| 325 | print("suimp2d, dsz, missing dsz,\n"); | ||
| 326 | } | ||
| 327 | } | ||
| 328 | |||
| 329 | |||
| 330 | =head2 sub dt | ||
| 331 | |||
| 332 | |||
| 333 | =cut | ||
| 334 | |||
| 335 | sub dt { | ||
| 336 | |||
| 337 | my ( $self,$dt ) = @_; | ||
| 338 | if ( $dt ne $empty_string ) { | ||
| 339 | |||
| 340 | $suimp2d->{_dt} = $dt; | ||
| 341 | $suimp2d->{_note} = $suimp2d->{_note}.' dt='.$suimp2d->{_dt}; | ||
| 342 | $suimp2d->{_Step} = $suimp2d->{_Step}.' dt='.$suimp2d->{_dt}; | ||
| 343 | |||
| 344 | } else { | ||
| 345 | print("suimp2d, dt, missing dt,\n"); | ||
| 346 | } | ||
| 347 | } | ||
| 348 | |||
| 349 | |||
| 350 | =head2 sub gxmin | ||
| 351 | |||
| 352 | |||
| 353 | =cut | ||
| 354 | |||
| 355 | sub gxmin { | ||
| 356 | |||
| 357 | my ( $self,$gxmin ) = @_; | ||
| 358 | if ( $gxmin ne $empty_string ) { | ||
| 359 | |||
| 360 | $suimp2d->{_gxmin} = $gxmin; | ||
| 361 | $suimp2d->{_note} = $suimp2d->{_note}.' gxmin='.$suimp2d->{_gxmin}; | ||
| 362 | $suimp2d->{_Step} = $suimp2d->{_Step}.' gxmin='.$suimp2d->{_gxmin}; | ||
| 363 | |||
| 364 | } else { | ||
| 365 | print("suimp2d, gxmin, missing gxmin,\n"); | ||
| 366 | } | ||
| 367 | } | ||
| 368 | |||
| 369 | |||
| 370 | =head2 sub gzmin | ||
| 371 | |||
| 372 | |||
| 373 | =cut | ||
| 374 | |||
| 375 | sub gzmin { | ||
| 376 | |||
| 377 | my ( $self,$gzmin ) = @_; | ||
| 378 | if ( $gzmin ne $empty_string ) { | ||
| 379 | |||
| 380 | $suimp2d->{_gzmin} = $gzmin; | ||
| 381 | $suimp2d->{_note} = $suimp2d->{_note}.' gzmin='.$suimp2d->{_gzmin}; | ||
| 382 | $suimp2d->{_Step} = $suimp2d->{_Step}.' gzmin='.$suimp2d->{_gzmin}; | ||
| 383 | |||
| 384 | } else { | ||
| 385 | print("suimp2d, gzmin, missing gzmin,\n"); | ||
| 386 | } | ||
| 387 | } | ||
| 388 | |||
| 389 | |||
| 390 | =head2 sub nrec | ||
| 391 | |||
| 392 | |||
| 393 | =cut | ||
| 394 | |||
| 395 | sub nrec { | ||
| 396 | |||
| 397 | my ( $self,$nrec ) = @_; | ||
| 398 | if ( $nrec ne $empty_string ) { | ||
| 399 | |||
| 400 | $suimp2d->{_nrec} = $nrec; | ||
| 401 | $suimp2d->{_note} = $suimp2d->{_note}.' nrec='.$suimp2d->{_nrec}; | ||
| 402 | $suimp2d->{_Step} = $suimp2d->{_Step}.' nrec='.$suimp2d->{_nrec}; | ||
| 403 | |||
| 404 | } else { | ||
| 405 | print("suimp2d, nrec, missing nrec,\n"); | ||
| 406 | } | ||
| 407 | } | ||
| 408 | |||
| 409 | |||
| 410 | =head2 sub nshot | ||
| 411 | |||
| 412 | |||
| 413 | =cut | ||
| 414 | |||
| 415 | sub nshot { | ||
| 416 | |||
| 417 | my ( $self,$nshot ) = @_; | ||
| 418 | if ( $nshot ne $empty_string ) { | ||
| 419 | |||
| 420 | $suimp2d->{_nshot} = $nshot; | ||
| 421 | $suimp2d->{_note} = $suimp2d->{_note}.' nshot='.$suimp2d->{_nshot}; | ||
| 422 | $suimp2d->{_Step} = $suimp2d->{_Step}.' nshot='.$suimp2d->{_nshot}; | ||
| 423 | |||
| 424 | } else { | ||
| 425 | print("suimp2d, nshot, missing nshot,\n"); | ||
| 426 | } | ||
| 427 | } | ||
| 428 | |||
| 429 | |||
| 430 | =head2 sub nt | ||
| 431 | |||
| 432 | |||
| 433 | =cut | ||
| 434 | |||
| 435 | sub nt { | ||
| 436 | |||
| 437 | my ( $self,$nt ) = @_; | ||
| 438 | if ( $nt ne $empty_string ) { | ||
| 439 | |||
| 440 | $suimp2d->{_nt} = $nt; | ||
| 441 | $suimp2d->{_note} = $suimp2d->{_note}.' nt='.$suimp2d->{_nt}; | ||
| 442 | $suimp2d->{_Step} = $suimp2d->{_Step}.' nt='.$suimp2d->{_nt}; | ||
| 443 | |||
| 444 | } else { | ||
| 445 | print("suimp2d, nt, missing nt,\n"); | ||
| 446 | } | ||
| 447 | } | ||
| 448 | |||
| 449 | |||
| 450 | =head2 sub sxmin | ||
| 451 | |||
| 452 | |||
| 453 | =cut | ||
| 454 | |||
| 455 | sub sxmin { | ||
| 456 | |||
| 457 | my ( $self,$sxmin ) = @_; | ||
| 458 | if ( $sxmin ne $empty_string ) { | ||
| 459 | |||
| 460 | $suimp2d->{_sxmin} = $sxmin; | ||
| 461 | $suimp2d->{_note} = $suimp2d->{_note}.' sxmin='.$suimp2d->{_sxmin}; | ||
| 462 | $suimp2d->{_Step} = $suimp2d->{_Step}.' sxmin='.$suimp2d->{_sxmin}; | ||
| 463 | |||
| 464 | } else { | ||
| 465 | print("suimp2d, sxmin, missing sxmin,\n"); | ||
| 466 | } | ||
| 467 | } | ||
| 468 | |||
| 469 | |||
| 470 | =head2 sub szmin | ||
| 471 | |||
| 472 | |||
| 473 | =cut | ||
| 474 | |||
| 475 | sub szmin { | ||
| 476 | |||
| 477 | my ( $self,$szmin ) = @_; | ||
| 478 | if ( $szmin ne $empty_string ) { | ||
| 479 | |||
| 480 | $suimp2d->{_szmin} = $szmin; | ||
| 481 | $suimp2d->{_note} = $suimp2d->{_note}.' szmin='.$suimp2d->{_szmin}; | ||
| 482 | $suimp2d->{_Step} = $suimp2d->{_Step}.' szmin='.$suimp2d->{_szmin}; | ||
| 483 | |||
| 484 | } else { | ||
| 485 | print("suimp2d, szmin, missing szmin,\n"); | ||
| 486 | } | ||
| 487 | } | ||
| 488 | |||
| 489 | |||
| 490 | =head2 sub x0 | ||
| 491 | |||
| 492 | |||
| 493 | =cut | ||
| 494 | |||
| 495 | sub x0 { | ||
| 496 | |||
| 497 | my ( $self,$x0 ) = @_; | ||
| 498 | if ( $x0 ne $empty_string ) { | ||
| 499 | |||
| 500 | $suimp2d->{_x0} = $x0; | ||
| 501 | $suimp2d->{_note} = $suimp2d->{_note}.' x0='.$suimp2d->{_x0}; | ||
| 502 | $suimp2d->{_Step} = $suimp2d->{_Step}.' x0='.$suimp2d->{_x0}; | ||
| 503 | |||
| 504 | } else { | ||
| 505 | print("suimp2d, x0, missing x0,\n"); | ||
| 506 | } | ||
| 507 | } | ||
| 508 | |||
| 509 | |||
| 510 | =head2 sub z0 | ||
| 511 | |||
| 512 | |||
| 513 | =cut | ||
| 514 | |||
| 515 | sub z0 { | ||
| 516 | |||
| 517 | my ( $self,$z0 ) = @_; | ||
| 518 | if ( $z0 ne $empty_string ) { | ||
| 519 | |||
| 520 | $suimp2d->{_z0} = $z0; | ||
| 521 | $suimp2d->{_note} = $suimp2d->{_note}.' z0='.$suimp2d->{_z0}; | ||
| 522 | $suimp2d->{_Step} = $suimp2d->{_Step}.' z0='.$suimp2d->{_z0}; | ||
| 523 | |||
| 524 | } else { | ||
| 525 | print("suimp2d, z0, missing z0,\n"); | ||
| 526 | } | ||
| 527 | } | ||
| 528 | |||
| 529 | |||
| 530 | =head2 sub get_max_index | ||
| 531 | |||
| 532 | max index = number of input variables -1 | ||
| 533 | |||
| 534 | =cut | ||
| 535 | |||
| 536 | sub get_max_index { | ||
| 537 | my ($self) = @_; | ||
| 538 | my $max_index = 14; | ||
| 539 | |||
| 540 | return($max_index); | ||
| 541 | } | ||
| 542 | |||
| 543 | |||
| 544 | 1; |