% segyreadYou will see the selfdoc for this program.
When reading a SEGY tape, or datafile, you will need to be aware of the byte-order (endian) of the machine you are running on. The so-called ``big-endian'' or high-byte IEEE format is found on SGI, SUN, IBM RS6000, and all Motorola chip-based systems. The ``little-endian'' or low-byte systems are systems that are based on Intel and Dec chips. You will also need to know what Unix device your tape drive is.
A typical execution of segyread on a big-endian machine, looks like this:
% segyread tape=/dev/rmt0 verbose=1 endian=1 > data.su
More often you will have to use the following
% segyread tape=/dev/rmt0 verbose=1 endian=1 | segyclean > data.sufor reading a tape on a big-endian platform.
There are optional header fields (bytes 181-240) in the SEGY trace headers. There is no standard for what may go in these fields, so many people have items that they place in these fields for their own purposes. SU is no exception. There are several parameters used by SU graphics programs that may be stored in these fields. The program segyclean zeros out the values of the optional header fields so that SU graphics programs don't become confused by this information.
There are additional issues, such as whether or not your device is buffered or unbufferd (i.e. 9 track 1/2 reel tape, or 8mm Exabyte) tape which may have to be experimented with when you actually try to read a tape. Also, if you are trying to read a tape on a different system than the one it was made on, you may simply not be able to read the tape.
The most common problem with reading tapes is matching the density that the tape was written in, with the tapedrive that the tape is being read on. Some systems, for example Silicon Graphics (SGI) systems, have many tape devices, which support different hardware configurations and tape densities. Other systems, most notably recent versions of Linux have an improved version of the Unix command ``mt'' which has a ``setdensities'' option. In either case, it is common for tapes to be made using the default settings of a tape drive, or its default densities.
As a last resort in all tape reading situations, it is often possible to use the Unix device-to-device copying program dd to make an image of the entire tape on disk
% dd if=/dev/rmtx of=filename bs=32767 conv=noerrorwhere ``/dev/rmtx'' is replaced with your tapedrive device and ``filename'' is some file name you choose. If this works, then the next step is to try using segyread as above, with ``tape=filename.'' If dd fails, then it is likely that the hardware format of your tapedrive is not compatible with your tape.
Of course, the best way to prevent tape reading problems is to make sure that you talk to the person who is writing the tape before they write it. On SGI systems, in particular, there are so many possible choices for the type of tape format, that the person who is making the tape must have information about the platform that the tape is intended to be read on, before they can make a tape that is guaranteed to be readable.