/*******************/ xc_cal = CAL_x_center[ch_no-1]; yc_cal = CAL_y_center[ch_no-1]; r0_cal = CAL_width_image[ch_no-1]/2; irmax = 2*r_image; /** data file open **/ sprintf(fin_name,"%s/work2/tmp/%s-%07d.jpg",base_dir,header_name,k); sprintf(cmnd,"jpegtopnm %s > %s/work2/jpgdata.pnm",fin_name,base_dir); system(cmnd); sprintf(fin_name,"%s/work2/jpgdata.pnm",base_dir); f_in = fopen(fin_name,"rb"); /** read information of the image **/ fgets(cdat1,sizeof(cdat1),f_in); if(cdat1[1]=='6'){ fclose(f_in); sprintf(cmnd,"ppmtopgm %s/work2/jpgdata.pnm > %s/work2/jpgdata.pgm",base_dir,base_dir); system(cmnd); sprintf(fin_name,"%s/work2/jpgdata.pgm",base_dir); f_in = fopen(fin_name,"rb"); fgets(cdat1,sizeof(cdat1),f_in); }; fgets(cdat1,sizeof(cdat1),f_in); sscanf(cdat1,"%s %s\n",cw,ch); width = atoi(cw); height = atoi(ch); /** read data **/ n = fread(buf1,nbyte,width*height,f_in); ix = 20; iy = height/2; bg_obs = buf1[iy*width + ix]; /** calculate intensity (Rayleigh) from raw data (bit) using CAL data **/ for(i=0;i=0 && i_cal=0 && j_cal