« lib/App/SeismicUnixGui/messages/help_button_messages.pm
↑ Summary
lib/App/SeismicUnixGui/sunix/transform/suspecfk.pm »
| 1 | package App::SeismicUnixGui::sunix::data::segyread; | ||
| 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 | SEGYREAD - read an SEG-Y tape | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | segyread > stdout tape= | ||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | or | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | SEG-Y data stream ... | segyread tape=- > stdout | ||
| 37 | |||
| 38 | |||
| 39 | |||
| 40 | Required parameter: | ||
| 41 | |||
| 42 | tape= input tape device or seg-y filename (see notes) | ||
| 43 | |||
| 44 | |||
| 45 | |||
| 46 | Optional parameters: | ||
| 47 | |||
| 48 | buff=1 for buffered device (9-track reel tape drive) | ||
| 49 | |||
| 50 | =0 possibly useful for 8mm EXABYTE drives | ||
| 51 | |||
| 52 | verbose=0 silent operation | ||
| 53 | |||
| 54 | =1 ; echo every 'vblock' traces | ||
| 55 | |||
| 56 | vblock=50 echo every 'vblock' traces under verbose option | ||
| 57 | |||
| 58 | hfile=header file to store ebcdic block (as ascii) | ||
| 59 | |||
| 60 | bfile=binary file to store binary block | ||
| 61 | |||
| 62 | xfile=xhdrs file to store extended text block | ||
| 63 | |||
| 64 | over=0 quit if bhed format not equal 1, 2, 3, 5, or 8 | ||
| 65 | |||
| 66 | = 1 ; override and attempt conversion | ||
| 67 | |||
| 68 | format=bh.format if over=1 try to convert assuming format value | ||
| 69 | |||
| 70 | conv=1 convert data to native format | ||
| 71 | |||
| 72 | = 0 ; assume data is in native format | ||
| 73 | |||
| 74 | ebcdic=1 perform ebcdic to ascii conversion on 3200 byte textural | ||
| 75 | |||
| 76 | header. =0 do not perform conversion | ||
| 77 | |||
| 78 | ns=bh.hns number of samples (use if bhed ns wrong) | ||
| 79 | |||
| 80 | trcwt=1 apply trace weighting factor (bytes 169-170) | ||
| 81 | |||
| 82 | =0, do not apply. (Default is 0 for formats 1 and 5) | ||
| 83 | |||
| 84 | trmin=1 first trace to read | ||
| 85 | |||
| 86 | trmax=INT_MAX last trace to read | ||
| 87 | |||
| 88 | endian=1 set =0 for little-endian machines(PC's,DEC,etc.) | ||
| 89 | |||
| 90 | errmax=0 allowable number of consecutive tape IO errors | ||
| 91 | |||
| 92 | remap=...,... remap key(s) | ||
| 93 | |||
| 94 | byte=...,... formats to use for header remapping | ||
| 95 | |||
| 96 | |||
| 97 | |||
| 98 | Notes: | ||
| 99 | |||
| 100 | Traditionally tape=/dev/rmt0. However, in the modern world tape device | ||
| 101 | |||
| 102 | names are much less uniform. The magic name can often be deduced by | ||
| 103 | |||
| 104 | "ls /dev". Likely man pages with the names of the tape devices are: | ||
| 105 | |||
| 106 | "mt", "sd" "st". Also try "man -k scsi", " man mt", etc. | ||
| 107 | |||
| 108 | Sometimes "mt status" will tell the device name. | ||
| 109 | |||
| 110 | |||
| 111 | |||
| 112 | For a SEG-Y diskfile use tape=filename. | ||
| 113 | |||
| 114 | |||
| 115 | |||
| 116 | The xfile argument will only be used if the file contains extended | ||
| 117 | |||
| 118 | text headers. | ||
| 119 | |||
| 120 | |||
| 121 | |||
| 122 | Remark: a SEG-Y file is not the same as an su file. A SEG-Y file | ||
| 123 | |||
| 124 | consists of three parts: an ebcdic header, a binary reel header, and | ||
| 125 | |||
| 126 | the traces. The traces are (usually) in 32 bit IBM floating point | ||
| 127 | |||
| 128 | format. An SU file consists only of the trace portion written in the | ||
| 129 | |||
| 130 | native binary floats. | ||
| 131 | |||
| 132 | |||
| 133 | |||
| 134 | Formats supported: | ||
| 135 | |||
| 136 | 1: IBM floating point, 4 byte (32 bits) | ||
| 137 | |||
| 138 | 2: two's complement integer, 4 byte (32 bits) | ||
| 139 | |||
| 140 | 3: two's complement integer, 2 byte (16 bits) | ||
| 141 | |||
| 142 | 5: IEEE floating point, 4 byte (32 bits) | ||
| 143 | |||
| 144 | 8: two's complement integer, 1 byte (8 bits) | ||
| 145 | |||
| 146 | |||
| 147 | |||
| 148 | tape=- read from standard input. Caveat, under Solaris, you will | ||
| 149 | |||
| 150 | need to use the buff=1 option, as well. | ||
| 151 | |||
| 152 | |||
| 153 | |||
| 154 | Header remap: | ||
| 155 | |||
| 156 | The value of header word remap is mapped from the values of byte | ||
| 157 | |||
| 158 | |||
| 159 | |||
| 160 | Map a float at location 221 to sample spacing d1: | ||
| 161 | |||
| 162 | segyread <data >outdata remap=d1 byte=221f | ||
| 163 | |||
| 164 | |||
| 165 | |||
| 166 | Map a long at location 225 to source location sx: | ||
| 167 | |||
| 168 | segyread <data >outdata remap=sx byte=225l | ||
| 169 | |||
| 170 | |||
| 171 | |||
| 172 | Map a short at location 229 to gain constant igc: | ||
| 173 | |||
| 174 | segyread <data >outdata remap=igc byte=229s | ||
| 175 | |||
| 176 | |||
| 177 | |||
| 178 | Or all combined: | ||
| 179 | |||
| 180 | segyread <data >outdata remap=d1,sx,igc byte=221f,225l,229s | ||
| 181 | |||
| 182 | |||
| 183 | |||
| 184 | Segy header words are accessed as Xt where X denotes the byte number | ||
| 185 | |||
| 186 | starting at 1 in correspondance with the SEGY standard (1975) | ||
| 187 | |||
| 188 | Known types include: f float (4 bytes) | ||
| 189 | |||
| 190 | l long int (4 bytes) | ||
| 191 | |||
| 192 | s short int (2 bytes) | ||
| 193 | |||
| 194 | b byte (1 bytes) | ||
| 195 | |||
| 196 | |||
| 197 | |||
| 198 | type: sudoc segyread for further information | ||
| 199 | |||
| 200 | |||
| 201 | |||
| 202 | |||
| 203 | |||
| 204 | |||
| 205 | |||
| 206 | Note: | ||
| 207 | |||
| 208 | If you have a tape with multiple sequences of ebcdic header, | ||
| 209 | |||
| 210 | binary header,traces, use the device that | ||
| 211 | |||
| 212 | invokes the no-rewind option and issue multiple segyread | ||
| 213 | |||
| 214 | commands (making an appropriate shell script if you | ||
| 215 | |||
| 216 | want to save all the headers). Consider using >> if | ||
| 217 | |||
| 218 | you want a single trace file in the end. Similar | ||
| 219 | |||
| 220 | considerations apply for multiple reels of tapes, | ||
| 221 | |||
| 222 | but use the standard rewind on end of file. | ||
| 223 | |||
| 224 | |||
| 225 | |||
| 226 | Note: For buff=1 (default) tape is accessed with 'read', for buff=0 | ||
| 227 | |||
| 228 | tape is accessed with fread. We suggest that you try buff=1 | ||
| 229 | |||
| 230 | even with EXABYTE tapes. | ||
| 231 | |||
| 232 | Caveat: may be slow on an 8mm streaming (EXABYTE) tapedrive | ||
| 233 | |||
| 234 | Warning: segyread or segywrite to 8mm tape is fragile. Allow sufficient | ||
| 235 | |||
| 236 | time between successive reads and writes. | ||
| 237 | |||
| 238 | Warning: may return the error message "efclose: fclose failed" | ||
| 239 | |||
| 240 | intermittently when segyreading/segywriting to 8mm (EXABYTE) tape | ||
| 241 | |||
| 242 | even if actual segyread/segywrite is successful. However, this | ||
| 243 | |||
| 244 | error message may be returned if your tape drive has a fixed | ||
| 245 | |||
| 246 | block size set. | ||
| 247 | |||
| 248 | Caution: When reading or writing SEG-Y tapes, the tape | ||
| 249 | |||
| 250 | drive should be set to be able to read variable block length | ||
| 251 | |||
| 252 | tape files. | ||
| 253 | |||
| 254 | |||
| 255 | |||
| 256 | |||
| 257 | |||
| 258 | Credits: | ||
| 259 | |||
| 260 | SEP: Einar Kjartansson | ||
| 261 | |||
| 262 | CWP: Jack K. Cohen, Brian Sumner, Chris Liner | ||
| 263 | |||
| 264 | : John Stockwell (added 8mm tape stuff) | ||
| 265 | |||
| 266 | conv parameter added by: | ||
| 267 | |||
| 268 | Tony Kocurko | ||
| 269 | |||
| 270 | Department of Earth Sciences | ||
| 271 | |||
| 272 | Memorial University of Newfoundland | ||
| 273 | |||
| 274 | St. John's, Newfoundland | ||
| 275 | |||
| 276 | read from stdin via tape=- added by Tony Kocurko | ||
| 277 | |||
| 278 | bhed format = 2,3 conversion by: | ||
| 279 | |||
| 280 | Remco Romijn (Applied Geophysics, TU Delft) | ||
| 281 | |||
| 282 | J.W. de Bruijn (Applied Geophysics, TU Delft) | ||
| 283 | |||
| 284 | bhed format = 8 conversion by: John Stockwell | ||
| 285 | |||
| 286 | header remap feature added by: | ||
| 287 | |||
| 288 | Matthias Imhof, Virginia Tech | ||
| 289 | |||
| 290 | -------------------------- | ||
| 291 | |||
| 292 | Additional Notes: | ||
| 293 | |||
| 294 | Brian's subroutine, ibm_to_float, which converts IBM floating | ||
| 295 | |||
| 296 | point to IEEE floating point is NOT portable and must be | ||
| 297 | |||
| 298 | altered for non-IEEE machines. See the subroutine notes below. | ||
| 299 | |||
| 300 | |||
| 301 | |||
| 302 | A direct read by dd would suck up the entire tape; hence the | ||
| 303 | |||
| 304 | dancing around with buffers and files. | ||
| 305 | |||
| 306 | =head2 CHANGES and their DATES | ||
| 307 | |||
| 308 | JML V0.0.2, 9.1.25 | ||
| 309 | |||
| 310 | Normally, segyread acts on only one file at a time | ||
| 311 | |||
| 312 | V0.0.2 wraps an extension to process an arbitrary | ||
| 313 | list of trace numbers. The automatic iteration includes | ||
| 314 | two additional parameters: list and su_base_file_name | ||
| 315 | |||
| 316 | The parameter "list" is the name of a text file. | ||
| 317 | The file is automatically bound to the SEIMICS_DATA_TXT | ||
| 318 | directory path. | ||
| 319 | |||
| 320 | "list" is the name of a file containing a numeric list | ||
| 321 | of trace numbers of type "key" that are to be deleted: | ||
| 322 | |||
| 323 | An example list | ||
| 324 | file contains values, one per line. | ||
| 325 | 1 | ||
| 326 | 3 | ||
| 327 | 5 | ||
| 328 | |||
| 329 | "list" = a file name (in directory path: DATA_SEISMICS_TXT) | ||
| 330 | |||
| 331 | su_base_file_name = e.g., 1001, which by defaults lies | ||
| 332 | in directory path: DATA_SEISMIC_SU. | ||
| 333 | A bare file name: '1001' will automatically be given an suffix | ||
| 334 | The file name on the disk will be '1001.su' | ||
| 335 | |||
| 336 | Within code, the imported "list" includes path and name; | ||
| 337 | hence its name: _inbound_list. User enters a list name in | ||
| 338 | GUI using the mouse <MB3>. | ||
| 339 | |||
| 340 | =cut | ||
| 341 | |||
| 342 | =head2 User's notes (Juan Lorenzo) | ||
| 343 | untested | ||
| 344 | |||
| 345 | =cut | ||
| 346 | |||
| 347 | |||
| 348 | use Moose; | ||
| 349 | our $VERSION = '0.0.2'; | ||
| 350 | |||
| 351 | |||
| 352 | =head2 Import packages | ||
| 353 | |||
| 354 | =cut | ||
| 355 | |||
| 356 | use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants'; | ||
| 357 | |||
| 358 | use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 359 | use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config'; | ||
| 360 | use aliased 'App::SeismicUnixGui::misc::manage_files_by2'; | ||
| 361 | |||
| 362 | |||
| 363 | =head2 instantiation of packages | ||
| 364 | |||
| 365 | =cut | ||
| 366 | |||
| 367 | my $get = L_SU_global_constants->new(); | ||
| 368 | my $Project = Project_config->new(); | ||
| 369 | my $manage_files_by2 = manage_files_by2->new(); | ||
| 370 | my $DATA_SEISMIC_SEGY = $Project->DATA_SEISMIC_SEGY(); | ||
| 371 | my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 372 | my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 373 | my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 374 | |||
| 375 | my $var = $get->var(); | ||
| 376 | my $on = $var->{_on}; | ||
| 377 | my $off = $var->{_off}; | ||
| 378 | my $true = $var->{_true}; | ||
| 379 | my $false = $var->{_false}; | ||
| 380 | my $empty_string = $var->{_empty_string}; | ||
| 381 | |||
| 382 | =head2 Encapsulated | ||
| 383 | hash of private variables | ||
| 384 | |||
| 385 | =cut | ||
| 386 | |||
| 387 | my $segyread = { | ||
| 388 | _bfile => '', | ||
| 389 | _buff => '', | ||
| 390 | _byte => '', | ||
| 391 | _conv => '', | ||
| 392 | _ebcdic => '', | ||
| 393 | _endian => '', | ||
| 394 | _errmax => '', | ||
| 395 | _format => '', | ||
| 396 | _hfile => '', | ||
| 397 | _inbound_list => '', | ||
| 398 | _ns => '', | ||
| 399 | _over => '', | ||
| 400 | _remap => '', | ||
| 401 | _tape => '', | ||
| 402 | _trcwt => '', | ||
| 403 | _trmax => '', | ||
| 404 | _trmin => '', | ||
| 405 | _vblock => '', | ||
| 406 | _verbose => '', | ||
| 407 | _xfile => '', | ||
| 408 | _Step => '', | ||
| 409 | _note => '', | ||
| 410 | |||
| 411 | }; | ||
| 412 | |||
| 413 | =head2 sub Step | ||
| 414 | |||
| 415 | collects switches and assembles bash instructions | ||
| 416 | by adding the program name | ||
| 417 | |||
| 418 | =cut | ||
| 419 | sub Step { | ||
| 420 | |||
| 421 | my ($self) = @_; | ||
| 422 | |||
| 423 | # simple check | ||
| 424 | if ( length $segyread->{_inbound_list} ) { | ||
| 425 | my $file_num; | ||
| 426 | my @Step; | ||
| 427 | my $step; | ||
| 428 | |||
| 429 | my ($inbound_aref) = _get_inbound4base_file_names(); | ||
| 430 | my ($outbound_aref) = _get_outbound4base_file_names(); | ||
| 431 | my @inbound = @$inbound_aref; | ||
| 432 | my @outbound = @$outbound_aref; | ||
| 433 | my $num_of_files = scalar @outbound; | ||
| 434 | |||
| 435 | # print("Step,inbound: @inbound\n"); | ||
| 436 | # print("Step,inbound: @outbound\n"); | ||
| 437 | |||
| 438 | my $last_idx = $num_of_files - 1; | ||
| 439 | |||
| 440 | # All cases when num_files >=1 | ||
| 441 | # for first file | ||
| 442 | $step = " segyread $segyread->{_Step} tape=$inbound[0] > $outbound[0] "; | ||
| 443 | |||
| 444 | if ( $last_idx >= 2 ) { | ||
| 445 | |||
| 446 | # CASE: >= 3 operations | ||
| 447 | for ( my $i = 1 ; $i < $last_idx ; $i++ ) { | ||
| 448 | |||
| 449 | $step = | ||
| 450 | $step . "& segyread $segyread->{_Step} tape=$inbound[$i] > $outbound[$i] "; | ||
| 451 | |||
| 452 | } | ||
| 453 | |||
| 454 | # for last file | ||
| 455 | $segyread->{_Step} = | ||
| 456 | $step . "& segyread $segyread->{_Step} tape=$inbound[$last_idx] > $outbound[$last_idx]"; | ||
| 457 | |||
| 458 | } | ||
| 459 | elsif ( $last_idx == 1 ) { | ||
| 460 | |||
| 461 | # for last file | ||
| 462 | $segyread->{_Step} = | ||
| 463 | $step . "& segyread $segyread->{_Step} tape=$inbound[$last_idx] > $outbound[$last_idx] "; | ||
| 464 | |||
| 465 | } | ||
| 466 | elsif ( $last_idx == 0 ) { | ||
| 467 | |||
| 468 | $segyread->{_Step} = " $step"; | ||
| 469 | |||
| 470 | } | ||
| 471 | else { | ||
| 472 | print("segyread,Step,unexpected case\n"); | ||
| 473 | return(); | ||
| 474 | } | ||
| 475 | |||
| 476 | return ($segyread->{_Step}); | ||
| 477 | |||
| 478 | } | ||
| 479 | elsif ( not length $segyread->{_inbound_list} ) { | ||
| 480 | |||
| 481 | $segyread->{_Step} = 'segyread'.$segyread->{_Step}; | ||
| 482 | return ( $segyread->{_Step} ); | ||
| 483 | } | ||
| 484 | else { | ||
| 485 | print("segyread, Step, incorrect parameters\n"); | ||
| 486 | } | ||
| 487 | } | ||
| 488 | |||
| 489 | |||
| 490 | =head2 sub note | ||
| 491 | |||
| 492 | collects switches and assembles bash instructions | ||
| 493 | by adding the program name | ||
| 494 | |||
| 495 | =cut | ||
| 496 | |||
| 497 | sub note { | ||
| 498 | |||
| 499 | $segyread->{_note} = 'segyread'.$segyread->{_note}; | ||
| 500 | return ( $segyread->{_note} ); | ||
| 501 | |||
| 502 | } | ||
| 503 | |||
| 504 | |||
| 505 | |||
| 506 | =head2 sub clear | ||
| 507 | |||
| 508 | =cut | ||
| 509 | |||
| 510 | sub clear { | ||
| 511 | |||
| 512 | $segyread->{_bfile} = ''; | ||
| 513 | $segyread->{_buff} = ''; | ||
| 514 | $segyread->{_byte} = ''; | ||
| 515 | $segyread->{_conv} = ''; | ||
| 516 | $segyread->{_ebcdic} = ''; | ||
| 517 | $segyread->{_endian} = ''; | ||
| 518 | $segyread->{_errmax} = ''; | ||
| 519 | $segyread->{_format} = ''; | ||
| 520 | $segyread->{_hfile} = ''; | ||
| 521 | $segyread->{_inbound_list} = ''; | ||
| 522 | $segyread->{_ns} = ''; | ||
| 523 | $segyread->{_over} = ''; | ||
| 524 | $segyread->{_remap} = ''; | ||
| 525 | $segyread->{_tape} = ''; | ||
| 526 | $segyread->{_trcwt} = ''; | ||
| 527 | $segyread->{_trmax} = ''; | ||
| 528 | $segyread->{_trmin} = ''; | ||
| 529 | $segyread->{_vblock} = ''; | ||
| 530 | $segyread->{_verbose} = ''; | ||
| 531 | $segyread->{_xfile} = ''; | ||
| 532 | $segyread->{_Step} = ''; | ||
| 533 | $segyread->{_note} = ''; | ||
| 534 | } | ||
| 535 | |||
| 536 | =head2 sub _get_inbound4base_file_names | ||
| 537 | |||
| 538 | =cut | ||
| 539 | |||
| 540 | sub _get_inbound4base_file_names { | ||
| 541 | my ($self) = @_; | ||
| 542 | |||
| 543 | my ( $array_ref, $num_files ) = $manage_files_by2->get_base_file_name_aref(); | ||
| 544 | |||
| 545 | if ( defined $array_ref && @$array_ref ) { | ||
| 546 | |||
| 547 | my @base_file_name = @$array_ref; | ||
| 548 | my @inbound; | ||
| 549 | |||
| 550 | for ( my $i = 0 ; $i < $num_files ; $i++ ) { | ||
| 551 | |||
| 552 | $inbound[$i] = $DATA_SEISMIC_SEGY . '/' . $base_file_name[$i].$suffix_segy; | ||
| 553 | } | ||
| 554 | return ( \@inbound ); | ||
| 555 | |||
| 556 | } | ||
| 557 | else { | ||
| 558 | print("segyread,_get_inbound4base_file_names, missing file names\n"); | ||
| 559 | return (); | ||
| 560 | } | ||
| 561 | |||
| 562 | } | ||
| 563 | |||
| 564 | =head2 sub _get_outbound4base_file_names | ||
| 565 | |||
| 566 | =cut | ||
| 567 | |||
| 568 | sub _get_outbound4base_file_names { | ||
| 569 | my ($self) = @_; | ||
| 570 | |||
| 571 | my ( $array_ref, $num_files ) = $manage_files_by2->get_base_file_name_aref(); | ||
| 572 | |||
| 573 | if ( length $array_ref ) { | ||
| 574 | |||
| 575 | my @base_file_name = @$array_ref; | ||
| 576 | my @outbound; | ||
| 577 | |||
| 578 | for ( my $i = 0 ; $i < $num_files ; $i++ ) { | ||
| 579 | |||
| 580 | $outbound[$i] = $DATA_SEISMIC_SU . '/' . $base_file_name[$i].$suffix_su; | ||
| 581 | |||
| 582 | } | ||
| 583 | return ( \@outbound ); | ||
| 584 | |||
| 585 | } | ||
| 586 | else { | ||
| 587 | print("segyread,_get_outbound4basefile_names, missing file names\n"); | ||
| 588 | return (); | ||
| 589 | } | ||
| 590 | |||
| 591 | } | ||
| 592 | |||
| 593 | =head2 sub bfile | ||
| 594 | |||
| 595 | |||
| 596 | =cut | ||
| 597 | |||
| 598 | sub bfile { | ||
| 599 | |||
| 600 | my ( $self,$bfile ) = @_; | ||
| 601 | if ( $bfile ne $empty_string ) { | ||
| 602 | |||
| 603 | $segyread->{_bfile} = $bfile; | ||
| 604 | $segyread->{_note} = $segyread->{_note}.' bfile='.$segyread->{_bfile}; | ||
| 605 | $segyread->{_Step} = $segyread->{_Step}.' bfile='.$segyread->{_bfile}; | ||
| 606 | |||
| 607 | } else { | ||
| 608 | print("segyread, bfile, missing bfile,\n"); | ||
| 609 | } | ||
| 610 | } | ||
| 611 | |||
| 612 | |||
| 613 | =head2 sub buff | ||
| 614 | |||
| 615 | |||
| 616 | =cut | ||
| 617 | |||
| 618 | sub buff { | ||
| 619 | |||
| 620 | my ( $self,$buff ) = @_; | ||
| 621 | if ( $buff ne $empty_string ) { | ||
| 622 | |||
| 623 | $segyread->{_buff} = $buff; | ||
| 624 | $segyread->{_note} = $segyread->{_note}.' buff='.$segyread->{_buff}; | ||
| 625 | $segyread->{_Step} = $segyread->{_Step}.' buff='.$segyread->{_buff}; | ||
| 626 | |||
| 627 | } else { | ||
| 628 | print("segyread, buff, missing buff,\n"); | ||
| 629 | } | ||
| 630 | } | ||
| 631 | |||
| 632 | |||
| 633 | =head2 sub byte | ||
| 634 | |||
| 635 | |||
| 636 | =cut | ||
| 637 | |||
| 638 | sub byte { | ||
| 639 | |||
| 640 | my ( $self,$byte ) = @_; | ||
| 641 | if ( $byte ne $empty_string ) { | ||
| 642 | |||
| 643 | $segyread->{_byte} = $byte; | ||
| 644 | $segyread->{_note} = $segyread->{_note}.' byte='.$segyread->{_byte}; | ||
| 645 | $segyread->{_Step} = $segyread->{_Step}.' byte='.$segyread->{_byte}; | ||
| 646 | |||
| 647 | } else { | ||
| 648 | print("segyread, byte, missing byte,\n"); | ||
| 649 | } | ||
| 650 | } | ||
| 651 | |||
| 652 | |||
| 653 | =head2 sub conv | ||
| 654 | |||
| 655 | |||
| 656 | =cut | ||
| 657 | |||
| 658 | sub conv { | ||
| 659 | |||
| 660 | my ( $self,$conv ) = @_; | ||
| 661 | if ( $conv ne $empty_string ) { | ||
| 662 | |||
| 663 | $segyread->{_conv} = $conv; | ||
| 664 | $segyread->{_note} = $segyread->{_note}.' conv='.$segyread->{_conv}; | ||
| 665 | $segyread->{_Step} = $segyread->{_Step}.' conv='.$segyread->{_conv}; | ||
| 666 | |||
| 667 | } else { | ||
| 668 | print("segyread, conv, missing conv,\n"); | ||
| 669 | } | ||
| 670 | } | ||
| 671 | |||
| 672 | |||
| 673 | =head2 sub ebcdic | ||
| 674 | |||
| 675 | |||
| 676 | =cut | ||
| 677 | |||
| 678 | sub ebcdic { | ||
| 679 | |||
| 680 | my ( $self,$ebcdic ) = @_; | ||
| 681 | if ( $ebcdic ne $empty_string ) { | ||
| 682 | |||
| 683 | $segyread->{_ebcdic} = $ebcdic; | ||
| 684 | $segyread->{_note} = $segyread->{_note}.' ebcdic='.$segyread->{_ebcdic}; | ||
| 685 | $segyread->{_Step} = $segyread->{_Step}.' ebcdic='.$segyread->{_ebcdic}; | ||
| 686 | |||
| 687 | } else { | ||
| 688 | print("segyread, ebcdic, missing ebcdic,\n"); | ||
| 689 | } | ||
| 690 | } | ||
| 691 | |||
| 692 | |||
| 693 | =head2 sub endian | ||
| 694 | |||
| 695 | |||
| 696 | =cut | ||
| 697 | |||
| 698 | sub endian { | ||
| 699 | |||
| 700 | my ( $self,$endian ) = @_; | ||
| 701 | if ( $endian ne $empty_string ) { | ||
| 702 | |||
| 703 | $segyread->{_endian} = $endian; | ||
| 704 | $segyread->{_note} = $segyread->{_note}.' endian='.$segyread->{_endian}; | ||
| 705 | $segyread->{_Step} = $segyread->{_Step}.' endian='.$segyread->{_endian}; | ||
| 706 | |||
| 707 | } else { | ||
| 708 | print("segyread, endian, missing endian,\n"); | ||
| 709 | } | ||
| 710 | } | ||
| 711 | |||
| 712 | |||
| 713 | =head2 sub errmax | ||
| 714 | |||
| 715 | |||
| 716 | =cut | ||
| 717 | |||
| 718 | sub errmax { | ||
| 719 | |||
| 720 | my ( $self,$errmax ) = @_; | ||
| 721 | if ( $errmax ne $empty_string ) { | ||
| 722 | |||
| 723 | $segyread->{_errmax} = $errmax; | ||
| 724 | $segyread->{_note} = $segyread->{_note}.' errmax='.$segyread->{_errmax}; | ||
| 725 | $segyread->{_Step} = $segyread->{_Step}.' errmax='.$segyread->{_errmax}; | ||
| 726 | |||
| 727 | } else { | ||
| 728 | print("segyread, errmax, missing errmax,\n"); | ||
| 729 | } | ||
| 730 | } | ||
| 731 | |||
| 732 | =head2 sub file | ||
| 733 | |||
| 734 | |||
| 735 | =cut | ||
| 736 | |||
| 737 | sub file { | ||
| 738 | |||
| 739 | my ( $self,$tape ) = @_; | ||
| 740 | if ( $tape ne $empty_string ) { | ||
| 741 | |||
| 742 | $tape =~ s/\\//g; | ||
| 743 | |||
| 744 | $segyread->{_tape} = $tape; | ||
| 745 | $segyread->{_note} = $segyread->{_note}.' tape='.'"'.$segyread->{_tape}.'"'; | ||
| 746 | $segyread->{_Step} = $segyread->{_Step}.' tape='.'"'.$segyread->{_tape}.'"'; | ||
| 747 | |||
| 748 | } else { | ||
| 749 | print("segyread, file, missing tape,\n"); | ||
| 750 | } | ||
| 751 | } | ||
| 752 | |||
| 753 | |||
| 754 | |||
| 755 | =head2 sub format | ||
| 756 | |||
| 757 | |||
| 758 | =cut | ||
| 759 | |||
| 760 | sub format { | ||
| 761 | |||
| 762 | my ( $self,$format ) = @_; | ||
| 763 | if ( $format ne $empty_string ) { | ||
| 764 | |||
| 765 | $segyread->{_format} = $format; | ||
| 766 | $segyread->{_note} = $segyread->{_note}.' format='.$segyread->{_format}; | ||
| 767 | $segyread->{_Step} = $segyread->{_Step}.' format='.$segyread->{_format}; | ||
| 768 | |||
| 769 | } else { | ||
| 770 | print("segyread, format, missing format,\n"); | ||
| 771 | } | ||
| 772 | } | ||
| 773 | |||
| 774 | |||
| 775 | =head2 sub hfile | ||
| 776 | |||
| 777 | |||
| 778 | =cut | ||
| 779 | |||
| 780 | sub hfile { | ||
| 781 | |||
| 782 | my ( $self,$hfile ) = @_; | ||
| 783 | if ( $hfile ne $empty_string ) { | ||
| 784 | |||
| 785 | $segyread->{_hfile} = $hfile; | ||
| 786 | $segyread->{_note} = $segyread->{_note}.' hfile='.$segyread->{_hfile}; | ||
| 787 | $segyread->{_Step} = $segyread->{_Step}.' hfile='.$segyread->{_hfile}; | ||
| 788 | |||
| 789 | } else { | ||
| 790 | print("segyread, hfile, missing hfile,\n"); | ||
| 791 | } | ||
| 792 | } | ||
| 793 | |||
| 794 | =head2 sub list | ||
| 795 | |||
| 796 | list array | ||
| 797 | |||
| 798 | =cut | ||
| 799 | |||
| 800 | sub list { | ||
| 801 | my ( $self, $list ) = @_; | ||
| 802 | |||
| 803 | if ( length $list ) { | ||
| 804 | |||
| 805 | # clear memory | ||
| 806 | $manage_files_by2->clear(); | ||
| 807 | |||
| 808 | $segyread->{_inbound_list} = $list; | ||
| 809 | |||
| 810 | $manage_files_by2->set_inbound_list($list); | ||
| 811 | |||
| 812 | |||
| 813 | } | ||
| 814 | else { | ||
| 815 | print("segyread, list, missing list,\n"); | ||
| 816 | } | ||
| 817 | return (); | ||
| 818 | } | ||
| 819 | |||
| 820 | =head2 sub ns | ||
| 821 | |||
| 822 | |||
| 823 | =cut | ||
| 824 | |||
| 825 | sub ns { | ||
| 826 | |||
| 827 | my ( $self,$ns ) = @_; | ||
| 828 | if ( $ns ne $empty_string ) { | ||
| 829 | |||
| 830 | $segyread->{_ns} = $ns; | ||
| 831 | $segyread->{_note} = $segyread->{_note}.' ns='.$segyread->{_ns}; | ||
| 832 | $segyread->{_Step} = $segyread->{_Step}.' ns='.$segyread->{_ns}; | ||
| 833 | |||
| 834 | } else { | ||
| 835 | print("segyread, ns, missing ns,\n"); | ||
| 836 | } | ||
| 837 | } | ||
| 838 | |||
| 839 | |||
| 840 | =head2 sub over | ||
| 841 | |||
| 842 | |||
| 843 | =cut | ||
| 844 | |||
| 845 | sub over { | ||
| 846 | |||
| 847 | my ( $self,$over ) = @_; | ||
| 848 | if ( $over ne $empty_string ) { | ||
| 849 | |||
| 850 | $segyread->{_over} = $over; | ||
| 851 | $segyread->{_note} = $segyread->{_note}.' over='.$segyread->{_over}; | ||
| 852 | $segyread->{_Step} = $segyread->{_Step}.' over='.$segyread->{_over}; | ||
| 853 | |||
| 854 | } else { | ||
| 855 | print("segyread, over, missing over,\n"); | ||
| 856 | } | ||
| 857 | } | ||
| 858 | |||
| 859 | |||
| 860 | =head2 sub remap | ||
| 861 | |||
| 862 | |||
| 863 | =cut | ||
| 864 | |||
| 865 | sub remap { | ||
| 866 | |||
| 867 | my ( $self,$remap ) = @_; | ||
| 868 | if ( $remap ne $empty_string ) { | ||
| 869 | |||
| 870 | $segyread->{_remap} = $remap; | ||
| 871 | $segyread->{_note} = $segyread->{_note}.' remap='.$segyread->{_remap}; | ||
| 872 | $segyread->{_Step} = $segyread->{_Step}.' remap='.$segyread->{_remap}; | ||
| 873 | |||
| 874 | } else { | ||
| 875 | print("segyread, remap, missing remap,\n"); | ||
| 876 | } | ||
| 877 | } | ||
| 878 | |||
| 879 | |||
| 880 | =head2 sub tape | ||
| 881 | |||
| 882 | |||
| 883 | =cut | ||
| 884 | |||
| 885 | sub tape { | ||
| 886 | |||
| 887 | my ( $self,$tape ) = @_; | ||
| 888 | if ( $tape ne $empty_string ) { | ||
| 889 | |||
| 890 | $segyread->{_tape} = $tape; | ||
| 891 | $segyread->{_note} = $segyread->{_note}.' tape='.'"'.$segyread->{_tape}.'"'; | ||
| 892 | $segyread->{_Step} = $segyread->{_Step}.' tape='.'"'.$segyread->{_tape}.'"'; | ||
| 893 | |||
| 894 | } else { | ||
| 895 | print("segyread, tape, missing tape,\n"); | ||
| 896 | } | ||
| 897 | } | ||
| 898 | |||
| 899 | |||
| 900 | =head2 sub trcwt | ||
| 901 | |||
| 902 | |||
| 903 | =cut | ||
| 904 | |||
| 905 | sub trcwt { | ||
| 906 | |||
| 907 | my ( $self,$trcwt ) = @_; | ||
| 908 | if ( $trcwt ne $empty_string ) { | ||
| 909 | |||
| 910 | $segyread->{_trcwt} = $trcwt; | ||
| 911 | $segyread->{_note} = $segyread->{_note}.' trcwt='.$segyread->{_trcwt}; | ||
| 912 | $segyread->{_Step} = $segyread->{_Step}.' trcwt='.$segyread->{_trcwt}; | ||
| 913 | |||
| 914 | } else { | ||
| 915 | print("segyread, trcwt, missing trcwt,\n"); | ||
| 916 | } | ||
| 917 | } | ||
| 918 | |||
| 919 | |||
| 920 | =head2 sub trmax | ||
| 921 | |||
| 922 | |||
| 923 | =cut | ||
| 924 | |||
| 925 | sub trmax { | ||
| 926 | |||
| 927 | my ( $self,$trmax ) = @_; | ||
| 928 | if ( $trmax ne $empty_string ) { | ||
| 929 | |||
| 930 | $segyread->{_trmax} = $trmax; | ||
| 931 | $segyread->{_note} = $segyread->{_note}.' trmax='.$segyread->{_trmax}; | ||
| 932 | $segyread->{_Step} = $segyread->{_Step}.' trmax='.$segyread->{_trmax}; | ||
| 933 | |||
| 934 | } else { | ||
| 935 | print("segyread, trmax, missing trmax,\n"); | ||
| 936 | } | ||
| 937 | } | ||
| 938 | |||
| 939 | |||
| 940 | =head2 sub trmin | ||
| 941 | |||
| 942 | |||
| 943 | =cut | ||
| 944 | |||
| 945 | sub trmin { | ||
| 946 | |||
| 947 | my ( $self,$trmin ) = @_; | ||
| 948 | if ( $trmin ne $empty_string ) { | ||
| 949 | |||
| 950 | $segyread->{_trmin} = $trmin; | ||
| 951 | $segyread->{_note} = $segyread->{_note}.' trmin='.$segyread->{_trmin}; | ||
| 952 | $segyread->{_Step} = $segyread->{_Step}.' trmin='.$segyread->{_trmin}; | ||
| 953 | |||
| 954 | } else { | ||
| 955 | print("segyread, trmin, missing trmin,\n"); | ||
| 956 | } | ||
| 957 | } | ||
| 958 | |||
| 959 | |||
| 960 | =head2 sub vblock | ||
| 961 | |||
| 962 | |||
| 963 | =cut | ||
| 964 | |||
| 965 | sub vblock { | ||
| 966 | |||
| 967 | my ( $self,$vblock ) = @_; | ||
| 968 | if ( $vblock ne $empty_string ) { | ||
| 969 | |||
| 970 | $segyread->{_vblock} = $vblock; | ||
| 971 | $segyread->{_note} = $segyread->{_note}.' vblock='.$segyread->{_vblock}; | ||
| 972 | $segyread->{_Step} = $segyread->{_Step}.' vblock='.$segyread->{_vblock}; | ||
| 973 | |||
| 974 | } else { | ||
| 975 | print("segyread, vblock, missing vblock,\n"); | ||
| 976 | } | ||
| 977 | } | ||
| 978 | |||
| 979 | |||
| 980 | =head2 sub verbose | ||
| 981 | |||
| 982 | |||
| 983 | =cut | ||
| 984 | |||
| 985 | sub verbose { | ||
| 986 | |||
| 987 | my ( $self,$verbose ) = @_; | ||
| 988 | if ( $verbose ne $empty_string ) { | ||
| 989 | |||
| 990 | $segyread->{_verbose} = $verbose; | ||
| 991 | $segyread->{_note} = $segyread->{_note}.' verbose='.$segyread->{_verbose}; | ||
| 992 | $segyread->{_Step} = $segyread->{_Step}.' verbose='.$segyread->{_verbose}; | ||
| 993 | |||
| 994 | } else { | ||
| 995 | print("segyread, verbose, missing verbose,\n"); | ||
| 996 | } | ||
| 997 | } | ||
| 998 | |||
| 999 | |||
| 1000 | =head2 sub xfile | ||
| 1001 | |||
| 1002 | |||
| 1003 | =cut | ||
| 1004 | |||
| 1005 | sub xfile { | ||
| 1006 | |||
| 1007 | my ( $self,$xfile ) = @_; | ||
| 1008 | if ( $xfile ne $empty_string ) { | ||
| 1009 | |||
| 1010 | $segyread->{_xfile} = $xfile; | ||
| 1011 | $segyread->{_note} = $segyread->{_note}.' xfile='.$segyread->{_xfile}; | ||
| 1012 | $segyread->{_Step} = $segyread->{_Step}.' xfile='.$segyread->{_xfile}; | ||
| 1013 | |||
| 1014 | } else { | ||
| 1015 | print("segyread, xfile, missing xfile,\n"); | ||
| 1016 | } | ||
| 1017 | } | ||
| 1018 | |||
| 1019 | |||
| 1020 | =head2 sub get_max_index | ||
| 1021 | |||
| 1022 | max index = number of input variables -1 | ||
| 1023 | |||
| 1024 | =cut | ||
| 1025 | |||
| 1026 | sub get_max_index { | ||
| 1027 | my ($self) = @_; | ||
| 1028 | my $max_index = 19; | ||
| 1029 | |||
| 1030 | return($max_index); | ||
| 1031 | } | ||
| 1032 | |||
| 1033 | |||
| 1034 | 1; |