cddx_outhdr - open a DDS dataset for output, selecting headers


SYNOPSIS

#include "cdds.h"

BIN_TAG function cddx_outhdr(alias, value, title, old_tag, sprime, hprime, hdrs);

const char *alias
const char *value
const char *title
BIN_TAG old_tag
int sprime
int hprime
const char *hdrs

DESCRIPTION

Routine, "cddx_outhdr", opens an output dataset much like the "cddx_out" routine, except that specified "hdrs" will be the first elements of the trace array (in the order specified) of type "hprime" (these can be newly created headers); followed by any other trace headers from the "old_tag" dataset; and then followed by"Samples" of type "sprime".

After opening a file for output with "cddx_outhdr" the output buffer Dictionary will be left open for printing. The open process will look for "alias" for the Dictionary (or usp, segy or su binary on input), "alias_data" for overriding the binary, and "alias_format" for overriding the format. The input parameter, "value", is the default value (eg. "stdin:" or "stdout:") used for a fallback in cases where "alias" is not specified by the user. The input parameter, "title", should be a brief one line description of the application program. It will return a binary tag associated with the internal binary upon successful opening, a value of -2 if the dataset is not specified and no default value is given, otherwise a value of -1 to signify an open failure.

The opening of output files with "cddx_outhdr" actually internally delays the final opening process until the "bin_tag" is used to write or seek. This allows the developer to make any modifications to the Dictionary prior to using it. It is reccommended that a call like "cdds_lseek(bin_tag, 0, 0, SEEK_SET);" be used to finish the opening process instead of waiting until an actual seek or write needs to be performed. Afterward, if old_tag >= 0 a call to " cdds_map" can be made which will map all the headers (not "Samples") from the old_tag to the output bin_tag buffer.

The specified "sprime" and "hprime" types can be any prime type defined for cdds_index".

AUTHOR

Jerry Ehlers, BP America (May 2003)