#include #include #include "mag_fft.h" #include "df.h" void main(argc, argv) int argc; char *argv[]; { int32 hdf_fp,SD_id; struct MagFFTSet testdata; int ii,jj,kk,retval; if (argc!=2) { printf("Usage: rd_hdf hdf_file\n"); exit(1); } /* open hdf input file */ if ((hdf_fp=Hopen(argv[1], DFACC_ALL, 0))==FAIL) { fprintf(stderr, "Hopen: could not open hdf file\n"); exit(-1); } Vstart(hdf_fp); if ((SD_id=SDstart(argv[1], DFACC_WRITE))==FAIL) { fprintf(stderr, "SDstart: could not open hdf file\n"); exit(-1); } init_rd_mag_fft(hdf_fp, SD_id); ii=0; while((retval= read_mag_fft(&testdata,ii))!=-1) { printf("%4d sc clock = %8d QAC=%3d\n", ii++,testdata.sctime_readout,testdata.QAC); printf(" %4x %4x %4x %4x %4x\n", testdata.fft_statbits[0], testdata.fft_statbits[1], testdata.fft_statbits[2], testdata.fft_statbits[3], testdata.fft_statbits[4]); for(jj=0;jj