/* Routine to extract the filter curves from a binary irfc*.dat FITS data segment. Format: % gettab irfcNNNN.dat rec_count irfcNNNN.tab 04 May 2006. */ #include #include #include #include /*========================================================================*/ main(int argc, char *argv[]) { FILE *ifp,*ofp; long int rec[2]; /* Record values */ double wavelength, transmit; long int rows; int i,j,k; char *rem; if (argc != 4) { fprintf (stderr,"Usage: gettab irfcNNNN.dat rec_count irfcNNNN.tab\n"); exit(0); } if ((ifp = fopen(argv[1],"rb")) == NULL) { fprintf(stderr,"Unable to open '%s' for reading (%s).\n", argv[1],strerror(errno)); exit(100); } if ((ofp = fopen(argv[3],"w")) == NULL) { fprintf(stderr,"Unable to open '%s' for writing (%s).\n", argv[3],strerror(errno)); exit(200); } rows = strtol(argv[2],&rem,10); for (i=0; i