Crewes Seismic I/O Library File Index. Function Documentation. Functions to access seimic header definitions, страница 12

int seisioHdrDefn_readFromFile (int id, char * filename)

Reads header definitions from a file into a header definition object.

The header defintion file has the following format: <hdrName> <whichHeader> <dataFormat> <byteNumber> <description>

where  hdrName is a short (< 10 char) name (eg. NUMSMP, CDP) whichHeader is either F (for the file header) or T (for the trace header) dataFormat is I2, I4, F4IBM or F4IEEE byteNumber is the byte number within the header. The first header word is stored at byte 1 in either header. description is a short (<40 char) description

For example: JOB_ID_HDR F I4 1 Job identification number NUMSMP T I2 114 Number of samples per trace

Parameters:

id   identification number of the seismic definition instance to access

filename   name of the file containing the header definitions.

Todo:

Load description from file

int seisioHdrDefn_removeAll (int id)

Removes all header definitions from a header defintion object.

The header definition object remains viable, and can be re-populated  with new header entries.

Parameters:

id   identification number of the seismic definition instance to access

int seisioHdrDefn_set (int id, const char * hdrName, const char * hdrDescription, char hdrType, int type, int byte)

Sets the header definition corresponding to a header definition name.

Returns non-zero on error (see seisio.h for error definitions).

Parameters:

id   identification number of the seismic definition instance to access 

hdrName   name of the header to set

hdrInfo   short description of header value

hdrType   type of header ('F' or 'T')

type   type of header definition data (see seisio.h for definitions)

byte   byte index of header definition

int seisioHdrDefn_writeToFile (int id, char * filename)

Writes the current state of the seismic definition instance to a file.

Parameters:

id   identification number of the seismic definition instance to access 

Returns:

non-zero on error (see seisio.h for error definitions).


seisioHdrDefn.h File Reference

Functions to access seimic header definitions.

#include "seisio.h"

Detailed Description

Functions to access seimic header definitions.


seisioTrcHdr.c File Reference

seismic file trace header object.

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include "seisio.h"

#include "seisioTrcHdr.h"

#include "seisioHdrDefn.h"

Functions

·  int seisioTrcHdr_new (int seisioHdrDefnID)

Creates a new seismic trace header object instance.

·  int seisioTrcHdr_free (int id)

Deallocates the corresponding seismic trace header definition instance.

·  int seisioTrcHdr_putI2 (int id, const char *hdrName, int16 hdrValue)

Put a value (int16) into the data segment.

·  int seisioTrcHdr_putI4 (int id, const char *hdrName, int32 hdrValue)

Put a value (int32) into the data segment.

·  int seisioTrcHdr_putF4 (int id, const char *hdrName, float hdrValue)

Put a value (float) into the data segment.

·  int seisioTrcHdr_getI2 (int id, const char *hdrName, int16 *hdrValue)

Get a value (int16) from the data segment.

·  int seisioTrcHdr_getI2ByByte (int id, int byt, int16 *hdrValue)

Get a value 2-byte (16 bit) integer value from the trace header given a starting byte location.

·  int seisioTrcHdr_getI4 (int id, const char *hdrName, int32 *hdrValue)

Get a value (int32) from the data segment.

·  int seisioTrcHdr_getI4ByByte (int id, int byt, int32 *hdrValue)

Get a value 4-byte (32 bit) integer value from the trace header given a starting byte location.

·  int seisioTrcHdr_getF4 (int id, const char *hdrName, float *hdrValue)

Get a value (float) from the data segment.

·  int seisioTrcHdr_getF4ByByte (int id, int byt, float *hdrValue)