read_mjy_data_file_c

status.i4.v = read_mjy_data_file_c(file_name.i1a.r, header_data.s.r,
channel_data.sa.r,
horz_increment.r4.r,
max_traces.i4.v,
mpnts_per_trace.i4.v,
num_traces.i4.r, pnts_per_trace.i4.r
[,options.u4.v]
[,timestamps.u4p.r]
[,chan_1_values.gp.r]
[,chan_2_values.gp.r]
[,chan_3_values.gp.r]
[,chan_4_values.gp.r])
This routine reads data from an MJY format binary data file.
file_name null terminated ASCII file name (including path)
header_data returned file header data
(structure of type MJY_FILE_HEADER_DATA)
(A value of NULL can be passed for this argument
if this value is not needed.)
channel_data returned file channel data
(MJY_FILE_MAX_CHANNELS structures of type
MJY_FILE_CHANNEL_DATA)
(A value of NULL can be passed for this argument
if these values are not needed.)
horz_increment returned horizontal point increment in nanoseconds
(A value of NULL can be passed for this argument
if this value is not needed.)
max_traces maximum number of traces to return
(If a value of 0 is passed for this argument,
all traces will be returned.)
mpnts_per_trace maximum number of points per trace to return
(If a value of 0 is passed for this argument,
all points will be returned.)
num_traces returned number of traces
(A value of NULL can be passed for this argument
if this value is not needed.)
pnts_per_trace returned number of points per trace
(A value of NULL can be passed for this argument
if this value is not needed.)
[options] file read options
(MJY_FILE_OPT_NONE -> no options selected
(return channel values as
single precision floats)
(default),
MJY_FILE_OPT_DOUBLE_VALUES -> return channel values as
double precision floats)
[timestamps] returned trace timestamps
(number of traces values)
(default is NULL)
[chan_1_values] returned channel 1 values
(A value of NULL can be passed for this argument
if this value is not needed.)
(The memory for these values is allocated by this
routine and should be freed by the caller.)
[chan_2_values] returned channel 2 values
(A value of NULL can be passed for this argument
if this value is not needed.)
(The memory for these values is allocated by this
routine and should be freed by the caller.)
[chan_3_values] returned channel 3 values
(A value of NULL can be passed for this argument
if this value is not needed.)
(The memory for these values is allocated by this
routine and should be freed by the caller.)
[chan_4_values] returned channel 4 values
(A value of NULL can be passed for this argument
if this value is not needed.)
(The memory for these values is allocated by this
routine and should be freed by the caller.)
This function returns ACNET status values as follows:
OK success
CLIB_NOTOPN failed to open the source file
CLIB_NO_SUCH no values found in the file
This function requires the following include files:
cnsparam_h, ul_cbsaux_h:auxlib_misc_h, acnet_errors_h
Related functions:
write_mjy_data_file_c
C/C++ usage:
static const char file_name[] = "FB-20150310-cycle-1";
int status;
int max_traces = 0;
int mpnts_per_trace = 0;
int num_traces;
int pnts_per_trace;
unsigned int options = MJY_FILE_OPT_DOUBLE_VALUES;
unsigned int *timestamps;
double horz_increment;
double *chan_1_values;
double *chan_2_values;
double *chan_3_values;
double *chan_4_values;
MJY_FILE_HEADER_DATA header_data;
MJY_FILE_CHANNEL_DATA channel_data[MJY_FILE_MAX_CHANNELS];
status = read_mjy_data_file_c(file_name,&header_data,channel_data,
&horz_increment,max_traces,
mpnts_per_trace,&num_traces,
&pnts_per_trace,options,
&timestamps,(void *) &chan_1_values,
(void *) &chan_2_values,
(void *) &chan_3_values,
(void *) &chan_4_values);