#include #include #include "magframe_out_br.h" #include "df.h" #include "mfhdf.h" void main(argc, argv) int argc; char *argv[]; { int32 hdf_fp, sd_id; struct MagFrm_out_br testdata; int ii,jj,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); } if( init_rd_mag_br(hdf_fp, sd_id) ==0) { fprintf(stderr,"No mag vector data\n"); exit(-1); } ii=0; while((retval= read_mag_br(&testdata,ii))!=-1) { printf("%4d bin_start = %f", ii++,testdata.bin_start); printf("%4d ", testdata.iflag_out); printf("%e %e %e\n", testdata.b_out[0], testdata.b_out[1], testdata.b_out[2]); } /* all done, close HDF file */ close_rd_mag_br(); Vend(hdf_fp); if (SDend(sd_id)==FAIL) { fprintf(stderr, "SDend: could not close hdf file\n"); exit(-1); } if (Hclose(hdf_fp)==FAIL) { fprintf(stderr, "Hclose: could not close hdf file\n"); exit(-1); } exit(0); } #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 #include #include "mag_hskp.h" #include "df.h" void main(argc, argv) int argc; char *argv[]; { int32 hdf_fp,SD_id; struct MagHskpSet testdata; int ii,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_hskp(hdf_fp, SD_id); ii=0; while((retval= read_mag_hskp(&testdata,ii))!=-1) { printf("%4d sc clock = %8d\n", ii++,testdata.sctime_readout); printf(" %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %4x\n", testdata.st1a, testdata.st2a, testdata.st3, testdata.st4, testdata.st5, testdata.st6, testdata.pctemp, testdata.cmon, testdata.hk1, testdata.hk2, testdata.hk3, testdata.hk4, testdata.hk5, testdata.sync, testdata.st); } /* all done, close HDF file */ close_rd_mag_hskp(); fprintf(stderr,"VS detached \n"); Vend(hdf_fp); fprintf(stderr,"VS ended \n"); if (Hclose(hdf_fp)==FAIL) { fprintf(stderr, "Hclose: could not close hdf file\n"); exit(-1); } fprintf(stderr,"file closed \n"); exit(0); } #include #include #include "mag_snapshot.h" #include "df.h" void main(argc, argv) int argc; char *argv[]; { int32 hdf_fp,SD_id; struct MagSnapSet testdata; int ii,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_snap(hdf_fp, SD_id); ii=0; while((retval= read_mag_snap(&testdata,ii))!=-1) { printf("%4d sc clock = %8d\n", ii++,testdata.sctime_readout); } /* all done, close HDF file */ close_rd_mag_snap(); Vend(hdf_fp); if (Hclose(hdf_fp)==FAIL) { fprintf(stderr, "Hclose: could not close hdf file\n"); exit(-1); } exit(0); } #include #include #include "mag_vector.h" #include "df.h" #include "mfhdf.h" void main(argc, argv) int argc; char *argv[]; { int32 hdf_fp, sd_id; struct MagVectorSet testdata; int ii,jj,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); } if( init_rd_mag_vec(hdf_fp, sd_id) ==0) { fprintf(stderr,"No mag vector data\n"); exit(-1); } ii=0; while((retval= read_mag_vec(&testdata,ii))!=-1) { printf("%4d sc clock = %8d\n", ii++,testdata.sctime_readout); for(jj=0;jj<96;jj++) { printf("%3x %3x %3x ", testdata.vector[0][jj], testdata.vector[1][jj], testdata.vector[2][jj]); if((jj%6)==5) printf("\n"); } } /* all done, close HDF file */ close_rd_mag_vec(); Vend(hdf_fp); if (SDend(sd_id)==FAIL) { fprintf(stderr, "SDend: could not close hdf file\n"); exit(-1); } if (Hclose(hdf_fp)==FAIL) { fprintf(stderr, "Hclose: could not close hdf file\n"); exit(-1); } exit(0); }