IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26764


Ignore:
Timestamp:
Feb 2, 2010, 7:06:18 PM (16 years ago)
Author:
watersc1
Message:

new burntool code

Location:
branches/eam_branches/20091201
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/analysis/libpscoords/pscoords.c

    r24391 r26764  
    181181#define PSC_REFRACT_CONST 55.7  /* Standard refraction ("/tanz) at STP */
    182182#endif
     183
     184/* Return default values for current fit*/
     185int psc_defaults(double *pscale, double *d2, double *d3, double *airdens)
     186{
     187   *pscale = PS_scale;
     188   *d2 = PS_d2;
     189   *d3 = PS_d3;
     190   *airdens = PS_airdens;
     191   return(0);
     192}
    183193
    184194/* Enable application of chip offsets (um, mrad)? */
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/analysis/libpscoords/pscoords.h

    r24391 r26764  
    244244/* Enable application of chip offsets (um, mrad)? */
    245245int psc_load_otaoff(const char *fname);
     246
     247/* Return default values for current fit*/
     248int psc_defaults(double *pscale, double *d2, double *d3, double *airdens);
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/analysis/libpsf/psf.c

    r23924 r26764  
    111111/* Load up results (with a few sanity checks!) */
    112112   if(psfout != NULL && alg != PSF_2DIM) {
    113       psfout->ix = 0;
    114       psfout->iy = 0;
     113//      psfout->ix = 0;
     114//      psfout->iy = 0;
     115// 091211: JT this is a harmless lie, supposed to be highest pixel
     116      psfout->ix = xu;
     117      psfout->iy = yu;
     118//
    115119      psfout->x0 = xu;
    116120      psfout->y0 = yu;
     
    128132         psfextra->xfw = xfwhm;
    129133         psfextra->yfw = yfwhm;
     134         psfextra->majfw = 0.0;
     135         psfextra->minfw = 0.0;
     136         psfextra->thfw = 0.0;
     137         psfextra->wpeak = 0.0;
     138         psfextra->wbkgnd = 0.0;
     139         psfextra->dflux = 0.0;
     140         psfextra->dbkgnd = 0.0;
     141         psfextra->rmsbkgnd = 0.0;
    130142      }
    131143      if(alg == PSF_BIN) psfextra->binfactor = extra;
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/analysis/libpsf/psf2dim.f

    r23490 r26764  
    188188      wpar(9) = 0.5
    189189* WAUX: NXPATCH, NYPATCH, NX, XOFF, YOFF, EADU, EXTRASKY, IGNORE_VALUE, INIT
    190       waux(1) = min(n,nx-1-mx) + n + 1
    191       waux(2) = min(n,ny-1-my) + n + 1
     190C      waux(1) = min(n,nx-1-mx) + n + 1
     191C      waux(2) = min(n,ny-1-my) + n + 1
     192      waux(1) = min(2*n+1, nx-1-iwxs)
     193      waux(2) = min(2*n+1, ny-1-iwys)
    192194      waux(3) = nx
    193195      waux(4) = iwxs
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/burnfix.c

    r25070 r26764  
    7272      ymid = (cell->burn[k].y0m + cell->burn[k].y1m +
    7373              cell->burn[k].y0p + cell->burn[k].y1p + 2) / 4;
    74       i = cell->burn[k].nfit / 2;
     74      i = ABS(cell->burn[k].nfit) / 2;
    7575      printf("%3d %5d %3d %5d %5d %3d %5d %3d %5d %5d %2d %1d %1d %6.3f %8d\n",
    7676             k,
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/burntool.c

    r25438 r26764  
    5050      fprintf(stderr, "\rerror: burntool could not open file `%s'\n",
    5151              ifilename);
    52       exit(EXIT_FAILURE);
     52      exit(-314);
    5353   }
    5454   nextend = fh_extensions(ihu);
     
    5757              ifilename);
    5858#ifndef JT2DHACK
    59       exit(EXIT_FAILURE);
     59      exit(-315);
    6060#endif
    6161   }
     
    343343             ifilename);
    344344     if(persist_fits_remove_tables(ihu, deltablefitsfile) != FH_SUCCESS) {
    345        exit(EXIT_FAILURE);
    346      }
    347      else {
     345       exit(-316);
     346     } else {
    348347       exit(EXIT_SUCCESS);
    349348     }
     
    365364/* Read the persistence data for this OTA */
    366365   if(persistfile != NULL) {                    /* Text data file */
    367       if(persist_read(OTA, persistfile)) exit(EXIT_FAILURE);
     366      if(persist_read(OTA, persistfile)) exit(-317);
    368367   } else if(persistfitsfile != NULL) {         /* FITS table */
    369368      if(persist_fits_read(OTA, persistfitsfile) != FH_SUCCESS)
    370          exit(EXIT_FAILURE);
     369         exit(-318);
    371370   }
    372371
     
    427426                 "\rerror: Cannot read EXTNAME from `%s' for extension #%d\n",
    428427                 ifilename, ext);
    429          exit(EXIT_FAILURE);
     428         exit(-319);
    430429      }
    431430      if(fh_get_str(ehu, "XTENSION", xtension, sizeof(xtension)) != FH_SUCCESS) {
     
    433432                 "\rerror: Cannot read XTENSION from `%s' for extension #%d\n",
    434433                 ifilename, ext);
    435          exit(EXIT_FAILURE);     
     434         exit(-320);
    436435      }
    437436      if(!strcmp("TABLE", xtension)) {
     
    461460         fprintf(stderr,
    462461                 "\rerror: Illegal cell number %d from '%s'\n", cell, extname);
    463          exit(EXIT_FAILURE);
     462         exit(-321);
    464463      }
    465464
     
    487486          (naxis >= 3 && fh_get_NAXIS3(ehu, &naxis3) != FH_SUCCESS)) {
    488487         fprintf(stderr, "\rerror: Cannot get NAXIS*'\n");
    489          exit(EXIT_FAILURE);
     488         exit(-322);
    490489      }
    491490      if (naxis != 2) {
     
    503502         }
    504503         fprintf(stderr, "\rerror: 32bpp support not yet implemented in burntool.\n");
    505          exit(EXIT_FAILURE);
     504         exit(-324);
    506505      }
    507506/* Check BSCALE and warn if it is anything other than 1.0.
     
    525524      }
    526525
    527       buf = (IMTYPE*)malloc(naxis1*naxis2*naxis3*sizeof(short));
     526      if( (buf = (IMTYPE*)malloc(naxis1*naxis2*naxis3*sizeof(short))) == NULL) {
     527         fprintf(stderr, "\rerror: failed to alloc FITS buffer\n");
     528         exit(-325);
     529      }
    528530      if (fh_read_padded_image(ehu, fh_file_desc(ehu), buf,
    529531                               naxis1*naxis2*naxis3*sizeof(short),
     
    531533         fprintf(stderr, "\rerror: failed to read image data for extension `%s'.\n",
    532534                 extname);
    533          free(buf);
    534          exit(EXIT_FAILURE);
     535//       free(buf);
     536         exit(-326);
    535537      }
    536538
     
    617619               fprintf(stderr, "\rerror: failed to re-write image data for extension `%s'.\n",
    618620                       extname);
    619                free(buf);
    620                exit(EXIT_FAILURE);
     621//             free(buf);
     622               exit(-327);
    621623            }
    622624         }
     
    667669   if(2*SKY_MARG*ny > nmedian_buf) {
    668670      if(median_buf != NULL) free(median_buf);
    669       median_buf = (int *)calloc(2*SKY_MARG*ny, sizeof(int));
     671      if( (median_buf = (int *)calloc(2*SKY_MARG*ny, sizeof(int))) == NULL) {
     672         fprintf(stderr, "\rerror: failed to alloc median buffer\n");
     673         exit(-667);
     674      }
     675
    670676      nmedian_buf = 2*SKY_MARG*ny;
    671677   }
     
    674680   if(NX*NY > nimbuf) {
    675681      if(imbuf != NULL) free(imbuf);
    676       imbuf = (int *)calloc(NX*NY, sizeof(DTYPE));
     682      if( (imbuf = (int *)calloc(NX*NY, sizeof(DTYPE))) == NULL) {
     683         fprintf(stderr, "\rerror: failed to alloc cell copy\n");
     684         exit(-668);
     685      }
    677686      nimbuf = NX*NY;
    678687   }
     
    681690   if(NX*NY > nmbuf) {
    682691      if(mbuf != NULL) free(mbuf);
    683       mbuf = (int *)calloc(NX*NY, sizeof(MTYPE));
     692      if( (mbuf = (int *)calloc(NX*NY, sizeof(MTYPE))) == NULL) {
     693         fprintf(stderr, "\rerror: failed to alloc mask buffer\n");
     694         exit(-669);
     695      }
    684696      nmbuf = NX*NY;
    685697   }
     
    688700   if(NX*NY > nmsbuf) {
    689701      if(msbuf != NULL) free(msbuf);
    690       msbuf = (int *)calloc(NX*NY, sizeof(MTYPE));
     702      if( (msbuf = (int *)calloc(NX*NY, sizeof(MTYPE))) == NULL) {
     703         fprintf(stderr, "\rerror: failed to alloc veto buffer\n");
     704         exit(-670);
     705      }
    691706      nmsbuf = NX*NY;
    692707   }
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/burntool.h

    r25070 r26764  
    208208STATIC int wlinearfit(int npt, double *x, double *y,
    209209                      double *w, double *a, double *b);
     210STATIC int linearrms(int npt, double *x, double *y, double a, double b, double *rms);
    210211STATIC int int_median(int n, int *key);
    211212STATIC double double_median(int n, double *key);
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/burnutils.c

    r25070 r26764  
    290290   return(0);
    291291}
     292
     293/****************************************************************/
     294/* Return of RMS relative to Fit y = ax + b */
     295STATIC int linearrms(int npt, double *x, double *y, double a, double b,
     296                     double *rms)
     297{
     298   *rms = 0.0;
     299   while(--npt >= 0) *rms += (y[npt]-a*x[npt]-b)*(y[npt]-a*x[npt]-b);
     300   if(*rms > 0) *rms = sqrt(*rms);
     301   return(0);
     302}
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/man/burntool.1

    r25324 r26764  
    6060        correction is applied) and they will propagate from input to output
    6161        until they finally achieve a legal fit with negligible amplitude.
     62        Note that if burntool decides that a fit had a bad slope but was
     63        non-negligible it negates the "nfit" width parameter of the fit box.
    6264
    6365        Burntool also identifies really blasted areas which are saturated from
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/persist_fits.c

    r25299 r26764  
    222222      for(k=0; k<cell[j].npersist; k++)
    223223      {
     224/* Retire old burns */
     225         if(cell[j].time - cell[j].persist[k].time > EXPIRE_TRAIL_TIME)
     226            continue;
     227
    224228         if(PERSIST_RETAIN) {
    225229/* Keep fits which have a dubious slope */
     
    233237         }
    234238         num_areas++;
    235          num_fits += cell[j].persist[k].nfit;
     239         num_fits += ABS(cell[j].persist[k].nfit);
    236240      }
    237241
     
    253257         }
    254258         num_areas++;
    255          num_fits += cell[j].burn[k].nfit;
     259         num_fits += ABS(cell[j].burn[k].nfit);
    256260      }
    257261   }
     
    308312      (fh_table_write_value(table, data, row, AREA_TABLE_COL_EXFIT, &(area->exfit)) != FH_SUCCESS))
    309313   {
    310       fprintf(stderr, "error: Error writing data to row %d of area table.\n", row);
     314      fprintf(stderr, "\rerror: Error writing data to row %d of area table.\n", row);
    311315      return FH_BAD_VALUE;
    312316   }
     
    346350      for(k=0; k<cell[j].npersist; k++)
    347351      {
     352/* Retire old burns */
     353         if(cell[j].time - cell[j].persist[k].time > EXPIRE_TRAIL_TIME)
     354            continue;
     355
    348356         if(PERSIST_RETAIN) {
    349357/* Keep fits which have a dubious slope */
     
    422430      (fh_table_write_value(table, data, row, FIT_TABLE_COL_ZERO, &zero) != FH_SUCCESS))
    423431   {
    424       fprintf(stderr, "error: Error writing data to row %d of fit table.\n", row);
     432      fprintf(stderr, "\rerror: Error writing data to row %d of fit table.\n", row);
    425433      return FH_BAD_VALUE;
    426434   }
     
    460468      for(k=0; k<cell[j].npersist; k++)
    461469      {
     470/* Retire old burns */
     471         if(cell[j].time - cell[j].persist[k].time > EXPIRE_TRAIL_TIME)
     472            continue;
     473
    462474         if(PERSIST_RETAIN) {
    463475/* Keep fits which have a dubious slope */
     
    468480            if(cell[j].persist[k].fiterr) continue;
    469481         }
    470          for(i=0; i<cell[j].persist[k].nfit; i++)
     482         for(i=0; i<ABS(cell[j].persist[k].nfit); i++)
    471483         {
    472484            result = write_fit_row(hu, data, table, row++,
     
    493505         }
    494506
    495          for(i=0; i<cell[j].burn[k].nfit; i++)
     507         for(i=0; i<ABS(cell[j].burn[k].nfit); i++)
    496508         {
    497509            result = write_fit_row(hu, data, table, row++,
     
    534546   {
    535547      fprintf(stderr,
    536               "error: Unable to get cell number from row %d of burn area table\n",
     548              "\rerror: Unable to get cell number from row %d of burn area table\n",
    537549              row);
    538550      return FH_BAD_VALUE;
     
    542554   if((cell_num < 0) || (cell_num > MAXCELL))
    543555   {
    544       fprintf(stderr, "error: illegal cell %d in area table row %d\n",
     556      fprintf(stderr, "\rerror: illegal cell %d in area table row %d\n",
    545557              cell_num, row);
    546558      boxbuf[row].cell = -1;
     
    576588   {
    577589      fprintf(stderr,
    578               "error: Error reading values from row %d of burn area table\n",
     590              "\rerror: Error reading values from row %d of burn area table\n",
    579591              row);
    580592      boxbuf[row].nfit = 0;
     
    583595   
    584596   /* Make space for fits (to be read later). */
    585    if(boxbuf[row].nfit > 0)
     597   if(ABS(boxbuf[row].nfit) > 0)
    586598   {
    587599      /* This shouldn't happen, but be nice and don't leak. */
     
    590602      if(boxbuf[row].yfit) free(boxbuf[row].yfit);
    591603
    592       boxbuf[row].zero = (double *)calloc(boxbuf[row].nfit, sizeof(double));
    593       boxbuf[row].xfit = (int *)calloc(boxbuf[row].nfit, sizeof(int));
    594       boxbuf[row].yfit = (int *)calloc(boxbuf[row].nfit, sizeof(int));
     604      boxbuf[row].zero = (double *)calloc(ABS(boxbuf[row].nfit), sizeof(double));
     605      boxbuf[row].xfit = (int *)calloc(ABS(boxbuf[row].nfit), sizeof(int));
     606      boxbuf[row].yfit = (int *)calloc(ABS(boxbuf[row].nfit), sizeof(int));
     607
     608      if(boxbuf[row].zero == NULL ||
     609         boxbuf[row].xfit == NULL ||
     610         boxbuf[row].yfit == NULL) {
     611         fprintf(stderr, "\rerror: failed to alloc boxbuf\n");
     612         exit(-671);
     613      }
    595614      boxbuf[row].fiterr = 0;
    596615   }
     
    627646      (fh_get_int(hu, "TFIELDS", &num_cols) != FH_SUCCESS))
    628647   {
    629       fprintf(stderr, "error: Unable to find required keywords for area table dimensions\n");
     648      fprintf(stderr, "\rerror: Unable to find required keywords for area table dimensions\n");
    630649      return FH_NOT_FOUND;
    631650   }
     
    634653   if(num_cols != table->num_cols)
    635654   {
    636       fprintf(stderr, "error: %d-column area table found, expected %d cols.\n",
     655      fprintf(stderr, "\rerror: %d-column area table found, expected %d cols.\n",
    637656              num_cols, table->num_cols);
    638657      return FH_BAD_VALUE;
     
    642661   {
    643662      fprintf(stderr,
    644               "error: too many boxes in area table. Max is %d, got %d\n",
     663              "\rerror: too many boxes in area table. Max is %d, got %d\n",
    645664              MAXBURN, num_rows);
    646665      return FH_BAD_VALUE;
     
    654673   {
    655674      fprintf(stderr,
    656               "error: Unable to allocate %d bytes for area table.\n",
     675              "\rerror: Unable to allocate %d bytes for area table.\n",
    657676              table->table_size);
    658677      return FH_NO_MEMORY;
     
    662681                    table->table_size, FH_TYPESIZE_8) != FH_SUCCESS)
    663682   {
    664       fprintf(stderr, "error: Unable to map area table body for reading.\n");
     683      fprintf(stderr, "\rerror: Unable to map area table body for reading.\n");
    665684      free(data);
    666685      return FH_INVALID;
     
    713732   {
    714733      fprintf(stderr,
    715               "error: Unable to get cell number from row %d of fit table\n",
     734              "\rerror: Unable to get cell number from row %d of fit table\n",
    716735              row);
    717736      return FH_BAD_VALUE;
     
    720739   if((*cell < 0) || (*cell > MAXCELL))
    721740   {
    722       fprintf(stderr, "error: illegal cell %d in fit table row %d\n",
     741      fprintf(stderr, "\rerror: illegal cell %d in fit table row %d\n",
    723742              *cell, row);
    724743     
     
    733752   {
    734753      fprintf(stderr,
    735               "error: Error reading values from row %d of burn area table\n",
     754              "\rerror: Error reading values from row %d of burn area table\n",
    736755              row);
    737756      return FH_BAD_VALUE;
     
    782801      (fh_get_int(hu, "TFIELDS", &num_cols) != FH_SUCCESS))
    783802   {
    784       fprintf(stderr, "error: Unable to find required keywords for fit table dimensions\n");
     803      fprintf(stderr, "\rerror: Unable to find required keywords for fit table dimensions\n");
    785804      return FH_NOT_FOUND;
    786805   }
     
    789808   if(num_cols != table->num_cols)
    790809   {
    791       fprintf(stderr, "error: %d-column fit table found, expected %d cols.\n",
     810      fprintf(stderr, "\rerror: %d-column fit table found, expected %d cols.\n",
    792811              num_cols, table->num_cols);
    793812      return FH_BAD_VALUE;
     
    805824   {
    806825      fprintf(stderr,
    807               "error: Unable to allocate %d bytes for area table.\n",
     826              "\rerror: Unable to allocate %d bytes for area table.\n",
    808827              table->table_size);
    809828      return FH_NO_MEMORY;
     
    811830   if(fh_read_image(hu, fh_file_desc(hu), data, table->table_size, FH_TYPESIZE_8) != FH_SUCCESS)
    812831   {
    813       fprintf(stderr, "error: Unable to read fit table body.\n");
     832      fprintf(stderr, "\rerror: Unable to read fit table body.\n");
    814833      free(data);
    815834      return FH_INVALID;
     
    821840   for(area = 0; area < num_areas; area++)
    822841   {
    823       for(i = 0; i < boxbuf[area].nfit; i++)
     842      for(i = 0; i < ABS(boxbuf[area].nfit); i++)
    824843      {
    825844         if((result = read_fit(hu, table, data, fit_table_row,
     
    836855         {
    837856            fprintf(stderr,
    838                     "error: Fit in table row %d does not match current area "
     857                    "\rerror: Fit in table row %d does not match current area "
    839858                    "(table cell=%d cx=%d cy=%d vs. area cell=%d cx=%d cy=%d)\n",
    840859                    fit_table_row,
     
    891910   {
    892911      fprintf(stderr,
    893               "error: unable to create header structure for FITS file \"%s\"\n",
     912              "\rerror: unable to create header structure for FITS file \"%s\"\n",
    894913              filename);
    895914      return FH_NO_MEMORY;
     
    899918   if ((result = fh_file(phu, filename, FH_FILE_RDONLY)) != FH_SUCCESS)
    900919   {
    901       fprintf(stderr,
    902               "error: unable to open FITS file \"%s\"\n",
     920      fprintf(stderr, "\rerror: unable to open FITS file \"%s\"\n",
    903921              filename);
    904922      fh_destroy(phu);
     
    911929   if(!area_hu || !fit_hu)
    912930   {
    913       fprintf(stderr,
    914               "error: Unable to find persistence info in FITS file.\n");
     931      fprintf(stderr, "\rerror: Unable to find persistence info in FITS file.\n");
    915932      fh_destroy(phu);
    916933      return FH_NOT_FOUND;
     
    926943      free(fit_table.strbuf);
    927944      fh_destroy(phu);
     945      fprintf(stderr, "\rerror: Unable to read area table from FITS file.\n");
    928946      return result;
    929947   }
     
    935953      free(fit_table.strbuf);
    936954      fh_destroy(phu);
     955      fprintf(stderr, "\rerror: Unable to read fit table from FITS file.\n");
    937956      return result;
    938957   }
     
    961980      for(k=0; k<MAXCELL; k++) {
    962981         if( (i=cell[k].npersist) > 0) {
    963             cell[k].persist = (OBJBOX *)calloc(i, sizeof(OBJBOX));
     982            if( (cell[k].persist = (OBJBOX *)calloc(i, sizeof(OBJBOX))) == NULL) {
     983               fprintf(stderr, "\rerror: failed to alloc cell persist buffer\n");
     984               exit(-672);
     985            }
    964986            cell[k].npersist = 0;
    965987         }
     
    10181040   {
    10191041      fprintf(stderr,
    1020               "error: Unable to write correction info to FITS file. Correction FITS tables already exist.\n");
     1042              "\rerror: Unable to write correction info to FITS file. Correction FITS tables already exist.\n");
    10211043      return FH_NO_SPACE;
    10221044   }
     
    10251047   if ((fd = fh_file_desc(phu)) == -1)
    10261048   {
    1027       fprintf(stderr, "error: header passed has no associated file.\n");
     1049      fprintf(stderr, "\rerror: header passed has no associated file.\n");
    10281050      return FH_INVALID;
    10291051   }
     
    10331055   {
    10341056      fprintf(stderr,
    1035               "error: Unable to seek to end of file.\n");
     1057              "\rerror: Unable to seek to end of file.\n");
    10361058      return FH_IN_ERRNO;
    10371059   }
     
    10421064   {
    10431065      fprintf(stderr,
    1044               "error: Unable to create headers for correction FITS tables.\n");
     1066              "\rerror: Unable to create headers for correction FITS tables.\n");
    10451067      if(area_hu) fh_destroy(area_hu);
    10461068      if(fit_hu) fh_destroy(fit_hu);
     
    10661088      (fh_munmap_table(area_hu) != FH_SUCCESS))
    10671089   {
    1068       fprintf(stderr, "error: Error encountered writing area table to FITS file.\n");
     1090      fprintf(stderr, "\rerror: Error encountered writing area table to FITS file.\n");
    10691091      fh_destroy(fit_hu);
    10701092      free(area_table.strbuf);
     
    10871109      (fh_munmap_table(fit_hu) != FH_SUCCESS))
    10881110   {
    1089       fprintf(stderr, "error: Error encountered writing area table to FITS file.\n");
     1111      fprintf(stderr, "\rerror: Error encountered writing area table to FITS file.\n");
    10901112      free(area_table.strbuf);
    10911113      free(fit_table.strbuf);
     
    11491171   if(fh_get_int(phu_in, "NEXTEND", &num_extensions) != FH_SUCCESS)
    11501172   {
    1151       fprintf(stderr, "error: Unable to get NEXTEND from input primary FITS header.\n");
     1173      fprintf(stderr, "\rerror: Unable to get NEXTEND from input primary FITS header.\n");
    11521174      return FH_INVALID;
    11531175   }
     
    11571179   {
    11581180      fprintf(stderr,
    1159               "error: Unable to find persistence info in FITS file.\n");
     1181              "\rerror: Unable to find persistence info in FITS file.\n");
    11601182      return FH_INVALID;
    11611183   }
     
    11751197   if((fd_out = open(fileout, O_CREAT | O_RDWR, 0644)) < 0)
    11761198   {
    1177       fprintf(stderr, "error: Failed to open \"%s\" for output.\n",
     1199      fprintf(stderr, "\rerror: Failed to open \"%s\" for output.\n",
    11781200              fileout);
    11791201      exit(EXIT_FAILURE);
     
    11921214      (fh_write(phu_out, fd_out) != FH_SUCCESS))
    11931215   {
    1194       fprintf(stderr, "error: Unable to copy primary header to \"%s\"\n",
     1216      fprintf(stderr, "\rerror: Unable to copy primary header to \"%s\"\n",
    11951217              fileout);
    11961218      fh_destroy(phu_out);
     
    12091231      if(!(ehu_in = fh_ehu(phu_in, i)))
    12101232      {
    1211          fprintf(stderr, "error: Unable to read extension %d from input FITS file\n", i);
     1233         fprintf(stderr, "\rerror: Unable to read extension %d from input FITS file\n", i);
    12121234         fh_destroy(phu_out);
    12131235         close(fd_out);
     
    12171239      if (fh_get_str(ehu_in, "EXTNAME", extname, sizeof(extname)) != FH_SUCCESS)
    12181240      {
    1219          fprintf(stderr, "error: Unable to get EXTNAME from extension %d in input FITS file.\n", i);
     1241         fprintf(stderr, "\rerror: Unable to get EXTNAME from extension %d in input FITS file.\n", i);
    12201242         fh_destroy(phu_out);
    12211243         close(fd_out);
     
    12331255            (fh_reserve(ehu_out, (2880/80)) != FH_SUCCESS))
    12341256         {
    1235             fprintf(stderr, "error: Unable to copy extension %d to %s.\n", i, fileout);
     1257            fprintf(stderr, "\rerror: Unable to copy extension %d to %s.\n", i, fileout);
    12361258            fh_destroy(phu_out);
    12371259            close(fd_out);
     
    12481270            (fh_copy_padded_image(ehu_out, fd_out, fh_file_desc(ehu_in)) != FH_SUCCESS))
    12491271         {
    1250             fprintf(stderr, "error: Unable to copy extension %d to %s.\n", i, fileout);
     1272            fprintf(stderr, "\rerror: Unable to copy extension %d to %s.\n", i, fileout);
    12511273            fh_destroy(phu_out);
    12521274            close(fd_out);
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/persistio.c

    r25299 r26764  
    5151             &boxbuf[nbox].slope, &boxbuf[nbox].nfit,
    5252             &boxbuf[nbox].sxfit, &boxbuf[nbox].exfit);
    53       if(boxbuf[nbox].nfit > 0) {
    54          boxbuf[nbox].zero = (double *)calloc(boxbuf[nbox].nfit, sizeof(double));
    55          boxbuf[nbox].xfit = (int *)calloc(boxbuf[nbox].nfit, sizeof(int));
    56          boxbuf[nbox].yfit = (int *)calloc(boxbuf[nbox].nfit, sizeof(int));
    57          for(i=0; i<boxbuf[nbox].nfit; i++) {
     53      if(ABS(boxbuf[nbox].nfit) > 0) {
     54         boxbuf[nbox].zero = (double *)calloc(ABS(boxbuf[nbox].nfit), sizeof(double));
     55         boxbuf[nbox].xfit = (int *)calloc(ABS(boxbuf[nbox].nfit), sizeof(int));
     56         boxbuf[nbox].yfit = (int *)calloc(ABS(boxbuf[nbox].nfit), sizeof(int));
     57         if(boxbuf[nbox].zero == NULL ||
     58            boxbuf[nbox].xfit == NULL ||
     59            boxbuf[nbox].yfit == NULL) {
     60            fprintf(stderr, "\rerror: failed to alloc boxbuf\n");
     61            exit(-673);
     62         }
     63
     64         for(i=0; i<ABS(boxbuf[nbox].nfit); i++) {
    5865            if(fgets(line, 1024, fp) == NULL) {
    5966               fprintf(stderr, "\rerror: short read of burn lines\n");
     
    8592   for(k=0; k<MAXCELL; k++) {
    8693      if( (i=cell[k].npersist) > 0) {
    87          cell[k].persist = (OBJBOX *)calloc(i, sizeof(OBJBOX));
     94         if( (cell[k].persist = (OBJBOX *)calloc(i, sizeof(OBJBOX))) == NULL) {
     95            fprintf(stderr, "\rerror: failed to alloc cell persist buffer\n");
     96            exit(-674);
     97         }
    8898         cell[k].npersist = 0;
    8999      }
     
    149159         k = boxid[kp];
    150160         zk = 0.0;
    151          if(box[k].nfit > 0) zk = box[k].zero[box[k].nfit/2];
     161         if(ABS(box[k].nfit) > 0) zk = box[k].zero[ABS(box[k].nfit)/2];
    152162         for(jp=kp+1; jp<n; jp++) {
    153163            j = boxid[jp];
    154164            zj = 0.0;
    155             if(box[j].nfit > 0) zj = box[j].zero[box[j].nfit/2];
     165            if(ABS(box[j].nfit) > 0) zj = box[j].zero[ABS(box[j].nfit)/2];
    156166            if(ABS(yctr[jp]-yctr[kp]) > DIFFERENT_STREAK) {
    157167/* Trim back the feebler streak */
     
    242252      for(k=0; k<cell[j].npersist; k++) {
    243253
     254/* Retire old burns */
     255         if(cell[j].time - cell[j].persist[k].time > EXPIRE_TRAIL_TIME)
     256            continue;
     257
    244258         if(PERSIST_RETAIN) {
    245259/* Keep fits which have a dubious slope */
     
    265279                 cell[j].persist[k].slope, cell[j].persist[k].nfit,
    266280                 cell[j].persist[k].sxfit, cell[j].persist[k].exfit);
    267          for(i=0; i<cell[j].persist[k].nfit; i++) {
     281         for(i=0; i<ABS(cell[j].persist[k].nfit); i++) {
    268282            fprintf(fp, "%3d %3d %8.4f\n", cell[j].persist[k].xfit[i],
    269283                    cell[j].persist[k].yfit[i], cell[j].persist[k].zero[i]);
     
    301315                 cell[j].burn[k].slope, cell[j].burn[k].nfit,
    302316                 cell[j].burn[k].sxfit, cell[j].burn[k].exfit);
    303          for(i=0; i<cell[j].burn[k].nfit; i++) {
     317         for(i=0; i<ABS(cell[j].burn[k].nfit); i++) {
    304318            fprintf(fp, "%3d %3d %8.4f\n", cell[j].burn[k].xfit[i],
    305319                    cell[j].burn[k].yfit[i], cell[j].burn[k].zero[i]);
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/psfstamp.c

    r25438 r26764  
    112112
    113113/* Make a postage stamp for it */
    114       box[k].stamp = (IMTYPE *)calloc(size*size, sizeof(IMTYPE));
     114      if( (box[k].stamp = (IMTYPE *)calloc(size*size, sizeof(IMTYPE))) == NULL) {
     115         fprintf(stderr, "\rerror: failed to stamp buffer\n");
     116         exit(-675);
     117      }
     118
    115119      sum = 0;
    116120      for(j=y0; j<=y1; j++) {
     
    136140   int i, k, l, nstar, fdout, otacx, otacy, xid, yid, ntot=0, sumax;
    137141   int cellcount, ota_xid, ota_yid;
    138    double scale, phi, fwhm[3], q[5], qt, xfp, yfp, pi=4*atan(1.0);
     142   double scale, phi, fwhm[3], q[7], qt, xfp, yfp, pi=4*atan(1.0);
    139143   IMTYPE *median_image;
    140144   CELL *cell;
     
    171175
    172176/* Create a median image and write as the first one */
    173    median_image = (IMTYPE *)calloc(nx*ny, sizeof(IMTYPE));
     177   if( (median_image = (IMTYPE *)calloc(nx*ny, sizeof(IMTYPE))) == NULL) {
     178      fprintf(stderr, "\rerror: failed to alloc median PSF image\n");
     179      exit(-676);
     180   }
    174181   for(i=0; i<nx*ny; i++) {
    175182      nstar = 0;
     
    256263   int k, l, cellx, celly, ota_xid, ota_yid, nfwave, nqavg;
    257264   double xota, yota, xfp, yfp, phi;
    258    double fwhm[3], q[5], fw[MAXPSFMEDIAN];
     265   double fwhm[3], q[7], fw[MAXPSFMEDIAN];
    259266   double m2[MAXPSFMEDIAN], qp[MAXPSFMEDIAN], qc[MAXPSFMEDIAN];
    260267   double qt[MAXPSFMEDIAN], fwavg[MAXPSFMEDIAN];
     268   double qpavg[MAXPSFMEDIAN], qcavg[MAXPSFMEDIAN], qtavg[MAXPSFMEDIAN];
    261269   double q3c[MAXPSFMEDIAN], q3s[MAXPSFMEDIAN];
    262    double qpavg[MAXPSFMEDIAN], qcavg[MAXPSFMEDIAN], qtavg[MAXPSFMEDIAN];
    263270   double q3cavg[MAXPSFMEDIAN], q3savg[MAXPSFMEDIAN];
     271   double q1c[MAXPSFMEDIAN], q1s[MAXPSFMEDIAN];
     272   double q1cavg[MAXPSFMEDIAN], q1savg[MAXPSFMEDIAN];
    264273   int nstar[MAXCELL], nfw[MAXCELL];
    265274   double fwmed[MAXCELL], m2med[MAXCELL];
    266275   double qpmed[MAXCELL], qcmed[MAXCELL], qtmed[MAXCELL];
    267276   double q3cmed[MAXCELL], q3smed[MAXCELL];
    268    double qpmacro, qcmacro, qtmacro, fwmacro, q3cmacro, q3smacro;
     277   double q1cmed[MAXCELL], q1smed[MAXCELL];
     278   double qpmacro, qcmacro, qtmacro, fwmacro, q3cmacro, q3smacro, q1cmacro, q1smacro;
    269279   FILE *fp;
    270280   CELL *cell;
     
    310320                     q3c[nstar[k]] = q[3];
    311321                     q3s[nstar[k]] = q[4];
     322                     q1c[nstar[k]] = q[5];
     323                     q1s[nstar[k]] = q[6];
    312324/* Get the position in the focal plane and therefore the qt statistic */
    313325                     psc_cell_to_pixel(cellx, celly, 0.5*PSC_HCELL/PSC_PIXEL,
     
    333345                  q3cmed[k] = double_median(nstar[k], q3c);
    334346                  q3smed[k] = double_median(nstar[k], q3s);
     347                  q1cmed[k] = double_median(nstar[k], q1c);
     348                  q1smed[k] = double_median(nstar[k], q1s);
    335349               } else {
    336350                  m2med[k] = qpmed[k] = qcmed[k] = qtmed[k] = -99.99;
    337351                  q3cmed[k] = q3smed[k] = -99.99;
     352                  q1cmed[k] = q1smed[k] = -99.99;
    338353               }
    339354/* Toss these results into the macrocell median hopper */
     
    348363                     q3cavg[nqavg] = q3c[l];
    349364                     q3savg[nqavg] = q3s[l];
     365                     q1cavg[nqavg] = q1c[l];
     366                     q1savg[nqavg] = q1s[l];
    350367                     nqavg++;
    351368                  }
     
    359376         q3cmacro = double_median(nqavg, q3cavg);
    360377         q3smacro = double_median(nqavg, q3savg);
    361          if(nqavg == 0) qpmacro = qcmacro = qtmacro = q3cmacro = q3smacro = -99.99;
     378         q1cmacro = double_median(nqavg, q1cavg);
     379         q1smacro = double_median(nqavg, q1savg);
     380         if(nqavg == 0) qpmacro = qcmacro = qtmacro = q3cmacro = q3smacro = q1cmacro = q1smacro = -99.99;
    362381         fwmacro = double_median(nfwave, fwavg);
    363382
     
    370389               cell = ota + k;
    371390
    372                fprintf(fp, "ext=xy%1d%1d bias=%d sky=%d rmssky=%d npsf=%d fwhm=%.2f fwmed=%.2f m2=%.2f qp=%.3f qc=%.3f qt=%.3f q3c=%.3f q3s=%.3f qpm=%.3f qcm=%.3f qtm=%.3f q3cm=%.3f q3sm=%.3f\n",
     391               fprintf(fp, "ext=xy%1d%1d bias=%d sky=%d rmssky=%d npsf=%d fwhm=%.2f fwmed=%.2f m2=%.2f qp=%.3f qc=%.3f qt=%.3f q3c=%.3f q3s=%.3f q1c=%.3f q1s=%.3f qpm=%.3f qcm=%.3f qtm=%.3f q3cm=%.3f q3sm=%.3f q1cm=%.3f q1sm=%.3f\n",
    373392                       cellx, celly, cell->bias, cell->sky, cell->rms,
    374393                       nstar[k], fwmed[k], fwmacro, m2med[k],
    375                        qpmed[k], qcmed[k], qtmed[k], q3cmed[k], q3smed[k],
    376                        qpmacro, qcmacro, qtmacro, q3cmacro, q3smacro);
     394                       qpmed[k], qcmed[k], qtmed[k], q3cmed[k], q3smed[k],
     395                       q1cmed[k], q1smed[k],
     396                       qpmacro, qcmacro, qtmacro, q3cmacro, q3smacro,
     397                       q1cmacro, q1smacro);
    377398            }
    378399         }
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/stardetect.c

    r25070 r26764  
    193193   cell->burn = (OBJBOX *)calloc(cell->nburn, sizeof(OBJBOX));
    194194   cell->star = (OBJBOX *)calloc(cell->nstar, sizeof(OBJBOX));
     195   if( cell->burn == NULL || cell->star == NULL) {
     196      fprintf(stderr, "\rerror: failed to alloc burn box\n");
     197      exit(-678);
     198   }
    195199
    196200/* Copy the boxes to the cell info structure */
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/burntool/trailfit.c

    r25299 r26764  
    137137   box->xfit = (int *)calloc(xe-xs+1, sizeof(int));
    138138   box->yfit = (int *)calloc(xe-xs+1, sizeof(int));
     139   if(box->zero == NULL || box->xfit == NULL || box->yfit == NULL) {
     140      fprintf(stderr, "\rerror: failed to alloc box memory\n");
     141      exit(-679);
     142   }
    139143/* Some defaults */
    140144   box->slope = 0.0;
     
    226230/* FIXME: sanity check fits */
    227231   if(slope >= FIT_MAX_SLOPE || slope < FIT_MIN_SLOPE) {
     232/* Check whether it's a significant trail (but with wrong slope) or just
     233 * noise.  In the former case negate box->nfit,
     234 * in the latter case set it to zero. */
     235      linearrms(nfit, ybuf+y1, zbuf+y1, slope, zero, &trial);
    228236      box->slope = slope;
    229       box->nfit = 0;
     237      if(trial > 2*rms) box->nfit = -box->nfit;
     238      else box->nfit = 0;
    230239      box->fiterr = FIT_SLOPE_ERROR;
    231240      return(-1);
     
    268277/* FIXME: what's a really good criterion for negligible fit? */
    269278/* 100 pixels up fit is zsum or ~zsum/e */
    270       if(zsum > NEGLIGIBLE_TRAIL*rms) {
     279//      if(zsum > NEGLIGIBLE_TRAIL*rms) {
     280      if(zsum > NEGLIGIBLE_TRAIL*rms ||
     281/* 100113: but also evaluate at the end of the fit for stubby trails */
     282         zbuf[y2]*zsum > NEGLIGIBLE_TRAIL*rms) {
    271283
    272284/* Ascertain the starting point of where the fit is good */
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/libfhreg/general.h

    r23490 r26764  
    7979MK_PFL( 10.0,   BZERO   ,1, "Zero factor"                                     )
    8080MK_PFL( 11.0,   BSCALE  ,1, "Scale factor"                                    )
     81MK_STR( 12.0,   BUNIT   ,   "fits-data * BSCALE + BZERO = these units"        )
    8182
    8283/*
     
    9091MK_CMT(   50.5, CMTSUM5 ,   ""                                                )
    9192MK_STR(   51.0, CMMTOBS ,   ""                                                )
     93MK_STR(   51.1, CMMTOBS1,   ""                                                )
     94MK_STR(   51.2, CMMTOBS2,   ""                                                )
     95MK_STR(   51.3, CMMTOBS3,   ""                                                )
     96MK_STR(   51.4, CMMTOBS4,   ""                                                )
     97MK_STR(   51.5, CMMTOBS5,   ""                                                )
     98MK_STR(   51.6, CMMTOBS6,   ""                                                )
     99MK_STR(   51.7, CMMTOBS7,   ""                                                )
     100MK_STR(   51.8, CMMTOBS8,   ""                                                )
     101MK_STR(   51.9, CMMTOBS9,   ""                                                )
    92102MK_STR(   52.0, CMMTSEQ ,   ""                                                )
    93103MK_STR(   53.0, OBJECT  ,   ""                                                )
     
    127137
    128138MK_STR(   95.0, OBSTYPE,    "Observation/Exposure type"                       )
    129 MK_PFL(   96.0, EXPTIME,3,  "Exposure time (seconds)"                         )
    130 MK_PFL(   96.1, EXPREQ ,3,  "Exposure time requested (seconds)"               )
    131 MK_PFL(   97.0, DARKTIME,3, "Dark current time (seconds)"                     )
     139MK_PFL(   96.0, EXPTIME,3,  "[sec] Exposure time"                             )
     140MK_PFL(   96.1, EXPREQ ,3,  "[sec] Exposure time requested"                   )
     141MK_PFL(   97.0, DARKTIME,3, "[sec] Dark current time"                         )
     142MK_INT(   97.5,  PONTIME,   "[sec] Time since last detector \"power on\""     )
     143MK_INT(   97.6,  SATTIME,   "[sec] Time since last detected saturation event" )
     144MK_INT(   97.7,  TRKTIME,   "[sec] Time since last detected tracking error"   )
     145MK_INT(   97.8,  VDOTIME,   "[sec] Time since \"video\" command used"         )
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/libfhreg/gpc_all.h

    r23490 r26764  
    2020#include "gpc_wcs.h"
    2121#include "gpc_plant.h"
     22#include "gpc_postprocess.h"
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/libfhreg/gpc_detector.h

    r23490 r26764  
    6969MK_INT(  152.1, SATURATE,   "[ADU] Saturation value"                          )
    7070MK_FLT(  155.0, GAIN    ,3, "[e/ADU] est. gain from xray"                     )
    71 MK_FLT(  155.9, XRNOISE, 2, "[ADU] RMS noise in overscan on xray"             )
    72 MK_FLT(  156.0, RDNOISE ,2, "[ADU] RMS Read noise on overscan"                )
     71MK_FLT(  155.9, XRNOISE, 3, "[e] RMS noise in overscan on xray"               )
     72MK_FLT(  156.0, RDNOISE ,3, "[e] Read noise"                                  )
    7373MK_FLT(  157.0, DCURRENT,5, "[ADU/pixel/sec] Dark current"                    )
    7474MK_FLT(  157.1, DARKCUR ,5, "[e-/pixel/hour] Dark current"                    )
    7575MK_STR(  158.0, QEPOINTS,   "QE%@wavelength in nm"                            )
    7676MK_INT(  159.0, BIASLVL,    "[ADU] Bias level (overscan mean)"                )
    77 MK_INT(  159.2, BACKEST,    "[ADU] Background level est., overscan corrected" )
     77MK_INT(  159.2, BACKEST,    "[ADU] Background level estimation"              )
    7878MK_STR(  165.0, DETSTAT ,   "Detector status"                                 )
    7979MK_FLT(  166.0, DETTEM  ,3, "[C] Detector temperature"                        )
     80MK_CMT(  166.1, CMTDETT1,   "If DETTEMOV is T, DETTEMP was overridden. Old"   )
     81MK_CMT(  166.2, CMTDETT2,   "temp. is CDETTEM and new temp. was derived as:"  )
     82MK_CMT(  166.3, CMTDETT3,   "V = (ADU-B) / (A*32768)"                         )
     83MK_CMT(  166.4, CMTDETT4,   "T = 3369-sqrt[3369^2+1313^2*(13.1*V-1)/(V-1)]"   )
     84MK_BLN(  166.5, DETTEMOV,   "Detector temperature overridden"                 )
     85MK_INT(  166.6, DETTEADU,   "[ADU] Detector temperature A/D measurement"      )
     86MK_PFL(  166.7, DETTCOFA,3, "Coefficient A used in overriding detector temp." )
     87MK_INT(  166.8, DETTCOFB,   "Coefficient B used in overriding detector temp." )
     88MK_FLT(  166.9, CDETTEM ,3, "[C] Detector temperature calc. by controller"    )
    8089MK_PFL(  170.0, PIXSIZE ,3, "[um] Pixel size for both axes"                   )
    8190MK_PFL(  171.1, PIXSIZE1,3, "[um] Pixel size for axis 1"                      )
     
    105114MK_INT(  185.2, CCDBIN2 ,   "Binning factor along axis 2"                     )
    106115MK_INT(  186.1, PRESCAN1,   "Prescan count on axis 1"                         )
     116MK_INT(  186.11,PRESCANX,   "Post-xtrig-bias portion of prescan1"             )
    107117MK_INT(  186.2, PRESCAN2,   "Prescan count on axis 2"                         )
    108118MK_INT(  187.1, OVRSCAN1,   "Overscan count on axis 1"                        )
     
    144154MK_INT(  198.07,CON_UP,     "[seconds] Controller up-time"                    )
    145155MK_STR(  198.08,CON_VSUM,   "Device operating point md5sum"                   )
     156MK_INT(  198.10,FPGASER,    "Controller FPGA board serial number"             )
     157MK_STR(  198.11,FPGAVER,    "Controller FPGA board version"                   )
     158MK_STR(  198.12,FPGATAR,    "Controller FPGA board target system"             )
     159MK_STR(  198.13,FPGAEC,     "Controller FPGA board engineering changes"       )
     160MK_INT(  198.20,DAQ3USER,   "Controller DAQ3U board serial number"            )
     161MK_STR(  198.21,DAQ3UVER,   "Controller DAQ3U board version"                  )
     162MK_STR(  198.22,DAQ3UTAR,   "Controller DAQ3U board target system"            )
     163MK_STR(  198.23,DAQ3UEC,    "Controller DAQ3U board engineering changes"      )
     164MK_INT(  198.20,PREAMSER,   "Controller Preamp board serial number"           )
     165MK_STR(  198.21,PREAMVER,   "Controller Preamp board version"                 )
     166MK_STR(  198.22,PREAMTAR,   "Controller Preamp board target system"           )
     167MK_STR(  198.23,PREAMEC,    "Controller Preamp board engineering changes"     )
     168MK_INT(  198.30,DAQLBSER,   "DAQ3U loopback test board serial number"         )
     169MK_STR(  198.31,DAQLBVER,   "DAQ3U loopback test board version"               )
     170MK_STR(  198.32,DAQLBTAR,   "DAQ3U loopback test board target system"         )
     171MK_STR(  198.33,DAQLBEC,    "DAQ3U loopback test board engineering changes"   )
    146172MK_INT(  198.40,TSP_SHOP,   "Milliseconds from last clean to shutter open"    )
    147173MK_INT(  198.41,TSP_SHCL,   "Milliseconds from last clean to shutter close"   )
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/libfhreg/gpc_instrument.h

    r23490 r26764  
    6363MK_PFL( 1009.11,L3AIRTMP,1, "[C] Air temperature in space above L3"           )
    6464MK_PFL( 1009.12,L3DEWPT, 1, "[C] Calculated dew point in space above L3"      )
     65MK_PFL( 1009.20,ENHUMID, 1, "[%] Rel. humidity of cam. evironment (ferit)"    )
     66MK_PFL( 1009.21,ENAIRTMP,1, "[C] Air temperature of camera environment"       )
     67MK_PFL( 1009.22,ENDEWPT, 1, "[C] Calculated dew point of camera environment"  )
     68MK_STR( 1009.30,GLYSTAT,    "Camera heat exchanger glycol status"             )
     69MK_STR( 1009.31,GLYMODE,    "Camera heat exchanger glycol mode"               )
    6570MK_STR( 1010.0, FILTSTAT,   "Filter mechanism status"                         )
    6671MK_STR( 1010.1, FILTERID,   "Filter glass identification"                     )
     
    8085MK_INT( 1224.0, SH_ARMPN  , "motion controller input pins"                    )
    8186MK_PFL( 1225.0, SH_DIODE,1, "Vref/4096 (Vref=5V nominal) photodiode volts"    )
     87MK_STR( 1260.1, CS_LIGHT,   "Cal screen laser status during exposure"         )
     88MK_STR( 1261.0, CS_LIMIT,   "Cal screen laser exposure limit: time|volt"      )
     89MK_PFL( 1262.0, CS_WAVE,1,  "Cal screen laser wavelength"                     )
     90MK_PFL( 1263.0, CS_EXPT,1,  "Cal screen laser exposure time"                  )
     91MK_PFL( 1264.0, CS_VOLTS,3, "Cal screen laser photodiode limit voltage"       )
     92MK_PFL( 1265.1, CS_INTV1,3, "Cal screen photodiode integrator pre-voltage"    )
     93MK_PFL( 1265.2, CS_INTV2,3, "Cal screen photodiode integrator start-voltage"  )
     94MK_PFL( 1265.3, CS_INTV3,3, "Cal screen photodiode integrator stop-voltage"   )
     95MK_PFL( 1265.4, CS_INTV4,3, "Cal screen photodiode integrator post-voltage"   )
     96MK_PFL( 1266.1, CS_INTT1,3, "Cal screen photodiode integrator pre-seconds"    )
     97MK_PFL( 1266.2, CS_INTT2,3, "Cal screen photodiode integrator exposure sec"   )
     98MK_PFL( 1266.3, CS_INTT3,3, "Cal screen photodiode integrator post-seconds"   )
     99MK_PFL( 1267.0, CS_SHOP,3,  "GPC1 shutter open start"                         )
     100MK_PFL( 1268.0, CS_SHCL,3,  "GPC1 shutter close start"                        )
     101
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/libfhreg/gpc_shutter.h

    r23490 r26764  
    5757MK_STR(  201.0, SHUTSTAT,   "Shutter status"                                  )
    5858MK_STR(  201.1, SHUTERR,    "Shutter error code"                              )
    59 MK_STR(  202.00,SHUTOPEN,   "Shutter open time (TAI)"                         )
    60 MK_STR(  202.01,SHUTCLOS,   "Shutter close time (TAI)"                        )
    61 MK_PFL(  202.02,SHUTOPWN,6, "Shutter open uncertainty before SHUTOPEN (sec)"  )
    62 MK_PFL(  202.03,SHUTCLWN,6, "Shutter close uncertainty before SHUTCLOS (sec)" )
    63 MK_STR(  202.04,SHUTOUTC,   "Shutter open time (UTC)"                         )
    64 MK_STR(  202.05,SHUTCUTC,   "Shutter close time (UTC)"                        )
    65 MK_INT(  202.06,SHUTLEAP,   "Leap seconds used in TAI-UTC conversion (sec)"   )
    66 MK_PFL(  202.07,SHUTREQ, 6, "Requested exposure duration (sec)"               )
    67 MK_PFL(  202.08,SHUTTIME,6, "Actual exposure duration (sec)"                  )
     59MK_STR(  202.00,SHUTOPEN,   "[TAI date time] Shutter open time"               )
     60MK_STR(  202.01,SHUTCLOS,   "[TAI date time] Shutter close time"              )
     61MK_PFL(  202.02,SHUTOPWN,6, "[sec] Shutter open uncertainty before SHUTOPEN"  )
     62MK_PFL(  202.03,SHUTCLWN,6, "[sec] Shutter close uncertainty before SHUTCLOS" )
     63MK_STR(  202.04,SHUTOUTC,   "[UTC date time] Shutter open time"               )
     64MK_STR(  202.05,SHUTCUTC,   "[UTC date time] Shutter close time"              )
     65MK_INT(  202.06,SHUTLEAP,   "[sec] Leap seconds used in TAI-UTC conversion"   )
     66MK_PFL(  202.07,SHUTREQ, 6, "[sec] Requested exposure duration"               )
     67MK_PFL(  202.08,SHUTTIME,6, "[sec] Actual exposure duration"                  )
    6868MK_STR(  202.09,SHUTOPBL,   "Shutter blade in aperture at start of exposure"  )
    6969MK_STR(  202.10,SHUTCLBL,   "Shutter blade in aperture at end of exposure"    )
  • branches/eam_branches/20091201/extsrc/gpcsw/gpcsrc/fits/libfhreg/gpc_telescope.h

    r24391 r26764  
    7070MK_STR(  503.0, TELSTAT ,   "Telescope control system status"                 )
    7171MK_STR(  503.1, DOMSTAT ,   "Telescope enclosure status"                      )
    72 MK_STR(  503.2, GUISTAT ,   "Telescope guiding system status"                 )
    73 MK_STR(  503.3, GUICONF ,   "Telescope guiding configuration"                 )
    74 MK_STR(  503.4, GUIKERN ,   "Filter kernel used for guiding"                  )
    75 MK_PFL(  503.5, GUIGAIX ,2, "Telescope guiding gain factor (x offset)"        )
    76 MK_PFL(  503.6, GUIGAIY ,2, "Telescope guiding gain factor (y offset)"        )
    77 MK_PFL(  503.7, GUIRATE ,1, "Telescope guiding rate (Hz)"                     )
    7872MK_VAL(  521.1, EQUINOX ,   "Telescope equinox of coordinates"                )
    7973MK_VAL(  521.2, EPOCH   ,   "Telescope equinox of coordinates"                )
    80 MK_PFL(  522.1, RA      ,6, "Telescope Right Ascension (degrees)"             )
    81 MK_PFL(  522.2, DEC     ,6, "Telescope Declination (degrees)"                 )
    82 MK_PFL(  522.3, AZ      ,6, "Telescope azimuth (degrees)"                     )
    83 MK_PFL(  522.4, ALT     ,6, "Telescope pointing altitude (degrees)"           )
    84 MK_PFL(  522.5, ROT     ,6, "Telescope rotator angle (degrees)"               )
    85 MK_PFL(  522.6, POSANGLE,6, "Telescope position angle (degrees)"              )
    86 MK_PFL(  523.0, COMRA   ,6, "Commanded telescope Right Ascension (degrees)"   )
    87 MK_PFL(  523.1, COMDEC  ,6, "Commanded telescope Declination (degrees)"       )
    88 MK_PFL(  523.2, COMAZ   ,6, "Commanded telescope azimuth (degrees)"           )
    89 MK_PFL(  523.3, COMALT  ,6, "Commanded telescope pointing altitude (degrees)" )
    90 MK_PFL(  523.4, COMROT  ,6, "Commanded telescope rotator angle (degrees)"     )
    91 MK_PFL(  523.5, MOONANG ,6, "Angular distance to moon (degrees)" )
     74MK_PFL(  522.1, RA      ,6, "[deg] Telescope FOV center Right Ascension"      )
     75MK_PFL(  522.2, DEC     ,6, "[deg] Telescope FOV center Declination"          )
     76MK_STR(  522.21,RASTRNG ,   "[deg:mm:ss] Telescope sexagesimal Right Ascen."  )
     77MK_STR(  522.22,DECSTRNG,   "[deg:mm:ss] Telescope sexagesimal Declination"   )
     78MK_PFL(  522.3, AZ      ,6, "[deg] Telescope azimuth"                         )
     79MK_PFL(  522.4, ALT     ,6, "[deg] Telescope pointing altitude"               )
     80MK_PFL(  522.5, ROT     ,6, "[deg] Telescope rotator angle"                   )
     81MK_PFL(  522.6, POSANGLE,6, "[deg] Telescope position angle"                  )
     82MK_PFL(  523.0, COMRA   ,6, "[deg] Commanded telescope Right Ascension"       )
     83MK_PFL(  523.1, COMDEC  ,6, "[deg] Commanded telescope Declination"           )
     84MK_PFL(  523.2, COMAZ   ,6, "[deg] Commanded telescope azimuth"               )
     85MK_PFL(  523.3, COMALT  ,6, "[deg] Commanded telescope pointing altitude"     )
     86MK_PFL(  523.4, COMROT  ,6, "[deg] Commanded telescope rotator angle"         )
     87MK_PFL(  523.5, MOONANG ,6, "[deg] Angular distance to moon"                  )
     88MK_PFL(  523.6, AIRMASS ,3, "Airmass at start of observation"                 )
    9289MK_CMT(  530.00,CMTTELO1,   "NOTE: Telescope RA DEC or ALT AZ already include")
    9390MK_CMT(  530.10,CMTTELO2,   "      the following offsets.  Do not re-apply!"  )
    94 MK_PFL(  532.1, TELOFRA ,6, "Telescope offset in RA (degrees)"                )
    95 MK_PFL(  532.2, TELOFDEC,6, "Telescope offset in DEC (degrees)"               )
    96 MK_PFL(  532.3, TELOFAZ ,6, "Telescope offset in AZ (degrees)"                )
    97 MK_PFL(  532.4, TELOFALT,6, "Telescope offset in ALT (degrees)"               )
    98 MK_PFL(  532.5, TELOFROT,6, "Telescope offset in ROT (degrees)"               )
    99 MK_PFL(  532.7, TELOFX  ,6, "Telescope offset in camera X (degrees)"          )
    100 MK_PFL(  532.8, TELOFY  ,6, "Telescope offset in camera Y (degrees)"          )
    101 MK_PFL(  540.1, AIRMASS ,3, "Airmass at start of observation"                 )
    102 MK_PFL(  541.1, M1X     ,6, "Primary mirror x position (um)"                  )
    103 MK_PFL(  541.2, M1Y     ,6, "Primary mirror y position (um)"                  )
    104 MK_PFL(  541.3, M1Z     ,6, "Primary mirror z position (um)"                  )
    105 MK_PFL(  541.4, M1TIP   ,6, "Primary mirror tip (arcsec)"                     )
    106 MK_PFL(  541.5, M1TILT  ,6, "Primary mirror tilt (arcsec)"                    )
    107 MK_PFL(  542.1, M2X     ,6, "Secondary mirror x position (um)"                )
    108 MK_PFL(  542.2, M2Y     ,6, "Secondary mirror y position (um)"                )
    109 MK_PFL(  542.3, M2Z     ,6, "Secondary mirror z position (um)"                )
    110 MK_PFL(  542.4, M2TIP   ,6, "Secondary mirror tip (arcsec)"                   )
    111 MK_PFL(  542.5, M2TILT  ,6, "Secondary mirror tilt (arcsec)"                  )
     91MK_PFL(  532.1, TELOFRA ,6, "[deg] Telescope offset in RA"                    )
     92MK_PFL(  532.2, TELOFDEC,6, "[deg] Telescope offset in DEC"                   )
     93MK_PFL(  532.3, TELOFAZ ,6, "[deg] Telescope offset in AZ"                    )
     94MK_PFL(  532.4, TELOFALT,6, "[deg] Telescope offset in ALT"                   )
     95MK_PFL(  532.5, TELOFROT,6, "[deg] Telescope offset in ROT"                   )
     96MK_PFL(  532.7, TELOFX  ,6, "[deg] Telescope offset in camera X"              )
     97MK_PFL(  532.8, TELOFY  ,6, "[deg] Telescope offset in camera Y"              )
     98
     99/*
     100 * Guiding
     101 */
     102MK_STR(  540.00,GUISTAT ,   "Telescope guiding system status"                 )
     103MK_STR(  540.01,GUICONF ,   "Telescope guiding configuration"                 )
     104MK_STR(  540.02,GUISTAR ,   "Telescope guiding (single or multi-star)"        )
     105MK_BLN(  540.03,GUIROTEN,   "Telescope guiding rotation enabled"              )
     106MK_PFL(  540.10,GUIGAIX ,2, "Telescope guiding gain factor (x offset)"        )
     107MK_PFL(  540.11,GUIGAIY ,2, "Telescope guiding gain factor (y offset)"        )
     108MK_PFL(  540.12,GUIRATE ,1, "[Hz] Telescope guiding rate"                     )
     109MK_STR(  540.20,GUIKERN ,   "Filter kernel used for guiding"                  )
     110MK_STR(  540.21,GUIKERN1,   "Filter kernel used for guiding (cont)"           )
     111MK_STR(  540.22,GUIKERN2,   "Filter kernel used for guiding (cont)"           )
     112MK_STR(  540.23,GUIKERN3,   "Filter kernel used for guiding (cont)"           )
     113MK_STR(  540.24,GUIKERN4,   "Filter kernel used for guiding (cont)"           )
     114MK_STR(  540.25,GUIKERN5,   "Filter kernel used for guiding (cont)"           )
     115MK_STR(  540.26,GUIKERN6,   "Filter kernel used for guiding (cont)"           )
     116MK_STR(  540.27,GUIKERN7,   "Filter kernel used for guiding (cont)"           )
     117MK_STR(  540.28,GUIKERN8,   "Filter kernel used for guiding (cont)"           )
     118MK_STR(  540.29,GUIKERN9,   "Filter kernel used for guiding (cont)"           )
     119MK_INT(  540.30,GUIKLEN ,   "Number of taps in filter kernel"                 )
     120MK_INT(  540.31,GUIKSUM ,   "Sum of all filter kernel taps"                   )
     121MK_INT(  540.40,GUINSTAR,   "Number of guide stars sought"                    )
     122MK_INT(  540.41,GUINOK,     "Number of guide stars used (median)"             )
     123MK_INT(  540.42,GUIERR,     "90 percentile of guide fit error codes"          )
     124MK_PFL(  540.43,GUIDR,   2, "[arcsec] median RMS of guide star offsets"       )
     125MK_PFL(  540.50,GUIXMED, 2, "[arcsec] median x offset of guide stars"         )
     126MK_PFL(  540.51,GUIX50,  2, "[arcsec] 50% range of guide star x"              )
     127MK_PFL(  540.52,GUIX90,  2, "[arcsec] 90% range of guide star x"              )
     128MK_PFL(  540.60,GUIYMED, 2, "[arcsec] median y offset of guide stars"         )
     129MK_PFL(  540.61,GUIY50,  2, "[arcsec] 50% range of guide star y"              )
     130MK_PFL(  540.62,GUIY90,  2, "[arcsec] 90% range of guide star y"              )
     131MK_PFL(  540.70,GUIROT,  4, "[deg] median rotation offset of guide stars"     )
     132MK_PFL(  540.71,GUIROT50,4, "[deg] 50% range of rotation offset"              )
     133MK_PFL(  540.72,GUIROT90,4, "[deg] 90% range of rotation offset"              )
     134MK_PFL(  540.80,GUIFWMED,2, "[arcsec] median guide star FWHM"                 )
     135MK_PFL(  540.81,GUIFW50, 2, "[arcsec] 50% range of guide star FWHM"           )
     136MK_PFL(  540.82,GUIFW90, 2, "[arcsec] 90% range of guide star FWHM"           )
     137MK_PFL(  540.90,GUIM1MED,2, "[mag] median zeropoint"                          )
     138MK_PFL(  540.91,GUIM150, 2, "[mag] 50% range of median zeropoint"             )
     139MK_PFL(  540.92,GUIM190, 2, "[mag] 90% range of median zeropoint"             )
     140MK_PFL(  540.93,GUIXTNCT,2, "[mag] total extinction during exposure"          )
     141MK_PFL(  540.94,GUIZPRMS,2, "[mag] median RMS scatter of zeropoints"          )
     142
     143/*
     144 * Mirror info
     145 */
     146MK_PFL(  541.1, M1X     ,6, "[um] Primary mirror x position"                  )
     147MK_PFL(  541.2, M1Y     ,6, "[um] Primary mirror y position"                  )
     148MK_PFL(  541.3, M1Z     ,6, "[um] Primary mirror z position"                  )
     149MK_PFL(  541.4, M1TIP   ,6, "[arcsec] Primary mirror tip"                     )
     150MK_PFL(  541.5, M1TILT  ,6, "[arcsec] Primary mirror tilt"                    )
     151MK_PFL(  542.1, M2X     ,6, "[um] Secondary mirror x position"                )
     152MK_PFL(  542.2, M2Y     ,6, "[um] Secondary mirror y position"                )
     153MK_PFL(  542.3, M2Z     ,6, "[um] Secondary mirror z position"                )
     154MK_PFL(  542.4, M2TIP   ,6, "[arcsec] Secondary mirror tip"                   )
     155MK_PFL(  542.5, M2TILT  ,6, "[arcsec] Secondary mirror tilt"                  )
    112156MK_STR(  543.0, M1M2MODV,   "Telescope mirror position model version"         )
    113 MK_PFL(  543.1, M1NOMX  ,6, "Modeled Primary mirror x position (um)"          )
    114 MK_PFL(  543.2, M1NOMY  ,6, "Modeled Primary mirror y position (um)"          )
    115 MK_PFL(  543.3, M1NOMZ  ,6, "Modeled Primary mirror z position (um)"          )
    116 MK_PFL(  543.4, M1NOMTIP,6, "Modeled Primary mirror tip (arcsec)"             )
    117 MK_PFL(  543.5, M1NOMTIL,6, "Modeled Primary mirror tilt (arcsec)"            )
    118 MK_PFL(  544.1, M2NOMX  ,6, "Modeled Secondary mirror x position (um)"        )
    119 MK_PFL(  544.2, M2NOMY  ,6, "Modeled Secondary mirror y position (um)"        )
    120 MK_PFL(  544.3, M2NOMZ  ,6, "Modeled Secondary mirror z position (um)"        )
    121 MK_PFL(  544.4, M2NOMTIP,6, "Modeled Secondary mirror tip (arcsec)"           )
    122 MK_PFL(  544.5, M2NOMTIL,6, "Modeled Secondary mirror tilt (arcsec)"          )
    123 MK_STR(  550.1, TELTEMTR,   "Mid truss temperatures (C)"                      )
    124 MK_STR(  550.2, TELTEMSP,   "Spider temperatures (C)"                         )
    125 MK_STR(  550.3, TELTEMMS,   "Primary mirror support temps (C)"                )
    126 MK_STR(  550.4, TELTEMM1,   "Primary mirror temps (C)"                        )
    127 MK_STR(  550.5, TELTEMM2,   "Secondary mirror temps (C)"                      )
    128 MK_STR(  550.6, TELTEMEX,   "Miscellaneous temperatures (C)"                  )
     157MK_PFL(  543.1, M1NOMX  ,6, "[um] Modeled Primary mirror x position"          )
     158MK_PFL(  543.2, M1NOMY  ,6, "[um] Modeled Primary mirror y position"          )
     159MK_PFL(  543.3, M1NOMZ  ,6, "[um] Modeled Primary mirror z position"          )
     160MK_PFL(  543.4, M1NOMTIP,6, "[arcsec] Modeled Primary mirror tip"             )
     161MK_PFL(  543.5, M1NOMTIL,6, "[arcsec] Modeled Primary mirror tilt"            )
     162MK_PFL(  544.1, M2NOMX  ,6, "[um] Modeled Secondary mirror x position"        )
     163MK_PFL(  544.2, M2NOMY  ,6, "[um] Modeled Secondary mirror y position"        )
     164MK_PFL(  544.3, M2NOMZ  ,6, "[um] Modeled Secondary mirror z position"        )
     165MK_PFL(  544.4, M2NOMTIP,6, "[arcsec] Modeled Secondary mirror tip"           )
     166MK_PFL(  544.5, M2NOMTIL,6, "[arcsec] Modeled Secondary mirror tilt"          )
     167MK_STR(  550.1, TELTEMTR,   "[C] MTL 11,12,2,3,5,6,8,9"                       )
     168MK_STR(  550.2, TELTEMSP,   "[C] IS 10,1,4,7 O 10,1,4,7"                      )
     169MK_STR(  550.3, TELTEMMS,   "[C] M1 Perim. 12,3,6,9,Air"                      )
     170MK_STR(  550.4, TELTEMM1,   "[C] M1I 12,3,6,9 O12,3,6,9"                      )
     171MK_STR(  550.5, TELTEMM2,   "[C] M2 I 12,O 12,3,3,6,6,9,9"                    )
     172MK_STR(  550.6, TELTEMEX,   "[C] M2 Can Air,Surf,CentSec 12,3,6,9"            )
    129173
    130174/*
    131175 * Wavefront
    132176 */
    133 MK_PFL(  551.01,WVFA    ,14,"Wavefront A actuator force (N)"                  )
    134 MK_PFL(  551.02,WVFB    ,14,"Wavefront B actuator force (N)"                  )
    135 MK_PFL(  551.03,WVFC    ,14,"Wavefront C actuator force (N)"                  )
    136 MK_PFL(  551.04,WVFD    ,14,"Wavefront D actuator force (N)"                  )
    137 MK_PFL(  551.05,WVFE    ,14,"Wavefront E actuator force (N)"                  )
    138 MK_PFL(  551.06,WVFF    ,14,"Wavefront F actuator force (N)"                  )
    139 MK_PFL(  551.07,WVFG    ,14,"Wavefront G actuator force (N)"                  )
    140 MK_PFL(  551.08,WVFH    ,14,"Wavefront H actuator force (N)"                  )
    141 MK_PFL(  551.09,WVFI    ,14,"Wavefront I actuator force (N)"                  )
    142 MK_PFL(  551.10,WVFJ    ,14,"Wavefront J actuator force (N)"                  )
    143 MK_PFL(  551.11,WVFK    ,14,"Wavefront K actuator force (N)"                  )
    144 MK_PFL(  551.12,WVFL    ,14,"Wavefront L actuator force (N)"                  )
     177MK_PFL(  551.01,WVFA    ,14,"[N] Wavefront A actuator force"                  )
     178MK_PFL(  551.02,WVFB    ,14,"[N] Wavefront B actuator force"                  )
     179MK_PFL(  551.03,WVFC    ,14,"[N] Wavefront C actuator force"                  )
     180MK_PFL(  551.04,WVFD    ,14,"[N] Wavefront D actuator force"                  )
     181MK_PFL(  551.05,WVFE    ,14,"[N] Wavefront E actuator force"                  )
     182MK_PFL(  551.06,WVFF    ,14,"[N] Wavefront F actuator force"                  )
     183MK_PFL(  551.07,WVFG    ,14,"[N] Wavefront G actuator force"                  )
     184MK_PFL(  551.08,WVFH    ,14,"[N] Wavefront H actuator force"                  )
     185MK_PFL(  551.09,WVFI    ,14,"[N] Wavefront I actuator force"                  )
     186MK_PFL(  551.10,WVFJ    ,14,"[N] Wavefront J actuator force"                  )
     187MK_PFL(  551.11,WVFK    ,14,"[N] Wavefront K actuator force"                  )
     188MK_PFL(  551.12,WVFL    ,14,"[N] Wavefront L actuator force"                  )
    145189
    146190/*
     
    151195MK_PFL(  560.3, ENVWIN,  1, "[m/s]         Weather, wind speed"               )
    152196MK_PFL(  560.4, ENVDIR,  1, "[deg E. of N] Weather, wind direction"           )
    153 MK_PFL(  561.0, SEEING,  1, "[arcsec]      Weather, seeing from DIMM, FWHM"   )
     197MK_PFL(  561.0, SEEING,  3, "[arcsec]      Weather, seeing from DIMM, FWHM"   )
    154198
    155199/*
     
    157201 *
    158202 *TYPE --IDX--  KEYWORD- PRC -------------------COMMENT----------------------*/
    159 MK_PFL( 586.02, HA      ,16,"Hour angle at start (degrees)"                   )
    160 MK_PFL( 586.03, ST      ,16,"Sidereal time at start (hours)"                  )
    161 MK_PFL( 586.04, ZD      ,16,"Zenith distance (degrees)"                       )
    162 MK_STR( 587.00, RASTRNG ,   "Actual Right Ascension (incl offset)"            )
    163 MK_STR( 587.01, DECSTRNG,   "Actual Declination (incl offset)"                )
     203MK_PFL( 586.02, HA      ,16,"[deg] Hour angle at start"                       )
     204MK_PFL( 586.03, ST      ,16,"[hours] Sidereal time at start"                  )
     205MK_PFL( 586.04, ZD      ,16,"[deg] Zenith distance"                           )
    164206MK_STR( 587.02, HASTRNG ,   "Hour angle at start"                             )
    165207MK_STR( 587.03, STSTRNG ,   "Sidereal time at start"                          )     
    166 MK_STR( 587.04, ZDSTRNG ,   "Zenith distance (deg:mm:ss)"                     )                   
     208MK_STR( 587.04, ZDSTRNG ,   "[deg:mm:ss] Zenith distance"                     )                   
  • branches/eam_branches/20091201/ippconfig/gpc1/camera.config

    r26696 r26764  
    149149PHOTCODE.RULE           STR     {DETECTOR}.{FILTER.ID}.{CHIP.NAME}      # Rule for generating photcode
    150150
    151 BURNTOOL.STATE.GOOD     S16     13  # Value for burntool_state with the most recent bt version.
     151BURNTOOL.STATE.GOOD     S16     14  # Value for burntool_state with the most recent bt version.
  • branches/eam_branches/20091201/ppImage/src/ppImageBurntoolMask.c

    r25299 r26764  
    33#endif
    44
    5 /* #define PPIMAGE_BURNTOOL_DEBUG 1 */
     5#define PPIMAGE_BURNTOOL_DEBUG 1
    66
    77#include "ppImage.h"
     
    4747
    4848    if (psMetadataLookupS32(&status,rowMD,"cell") == burntool_cell) {
    49       if (((options->burntoolTrails & 0x01)&&(psMetadataLookupS32(&status,rowMD,"nfit") == 0))||
    50           ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1))||
    51           ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0))) {
     49      if ((psMetadataLookupS32(&status,rowMD,"nfit") != 0)&&
     50          (((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1))||
     51           ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0)))) {
    5252        /*       If the fit fails, burntool reports zero here.  This
    5353                 signifies that it expected to see a trail (else why
     
    7070          if (psMetadataLookupS32(&status,rowMD,"up") == 0) {
    7171            for (int j = 0; j <= psMetadataLookupS32(&status,rowMD,"y1p"); j++) {
    72 /* #ifdef PPIMAGE_BURNTOOL_DEBUG */
    73 /*            psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", */
    74 /*                     i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); */
    75 /* #endif */
     72#ifdef PPIMAGE_BURNTOOL_DEBUG
     73              psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n",
     74                       i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue);
     75#endif
    7676              image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
    7777            }
     
    7979          else {
    8080            for (int j = psMetadataLookupS32(&status,rowMD,"y1m"); j < image->numRows ; j++) {
    81 /* #ifdef PPIMAGE_BURNTOOL_DEBUG */
    82 /*            psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", */
    83 /*                     i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); */
    84 /* #endif */
     81#ifdef PPIMAGE_BURNTOOL_DEBUG
     82              psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n",
     83                       i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue);
     84#endif
    8585              image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
    8686            }
Note: See TracChangeset for help on using the changeset viewer.