cddx_in - open a DDS dataset for input


SYNOPSIS

#include "cdds.h"

BIN_TAG function cddx_in(alias, value, title);

const char *alias
const char *value
const char *title

DESCRIPTION

Routine, "cddx_in", opens an input dataset. Any input headers will be dropped leaving the "Samples" starting at the first value of each trace; the "Samples" will be host-dependent complex if input data is complex, otherwise they will be host-dependent float. The dataset is open with "r+" so that is can be modified.

After opening a file for input the input buffer Dictionary will be left open for scanning (with the cdds_scan routines). 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:") 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. Each of these open routines 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_out" or "cddx_outhdr" actually internally delays the finally creation 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) 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".

EXAMPLES

	int n1, ier;
	BIN_TAG in_bin = cddx_in2("in", "stdin:", title);
	
	ier = cdds_scanf("size.axis(1)", "%d", &n1);
	
	float *trace = new float[n1];
	ier = cddx_read(in_bin, trace, 1);
      

AUTHOR

Jerry Ehlers, BP America (May 2003)