示例#1
0
nemo_main()
{
  int n = 0;
  setparams();                    /* set globals */

  instr = stropen (infile, "r");
  plinit ("***", 0.0, 20.0, 0.0, 20.0);       /* init yapp */
  while (read_image(instr,&iptr)) {   /* loop while more images found */
    dprintf(1,"Time= %g MinMax= %g %g\n",Time(iptr),MapMin(iptr),MapMax(iptr));
    nx=Nx(iptr);			
    ny=Ny(iptr);
    nz=Nz(iptr);
    if (nz > 1) error("Cannot handle 3D images [%d,%d,%d]",nx,ny,nz);
    xmin=Xmin(iptr);
    ymin=Ymin(iptr);
    dx=Dx(iptr);
    dy=Dy(iptr);
    xsize = nx * dx;
    ysize = ny * dy;
    if (n>0) {
      sleep(1);
      plframe();
    }
    plot_map();                                 /* plot the map */
    n++;
  }
  plstop();                                   /* end of yapp */
  strclose(instr);
}
int main(void)
{
  if ((ipass=fopen(scans,"r"))==NULL)
    {
      printf("Cannot open file. \n");
      exit(1);
    }
  fscanf(ipass,"%i", &Ptotal);
 
   for (Pindex=1; Pindex<=Ptotal; Pindex++)
    {
      fscanf(ipass,"%s", powerfile);
      //      printf("%s\n",powerfile);
      if ((fp=fopen(powerfile,"r"))==NULL)
	{
      	  printf("Cannot open file. \n");
	  exit(1);
	}
      strcpy(passfile,"");
      strcat(passfile,prefix);
      p=strpbrk(powerfile,"2");
      strcat(passfile,p);
      //     printf("%s\n",passfile);
  if ((fpass=fopen(passfile,"r"))==NULL)
    {
      printf("Cannot open file. \n");
      exit(1);
    }
  printf("\nReading data file %s \n",powerfile);

  for (acqcount=1; acqcount < (numofacqs+1); acqcount++) read_data();
  read_pass_file();
  //  test_data();
  fclose(fpass);
  fclose(fp);
    }
  group_data();
  pg_id = cpgopen("/XSERVE");

  while (sat_choice <100)
    {
      printf("\nPlot Satellite: ");
      scanf("%i", &sat_choice);
      if (sat_choice<40) plot_map();
    }
      
  write_map();
  fclose(ipass);
  printf("End of Program\n");
  return 0;
}