« lib/App/SeismicUnixGui/sunix/header/sustaticB.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/model/cellauto.pm »
| 1 | package App::SeismicUnixGui::sunix::migration::sumigps; | ||
| 2 | |||
| 3 | =head2 SYNOPSIS | ||
| 4 | |||
| 5 | PERL PROGRAM NAME: | ||
| 6 | |||
| 7 | AUTHOR: | ||
| 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 | SUMIGPS - MIGration by Phase Shift with turning rays | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | sumigps <stdin >stdout [optional parms] | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | Required Parameters: | ||
| 33 | |||
| 34 | None | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | Optional Parameters: | ||
| 39 | |||
| 40 | dt=from header(dt) or .004 time sampling interval | ||
| 41 | |||
| 42 | dx=from header(d2) or 1.0 distance between sucessive cdp's | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | ffil=0 | ||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | 0,0,0.5/dt,0.5/dt trapezoidal window of frequencies to migrate | ||
| 51 | |||
| 52 | tmig=0.0 times corresponding to interval velocities in vmig | ||
| 53 | |||
| 54 | vmig=1500.0 interval velocities corresponding to times in tmig | ||
| 55 | |||
| 56 | vfile= binary (non-ascii) file containing velocities v(t) | ||
| 57 | |||
| 58 | nxpad=0 number of cdps to pad with zeros before FFT | ||
| 59 | |||
| 60 | ltaper=0 length of linear taper for left and right edges", | ||
| 61 | |||
| 62 | verbose=0 =1 for diagnostic print | ||
| 63 | |||
| 64 | |||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | tmpdir= if non-empty, use the value as a directory path | ||
| 69 | |||
| 70 | prefix for storing temporary files; else if the | ||
| 71 | |||
| 72 | the CWP_TMPDIR environment variable is set use | ||
| 73 | |||
| 74 | its value for the path; else use tmpfile() | ||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | Notes: | ||
| 79 | |||
| 80 | Input traces must be sorted by either increasing or decreasing cdp. | ||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | The tmig and vmig arrays specify an interval velocity function of time. | ||
| 85 | |||
| 86 | Linear interpolation and constant extrapolation is used to determine | ||
| 87 | |||
| 88 | interval velocities at times not specified. Values specified in tmig | ||
| 89 | |||
| 90 | must increase monotonically. | ||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | Alternatively, interval velocities may be stored in a binary file | ||
| 95 | |||
| 96 | containing one velocity for every time sample. If vfile is specified, | ||
| 97 | |||
| 98 | then the tmig and vmig arrays are ignored. | ||
| 99 | |||
| 100 | |||
| 101 | |||
| 102 | The time of first sample is assumed to be zero, regardless of the value | ||
| 103 | |||
| 104 | of the trace header field delrt. | ||
| 105 | |||
| 106 | |||
| 107 | |||
| 108 | Credits: | ||
| 109 | |||
| 110 | CWP: Dave Hale (originally called supsmig.c) | ||
| 111 | |||
| 112 | |||
| 113 | |||
| 114 | Trace header fields accessed: ns, dt, d2 | ||
| 115 | |||
| 116 | |||
| 117 | |||
| 118 | =head2 User's notes (Juan Lorenzo) | ||
| 119 | untested | ||
| 120 | |||
| 121 | =cut | ||
| 122 | |||
| 123 | |||
| 124 | =head2 CHANGES and their DATES | ||
| 125 | |||
| 126 | =cut | ||
| 127 | |||
| 128 | use Moose; | ||
| 129 | our $VERSION = '0.0.1'; | ||
| 130 | |||
| 131 | |||
| 132 | =head2 Import packages | ||
| 133 | |||
| 134 | =cut | ||
| 135 | |||
| 136 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 137 | |||
| 138 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 139 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 140 | |||
| 141 | |||
| 142 | =head2 instantiation of packages | ||
| 143 | |||
| 144 | =cut | ||
| 145 | |||
| 146 | my $get = L_SU_global_constants->new(); | ||
| 147 | my $Project = Project_config->new(); | ||
| 148 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 149 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 150 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 151 | |||
| 152 | my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 153 | |||
| 154 | my $var = $get->var(); | ||
| 155 | my $on = $var->{_on}; | ||
| 156 | my $off = $var->{_off}; | ||
| 157 | my $true = $var->{_true}; | ||
| 158 | my $false = $var->{_false}; | ||
| 159 | my $empty_string = $var->{_empty_string}; | ||
| 160 | |||
| 161 | =head2 Encapsulated | ||
| 162 | hash of private variables | ||
| 163 | |||
| 164 | =cut | ||
| 165 | |||
| 166 | my $sumigps = { | ||
| 167 | _dt => '', | ||
| 168 | _dx => '', | ||
| 169 | _ffil => '', | ||
| 170 | _ltaper => '', | ||
| 171 | _nxpad => '', | ||
| 172 | _tmig => '', | ||
| 173 | _tmpdir => '', | ||
| 174 | _verbose => '', | ||
| 175 | _vfile => '', | ||
| 176 | _vmig => '', | ||
| 177 | _Step => '', | ||
| 178 | _note => '', | ||
| 179 | |||
| 180 | }; | ||
| 181 | |||
| 182 | =head2 sub Step | ||
| 183 | |||
| 184 | collects switches and assembles bash instructions | ||
| 185 | by adding the program name | ||
| 186 | |||
| 187 | =cut | ||
| 188 | |||
| 189 | sub Step { | ||
| 190 | |||
| 191 | $sumigps->{_Step} = 'sumigps'.$sumigps->{_Step}; | ||
| 192 | return ( $sumigps->{_Step} ); | ||
| 193 | |||
| 194 | } | ||
| 195 | |||
| 196 | |||
| 197 | =head2 sub note | ||
| 198 | |||
| 199 | collects switches and assembles bash instructions | ||
| 200 | by adding the program name | ||
| 201 | |||
| 202 | =cut | ||
| 203 | |||
| 204 | sub note { | ||
| 205 | |||
| 206 | $sumigps->{_note} = 'sumigps'.$sumigps->{_note}; | ||
| 207 | return ( $sumigps->{_note} ); | ||
| 208 | |||
| 209 | } | ||
| 210 | |||
| 211 | |||
| 212 | |||
| 213 | =head2 sub clear | ||
| 214 | |||
| 215 | =cut | ||
| 216 | |||
| 217 | sub clear { | ||
| 218 | |||
| 219 | $sumigps->{_dt} = ''; | ||
| 220 | $sumigps->{_dx} = ''; | ||
| 221 | $sumigps->{_ffil} = ''; | ||
| 222 | $sumigps->{_ltaper} = ''; | ||
| 223 | $sumigps->{_nxpad} = ''; | ||
| 224 | $sumigps->{_tmig} = ''; | ||
| 225 | $sumigps->{_tmpdir} = ''; | ||
| 226 | $sumigps->{_verbose} = ''; | ||
| 227 | $sumigps->{_vfile} = ''; | ||
| 228 | $sumigps->{_vmig} = ''; | ||
| 229 | $sumigps->{_Step} = ''; | ||
| 230 | $sumigps->{_note} = ''; | ||
| 231 | } | ||
| 232 | |||
| 233 | |||
| 234 | =head2 sub dt | ||
| 235 | |||
| 236 | |||
| 237 | =cut | ||
| 238 | |||
| 239 | sub dt { | ||
| 240 | |||
| 241 | my ( $self,$dt ) = @_; | ||
| 242 | if ( $dt ne $empty_string ) { | ||
| 243 | |||
| 244 | $sumigps->{_dt} = $dt; | ||
| 245 | $sumigps->{_note} = $sumigps->{_note}.' dt='.$sumigps->{_dt}; | ||
| 246 | $sumigps->{_Step} = $sumigps->{_Step}.' dt='.$sumigps->{_dt}; | ||
| 247 | |||
| 248 | } else { | ||
| 249 | print("sumigps, dt, missing dt,\n"); | ||
| 250 | } | ||
| 251 | } | ||
| 252 | |||
| 253 | |||
| 254 | =head2 sub dx | ||
| 255 | |||
| 256 | |||
| 257 | =cut | ||
| 258 | |||
| 259 | sub dx { | ||
| 260 | |||
| 261 | my ( $self,$dx ) = @_; | ||
| 262 | if ( $dx ne $empty_string ) { | ||
| 263 | |||
| 264 | $sumigps->{_dx} = $dx; | ||
| 265 | $sumigps->{_note} = $sumigps->{_note}.' dx='.$sumigps->{_dx}; | ||
| 266 | $sumigps->{_Step} = $sumigps->{_Step}.' dx='.$sumigps->{_dx}; | ||
| 267 | |||
| 268 | } else { | ||
| 269 | print("sumigps, dx, missing dx,\n"); | ||
| 270 | } | ||
| 271 | } | ||
| 272 | |||
| 273 | |||
| 274 | =head2 sub ffil | ||
| 275 | |||
| 276 | |||
| 277 | =cut | ||
| 278 | |||
| 279 | sub ffil { | ||
| 280 | |||
| 281 | my ( $self,$ffil ) = @_; | ||
| 282 | if ( $ffil ne $empty_string ) { | ||
| 283 | |||
| 284 | $sumigps->{_ffil} = $ffil; | ||
| 285 | $sumigps->{_note} = $sumigps->{_note}.' ffil='.$sumigps->{_ffil}; | ||
| 286 | $sumigps->{_Step} = $sumigps->{_Step}.' ffil='.$sumigps->{_ffil}; | ||
| 287 | |||
| 288 | } else { | ||
| 289 | print("sumigps, ffil, missing ffil,\n"); | ||
| 290 | } | ||
| 291 | } | ||
| 292 | |||
| 293 | |||
| 294 | =head2 sub ltaper | ||
| 295 | |||
| 296 | |||
| 297 | =cut | ||
| 298 | |||
| 299 | sub ltaper { | ||
| 300 | |||
| 301 | my ( $self,$ltaper ) = @_; | ||
| 302 | if ( $ltaper ne $empty_string ) { | ||
| 303 | |||
| 304 | $sumigps->{_ltaper} = $ltaper; | ||
| 305 | $sumigps->{_note} = $sumigps->{_note}.' ltaper='.$sumigps->{_ltaper}; | ||
| 306 | $sumigps->{_Step} = $sumigps->{_Step}.' ltaper='.$sumigps->{_ltaper}; | ||
| 307 | |||
| 308 | } else { | ||
| 309 | print("sumigps, ltaper, missing ltaper,\n"); | ||
| 310 | } | ||
| 311 | } | ||
| 312 | |||
| 313 | |||
| 314 | =head2 sub nxpad | ||
| 315 | |||
| 316 | |||
| 317 | =cut | ||
| 318 | |||
| 319 | sub nxpad { | ||
| 320 | |||
| 321 | my ( $self,$nxpad ) = @_; | ||
| 322 | if ( $nxpad ne $empty_string ) { | ||
| 323 | |||
| 324 | $sumigps->{_nxpad} = $nxpad; | ||
| 325 | $sumigps->{_note} = $sumigps->{_note}.' nxpad='.$sumigps->{_nxpad}; | ||
| 326 | $sumigps->{_Step} = $sumigps->{_Step}.' nxpad='.$sumigps->{_nxpad}; | ||
| 327 | |||
| 328 | } else { | ||
| 329 | print("sumigps, nxpad, missing nxpad,\n"); | ||
| 330 | } | ||
| 331 | } | ||
| 332 | |||
| 333 | |||
| 334 | =head2 sub tmig | ||
| 335 | |||
| 336 | |||
| 337 | =cut | ||
| 338 | |||
| 339 | sub tmig { | ||
| 340 | |||
| 341 | my ( $self,$tmig ) = @_; | ||
| 342 | if ( $tmig ne $empty_string ) { | ||
| 343 | |||
| 344 | $sumigps->{_tmig} = $tmig; | ||
| 345 | $sumigps->{_note} = $sumigps->{_note}.' tmig='.$sumigps->{_tmig}; | ||
| 346 | $sumigps->{_Step} = $sumigps->{_Step}.' tmig='.$sumigps->{_tmig}; | ||
| 347 | |||
| 348 | } else { | ||
| 349 | print("sumigps, tmig, missing tmig,\n"); | ||
| 350 | } | ||
| 351 | } | ||
| 352 | |||
| 353 | |||
| 354 | =head2 sub tmpdir | ||
| 355 | |||
| 356 | |||
| 357 | =cut | ||
| 358 | |||
| 359 | sub tmpdir { | ||
| 360 | |||
| 361 | my ( $self,$tmpdir ) = @_; | ||
| 362 | if ( $tmpdir ne $empty_string ) { | ||
| 363 | |||
| 364 | $sumigps->{_tmpdir} = $tmpdir; | ||
| 365 | $sumigps->{_note} = $sumigps->{_note}.' tmpdir='.$sumigps->{_tmpdir}; | ||
| 366 | $sumigps->{_Step} = $sumigps->{_Step}.' tmpdir='.$sumigps->{_tmpdir}; | ||
| 367 | |||
| 368 | } else { | ||
| 369 | print("sumigps, tmpdir, missing tmpdir,\n"); | ||
| 370 | } | ||
| 371 | } | ||
| 372 | |||
| 373 | |||
| 374 | =head2 sub verbose | ||
| 375 | |||
| 376 | |||
| 377 | =cut | ||
| 378 | |||
| 379 | sub verbose { | ||
| 380 | |||
| 381 | my ( $self,$verbose ) = @_; | ||
| 382 | if ( $verbose ne $empty_string ) { | ||
| 383 | |||
| 384 | $sumigps->{_verbose} = $verbose; | ||
| 385 | $sumigps->{_note} = $sumigps->{_note}.' verbose='.$sumigps->{_verbose}; | ||
| 386 | $sumigps->{_Step} = $sumigps->{_Step}.' verbose='.$sumigps->{_verbose}; | ||
| 387 | |||
| 388 | } else { | ||
| 389 | print("sumigps, verbose, missing verbose,\n"); | ||
| 390 | } | ||
| 391 | } | ||
| 392 | |||
| 393 | |||
| 394 | =head2 sub vfile | ||
| 395 | |||
| 396 | |||
| 397 | =cut | ||
| 398 | |||
| 399 | sub vfile { | ||
| 400 | |||
| 401 | my ( $self,$vfile ) = @_; | ||
| 402 | if ( $vfile ne $empty_string ) { | ||
| 403 | |||
| 404 | $sumigps->{_vfile} = $vfile; | ||
| 405 | $sumigps->{_note} = $sumigps->{_note}.' vfile='.$sumigps->{_vfile}; | ||
| 406 | $sumigps->{_Step} = $sumigps->{_Step}.' vfile='.$sumigps->{_vfile}; | ||
| 407 | |||
| 408 | } else { | ||
| 409 | print("sumigps, vfile, missing vfile,\n"); | ||
| 410 | } | ||
| 411 | } | ||
| 412 | |||
| 413 | |||
| 414 | =head2 sub vmig | ||
| 415 | |||
| 416 | |||
| 417 | =cut | ||
| 418 | |||
| 419 | sub vmig { | ||
| 420 | |||
| 421 | my ( $self,$vmig ) = @_; | ||
| 422 | if ( $vmig ne $empty_string ) { | ||
| 423 | |||
| 424 | $sumigps->{_vmig} = $vmig; | ||
| 425 | $sumigps->{_note} = $sumigps->{_note}.' vmig='.$sumigps->{_vmig}; | ||
| 426 | $sumigps->{_Step} = $sumigps->{_Step}.' vmig='.$sumigps->{_vmig}; | ||
| 427 | |||
| 428 | } else { | ||
| 429 | print("sumigps, vmig, missing vmig,\n"); | ||
| 430 | } | ||
| 431 | } | ||
| 432 | |||
| 433 | |||
| 434 | =head2 sub get_max_index | ||
| 435 | |||
| 436 | max index = number of input variables -1 | ||
| 437 | |||
| 438 | =cut | ||
| 439 | |||
| 440 | sub get_max_index { | ||
| 441 | my ($self) = @_; | ||
| 442 | my $max_index = 9; | ||
| 443 | |||
| 444 | return($max_index); | ||
| 445 | } | ||
| 446 | |||
| 447 | |||
| 448 | 1; |