This document describes the format of the spectrometer data file.
Each section begins with a leader which consists of 2 longs:
#define TIME_SECTION 0 #define SYMBOL_TABLE_SECTION 1 #define PULSE_PROGRAM_SECTION 2 #define COMMENTS_SECTION 3 #define GLOBAL_SYMBOLS_SECTION 4 #define DATA_SECTION 5 #define TERMINATION_STATUS_SECTION 6
time_t
(=long
). See
the time(2) man page for further details.
argv[0]
upon
execution of the pulse program. The file obtained after
appending ".c
" is copied
verbatim into the data file.
The global symbols are found in a structure defined in "file_utils.h":
typedef struct global_symbols_tag { double sw; double sf1; double sf2; double sf3; double size; double scans; double experiment; } GLOBAL_SYMBOLS;This structure is written into the data file.
typedef struct FID_point_tag { long int real, imag; } FID_POINT;Pulse programs with multiple data sets will concatenate several data sections. Each data set will have its own leader:
#define RUNNING 0x00 #define HALTED 0x01 #define ABORTED 0x02 #define ERROR 0x03The termination status is of type:
unsigned long
.
A program which uses them is:
/* * file_reader.c * * A test program for file support utilities. */ #include "file_utils.h" #include "pulse.h" /* Global variable "data_file" is here */ FILE * data_file; void main( int argc, char *argv[] ) { if ((data_file = fopen("Out_File", "rb")) == NULL) fprintf(stderr,"\nCould not open Out_File.\n"); while (1) { read_section( ); } fclose( data_file ); }Additional functions which convert the contents of the data file to a particular format can be based on those found in "file_utils.c".
Jonathan Callahan