00001
00002
00003
00004
00005 void getPol(int xFill, float &P_blue, float &Q_yell, float &eP, float &eQ){
00006 char *inpF="OsamuPol/polVsFill.dat";
00007
00008 FILE *fd=fopen(inpF,"r"); assert(fd);
00009 const int len=1000;
00010 char buf[len], cdum[100];
00011 float dum;
00012 int nY,nB;
00013
00014 int k=1,i=0;
00015 while(k) {
00016 k=fgets(buf,len,fd); i++;
00017 if(buf[0]=='#') continue;
00018
00019 int j=sscanf(buf,"%s %f %f %f %d %f %f %d",
00020 cdum, &dum, &P_blue ,&eP, &nB, &Q_yell ,&eQ, &nY);
00021 assert(j==8);
00022 int fill=atoi(cdum+1);
00023 if(fill!=xFill) continue;
00024
00025 if(nB<1) {P_blue=0.0001,eP=2.;}
00026 if(nY<1) {Q_yell=0.0001,eQ=2.;}
00027 fclose(fd);
00028 goto end;
00029 }
00030 P_blue=0.0001,eP=3.;
00031 Q_yell=0.0001,eQ=3.;
00032 return;
00033
00034 end:
00035 printf("%s blue=%f /- %f yell=%f +/- %f\n",cdum,P_blue, eP, Q_yell,eQ);
00036
00037 }
00038
00039
00040