Traceprep TPXfer - File Transfer Module

Version 1.6


Introduction

The TPXfer module contains processes for facilitating smooth transfer of Traceprep processed data, input in Lynx trace file format, to other systems. This will normally be done by writing trace files in SEGY format, using the SEGYOUT process. The XYInsert and XYExtract process will write or read trace location coordinate data to or from designated SEGY header locations, in situations where the data are to be used in an interpretation workstation.

Startup and Configuration

All Lynx Exploration Archivist application programs have a corresponding .INI file in the Lynx system directory. The [startup] section contains program constants which can be edited manually, or through the LEAConfig application.

Processes


SEGYOUT - Save traces to SEGY format

The SEGYOUT process will convert the internal (Lynx) trace data format used by Traceprep to SEG-Y format, with options to make use of some of the new features introduced in Revision 1 of the SEG-Y standard. For more detailed information about these issues, see Trace File Formats.

Process ID - Traceprep standard process ID

Process Title - A brief description of an instance of the process

Filename Extn Options
Choose a file extension for the output SEG-Y file:

Set Filename Extension
The required SEG-Y file extension. The output filename will be of the form infile.ext, where infile is the name of the input file for the process list and ext is the extension determined here. If a file already exists with the same name, it will be overwritten.

Output folder option
whether to put the output files in a different folder:

Set Output Folder
The path of folder in which the output files will be placed

Type of SEGY
The type of SEG-Y file to generate:

IMPORTANT NOTES

Lynx SEGY Format .Users of Lynx software are strongly advised to use the SEGYL3 SEGY format. For example, if you are intending to use Lynx's SeisMatch utility for reconciling the SEGY seismic traces with the location data and inserting XY coordinates into the trace headers after SEGYOUT, you MUST use a Lynx format. Output files will then contain the first shotpoint and shotpoint increment in the binary file header, where it can be read by SeisMatch. A "Standard" SEGY file does not contain this information.

Start time issues (Lynx SEGY). Lynx trace files and SEGY files also handle trace start times differently. The Lynx trace file binary header carries a "TMin" value which is to be applied to all the traces in the file. To simulate this in the SEGY output, the beginning of each trace is padded with (zero) samples equivalent to -Tmin and the start time delay in each trace header byte 109-110 is set to -Tmin. When the SEGY file is read back (for example in TraceFix) TMin will not be reset and the data will appear to be shifted, relative to the original Lynx trace file. The correct time datum can be restored by applying the SHIFT process in Traceprep, using shift source "Recdelay"

SEGYL2 and SEGYL3 SEGY formats enable Lynx's Seisview seismic viewer and other programs correctly to read traces with a time shift (non-zero start time), as for Lynx format trace files. SEGYL2 and SEGYL3 SEGY carries a "TMin" value which is to be applied to all the traces in the file. The trace start time is stored in bytes 3281-3284 of the file header, in a normally unassigned location designated for optional use. SEGYL3 additionally stores TMin for each trace in the trace header (bytes 233-234), for use in workstation data-loading. SEGYL3 is the preferred output format and has no effect on non-Lynx SEG-Y software or viewers.

Data Sample format
This determines how the sample values, representing the seismic traces, will be written:

Scale to safe RMS
Decide whether to apply RMS gain to traces before output:

Processing History
This determines how processing history information will be written to the output C-Card header, C-Cards 10 onwards. Note that the processing history is added before any C-Card modifications are applied.

C-Card Modification
This parameter allows modifications to be made to the output CCard headers. In both Lynx and SEG-Y trace file formats, there are 40 C-Cards. They comprise a set of 80 byte text records in the SEG-Y "EBCDIC" header, that is, the first 3200 bytes in a SEG-Y disk file, or the first 3200 byte record on a SEG-Y tape. The name "C-Card" is derived from "Comment Card", from the days when the FORTRAN language was widely used for scientific programming, and programs and data were stored on punched cards. The original SEG-Y standard is very specific about how the first 10 C-Cards should be written, the remaining 30 being "free form", but it is rare to find a "SEG-Y" file which conforms exactly to the standard.

If you just want to modify an occasional C-Card, you may find it easier to edit it directly, using TraceFix, text header edit, or using TraceDmp to edit the text header using Microsoft Excel

The modifications to be applied are read from a file in the same folder (directory) as the input trace files. A C-Card modification file should contain one line for each of the C-Cards to be modified. For example, if you wanted to modify C-Cards 20 and 21 to contain a name and address, the file might contain:

C20 NAME : A. GEOPHYSICIST
C21 ADDRESS : THE MIDDLE OF NOWHERE

C-Card Mods Text File
The name of the C-Card modification file, when using the Fixed option. In all cases, the file should be placed in the input trace files folder (directory).

Output Listing
Enables a listing of the output file names, SEG-Y settings, shot-to-trace relationships etc, to be generated in a text file, which can be then included with the SEG-Y files sent to a user. This file is written to the output folder. SEGYOUT checks to see if the listing file, specified below, already exists. If it does not, a new file is generated, the file headings are written, before the current output file is added. If the file already exists, SEGYOUT checks whether its settings have changed, since the previous file was added. If the settings have changed, a warning will be written into the file, at the point where the change occurred.

Output Listing File
The name of the text file, containing the listing of the SEG-Y output files.

SEGYOUT - SEG-Y Trace Headers

The parameters on this page specify how the SEG-Y trace headers will be written

Trace Headers
Choose the method of trace-header insertion:

XY Coordinates

Standard SEG-Y Shotpoint Rounding Method
For Standard SEG-Y output, the shotpoint number for each trace is rounded to the nearest integer. (This is not ideal, and is one of the reasons for the development of the Lynx SEG-Y variant, and the SEG-Y Revision 1 format.) Integer SP values are stored in trace header bytes 17-20.
Choose the method used to round SP values:

Shotpoints in Lynx and SEGY formats
An important difference between Lynx trace files and SEG-Y format trace files is the way the shotpoint information is stored. In a Lynx trace file, when the shotpoints are regular, the shotpoint for a given trace is easily calculated from the trace number, the first shotpoint and shotpoint increment (per trace), stored in the file binary header.

When a Lynx trace file is read into Traceprep, using the INFILE process, the shotpoints, calculated in this way are stored in the SPNo shotpoint slot bytes 17-20 of each trace, in floating point format. They are then available to later processes in the sequence, such as this one. See also SPINSERT process, in the TPUtils module

In SEG-Y (Standard) format, shotpoints can only be stored in trace headers (bytes 17-20) as there is no shotpoint information stored in the file header. Furthermore, the shotpoints are stored as integers, not as floating point values, so that when the SP increment per trace is not a whole number, there will be ambiguity as to the true value of the shotpoint stored in the header of a given trace. (because two or more adjacent traces may have the same shotpoint number).

SEG-Y Revision 1 Shotpoint Decimal Places
SEG-Y Revision 1 and SEGYL3 store SP both as an integer in bytes 17-20, as well as in bytes 197-200, 201-202 as a scaled values and scale factor. The shotpoints will be scaled, by multiplying by 10**ndec (ten to the power of the number of decimal places specified below) and stored in the trace header bytes 197-200 reserved for this purpose. The scale factor to be applied is stored in bytes 201-202.
Select the number of decimal places to preserve. You should ensure that the values thus scaled are unique for each trace.

SEG-Y Revision-1 shotpoints are stored as integers, but with a scale factor which determines the actual shotpoint value. SEGY Revision-1 specifies that a negative scale factor shall be used as a divisor. Thus, shotpoint 10.23 would be stored as 1023 with a scale factor of -100, i.e. the shotpoint is 1023 / 100, or 10.23

The precision obtainable in this way is limited, because the largest 4-byte integer that can be stored is about 2 billion. If you try to store a large shotpoint number to too many decimal places accuracy, this will cause an integer overflow. e.g. 3000.0000000 to 7 decimal places, would require the number 30,000,000,000 to be stored, with a scale factor of -7.

CDP Insertion

CDP insertion
CDP numbers are not generally used in Lynx seismic programs, because they are normally used for vectorized, post-stack data, where CDP numbers play no role. For compatibility with systems which do use CDPs, they can conveniently be inserted in this process:

CDP for first trace
The first trace will have this CDP number inserted

CDP increment
The output CDP number is calculated according to
Output CDP = (CDP for trace 1) + (Trace sequence no. - 1) * (CDP increment per trace)

SEGYOUT - SEG-Y Trace Header Preservation

If your input file is a Lynx Tr-file with shadow headers, or is a SEG-Y file, then the trace headers can be copied to the output file as-is. This is not recommended, and may conflict with the output SEG-Y format you have chosen. However, it may be a suitable choice if you are transcribing data, or if you need to preserve trace header values which would usually be overwritten or zeroed by SEGYOUT.

If you choose the Trace Headers - Preserve option on the previous page, then all trace headers from the input data will be preserved, with the exception of the following slots, which can optionally be overwritten:

Each of these header slots can optionally be overwritten with one of the following values:


XYEXTRACT - Extract X-Y Coordinates

The XYEXTRACT process is used to extract XY coordinates from the trace headers of a SEG-Y or Lynx format trace file.

Process ID - TracePrep standard process ID

Process title - A brief description of an instance of the process.

Location File type
Specifies the type of file, to which the extracted data will be written:

FileName
(type file path)
The name of the LOC file or shape file to which the data will be written. If the file does not exist, it will be created.

Coordinate reference
(option unknown,Shotpoint, Trace number, CDP or distance)
Determines how to derive a value for the reference associated with each XY coordinate pairs. Most commonly, this will be "shotpoint".

XY trace header fields
(type option Source,Group)

Line in file
(type option Replace,Append)
The action to be taken on finding that the current line already exists in the output file.


XYINSERT - Insert X-Y Coordinates

The XYINSERT process is used to insert XY coordinates into the trace headers of a Lynx or SEG-Y format trace file, using data from a specified location file. The location file should have at least two coordinate pairs, and the coordinate reference range (e.g. shotpoint, CDP) should cover approximately the same range as the trace file. Linear interpolation is used to calculate the coordinates for traces which fall between reference points in the location data. If there are traces outside the range covered by the location data, their coordinates will be calculated by extrapolating the nearest two location points - a warning that this has happened will be written in the process log. See also Lynx SeisMatch and LocPrep programs, which provide ways of managing this problem.

Process ID - TracePrep standard process ID

Process title - A brief description of an instance of the process.

Location File type
Specify input file type containing the XY coordinates to insert:

FileName
(type file name)

The file path for the location file, containing coordinate data to be inserted (used for Lynx LOC and Shapefile input).

Coordinate reference
(option Shotpoint,Trace,CDP,Distance)
This specifies the "measure", usually Shotpoint, which identifies each XY coordinate pair in the selected location file.

XY trace header fields
(option Source,Group,Both)

Coordinate units
(option Length,Seconds,DecDegrees,DMS)

Length units
(option Metres,Feet)

(Not implemented - assumed metres)


Program Messages

Could not create requested output directory In a SEGYOUT process, the selected output directory (folder) did not exist and a directory with this path could not be created. Probably, you do not have write permission to this path, or the medium on which the directory is to be created is read-only.

Off ends of line, extrapolated XY(points extrapolated) In an XYINSERT process, one or more traces on the seismic profile lay outside the range of the location data. Possible reasons for this are

In any case, you should always check the data carefully when you see this message. The XY coordinates for out-of-range traces are be calculated by linear extrapolation from the nearest two points in the location file, which may not be very accurate. It would be a good idea to use XYEXTRACT to extract the location data, so that a visual check can be made in BASEVIEW.

XY data file not found (fileNotFound). The requested file containing the XY data for XYINSERT was not found.

Could not open LOC or Shape file (fileOpenError). The requested LOC or Shape file could not be opend. Check using Baseview that the file has the expected format and that it is not corrupted. In the case of XYEXTRACT the file must allow writing, i.e. cannot be read-only.

C-Card modification file not found (noCCardfile). The file containing modifications to the C-Card header was not found.

Initialised output file (OutFileinit). The output file for SEGYOUT was successfully initialised.

Error opening output file (OutFileOpenError). The output file for SEGYOUT could not be opened.

SEG-Y FORMAT WAS MODIFIED (segymodified). This message will appear in the output file listing for SEGYOUT if the SEG-Y format parameters have been changed, since the previous trace file was output.

Shape file error number=xx(shpfilerror), where xx is an error code. In XYINSERT or XYXTRACT, the requested Shape file could not be opened. There are a lot of things that can go wrong with Shape files, some of which are listed below, in the form xx. error description.

  1. File not found
  2. Open Error
  3. Close error
  4. Error adding new database table field
  5. General DBF file error
  6. Error creating DBF file
  7. Error on record seek in DBF
  8. Header error
  9. A null shape was detected
  10. Bad parameters
  11. Unsupported Shape type
  12. Error appending new record
  13. Error adding coordinate points to list
  14. Read error
  15. Error in verification of shape file format
  16. Error creating new Shape file
  17. No polygon Measure value

Output traces limited under restricted licence (TracesLimited) When operated under a restricted (free trial period) licence, the SEGYOUT process may be restricted to outputting a maximum number of traces for any given trace file.

Error writing trace SEISIO code=xx (TraceWriteError), where xx is an error code returned from SEISIO.dll. The error codes are listed below, in the form xx. error description.

  1. Error opening file
  2. Error creating new file
  3. Error reading file
  4. Error writing file
  5. Filestream not initialised
  6. Filestream is read-only
  7. Unknown seismic format
  8. Trace number does not exist
  9. Illegal trace number eg negative number

XY coordinate records copied nn (XYCoordRecs). nn indicates the number of XY coordinate pairs extracted from the trace file. nn should be equal to the number of traces in the file.

XYExt exception (XYExtError). A general exception (untrapped error) occurred in XYEXTRACT.

XYIns exception (XYInsError). A general exception (untrapped error) occurred in XYINSERT.

failed when loading LOC or Shape file (XYLoadError). An error occureed when oading coordinates from a LOC or Shapefile in XYINSERT.

Coordinate Load/Save Errors

X coord numeric conversion error (XstrToNum) An error occurred when converting a string X coordinate to binary. The input string may contain imbedded blanks, or non-numeric characters, or an incorrect decimal separator, more than one decimal point etc.

Y coord numeric conversion error (YstrToNum). An error occurred when converting a string Y coordinate to binary. The input string may contain imbedded blanks, or non-numeric characters, or an incorrect decimal separator, more than one decimal point etc.

No coordinate data found (ErrNoCoordData). No valid coordinate data were found in the input file.

Error writing XYs to file (CoordSaveErr) Error while writing coordinates to an ini (TAX) file.

Error reading XYs from file (CoordReadErr). Error while reading coordinates from an ini (TAX) file.

Line not found in location file (LineNotFound). The requested line was not found in the input LOC or Shape file. The seismic line name must match exactly and should preferably not contain imbedded blanks or control charachters.. The match is case-sensitive.

LOC file record conversion error (LOCrecConvErr). An error occurred when reading a record from a LOC file. This may be due to incorrect alignment of the columns in the LOC file, or to formatting errors. If the LOC file contains Lat/Lon coordinates, these should be correctly aligned and formatted, even though they are not used in the XYEXTRACT or XYINSERT process.

LOC file format check failed (LOCFormatFail). The LOC file format is incorrect.

LOC file open failure (LOCOpenFail). Could not open the LOC file for reading or writing.


© Copyright Lynx Information Systems Ltd 2011