text: /* FitReadRadarScan.c
     ===================
     Author: R.J.Barnes */
  
  
  #include <stdio.h>
  #include <stdlib.h>
  
  #include "rtypes.h"
  #include "rtime.h"
  #include "dmap.h"
  #include "limit.h"
  #include "rprm.h"
  #include "fitdata.h"
  #include "fitread.h"
  #include "scandata.h"
  #include "fitscan.h"
  
  struct RadarScan scn;
  
  
  int main(int argc,char *argv[]) {
   
    FILE *fp;
    int fd;
  
    struct RadarParm prm;
    struct FitData fit;
    int state=0;
  
  
    int yr,mo,dy,hr,mt;
    double sc;
  
    fp=fopen(argv[1],"r");
    fd=fileno(fp);
  
    if (fp==NULL) {
      fprintf(stderr,"File not found.\n");
      exit(-1);
    }
  
    while(FitReadRadarScan(fd,&state,&scn,&prm,&fit,0,0,0) !=-1) {
      TimeEpochToYMDHMS(scn.st_time,&yr,&mo,&dy,&hr,&mt,&sc);
  
      fprintf(stdout,"%.4d-%.2d-%.2d %.2d:%.2d:%.2d\n",
              yr,mo,dy,hr,mt,(int) sc);
  
    }
  
  
    
   
    fclose(fp);
  
  
    return 0;
  }
  