IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25404


Ignore:
Timestamp:
Sep 15, 2009, 3:59:23 PM (17 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/burnfix.c

    r24391 r25404  
    2525   err = burn_check(nx, ny, NX, NY, imbuf, mbuf, cell);
    2626
     27//   fprintf(stderr, "Got through burn_check\n");
     28
    2729/* Expand the masks; burns asymmetrically, stars symmetrically */
    2830//   err = grow_mask(nx, ny, NX, mbuf, YMASK_GROW, YMASK_GROW, cell->nstar, cell->star);
     
    3032   err = grow_mask(nx, ny, NX, mbuf, BMASK_GROW, RMASK_GROW,
    3133                   MASK_SAT_HALO, cell->nburn, cell->burn);
     34//   fprintf(stderr, "Got through grow mask for burns\n");
    3235   err = grow_mask(nx, ny, NX, mbuf, BMASK_GROW, RMASK_GROW,
    3336                   MASK_STAR_HALO, cell->nstar, cell->star);
     37//   fprintf(stderr, "Got through grow mask for stars\n");
    3438
    3539/* Fix up all the burns */
     
    3741      if(!cell->burn[k].burned) continue;
    3842/* Fit the trail */
     43//      fprintf(stderr, "Fitting trail %d\n", k);
    3944      fit_trail(nx, ny, NX, imbuf, mbuf, cell->burn+k, 1,
    4045             cell->sky+cell->bias, cell->rms, BURN_PWR);
    4146/* Subtract the fit from the image */
     47//      fprintf(stderr, "Subtracting trail %d\n", k);
    4248      if(!cell->burn[k].fiterr) sub_fit(nx, ny, NX, buf, cell->burn+k, 1);
    4349   }
     
    218224/****************************************************************/
    219225/* burn_test() tests whether a box is burned or not */
     226/* It's trying to balance the flux of above-below to see whether
     227 * there's a net burn above.  It has to cope with the case that the box is
     228 * so low there is no above in which case it compares center-side.
     229 * It's somewhat rudimentary as indicated by the FIXME's, and the original
     230 * version had some real logical problems.
     231 */
    220232STATIC int burn_test(int nx, int ny, int NX, DTYPE *data, int rms,
    221233                       MTYPE *mask, OBJBOX *box)
    222234{
     235   int i, j, nburn, nref, nmed;
     236   int y0, y1, ymid, xburn, xref, dx=0, dy=0;
     237
     238/* FIXME: needs a test for flat-toppedness as well as trail... */
     239/* FIXME: needs a test for pure, massive saturation */
     240
     241/* Center line */
     242   ymid = (box->y0m + box->y0p + box->y1m + box->y1p + 2) / 4;
     243
     244/* Irrelevant, too near the top to detect a burn anyway */
     245   if(box->ey > ny-FIT_EDGE-3) {
     246      box->diff = -1;
     247      box->burned = -1;
     248/* But looks like a bad one which will leave behind persistence */
     249      if(box->ey-box->sy+1 > 4) box->burned = 1;
     250      return(0);
     251
     252/* Too near the bottom, do a side-side test */
     253   } else if(box->sy < FIT_EDGE+3) {
     254      dy = 0;
     255      y0 = ymid + MAX(box->ey-ymid, FIT_EDGE);
     256      y1 = MIN(y0+100, ny-1);
     257
     258      if(2*box->ex - box->sx + 1 < nx-1) {      /* Work right? */
     259         dx = box->ex - box->sx + 1;
     260
     261      } else if(2*box->sx - box->ex - 1 > 0) {  /* Work left? */
     262         dx = -(box->ex - box->sx + 1);
     263
     264      } else {  /* No room!  Oh no! */
     265         box->diff = -1;
     266         box->burned = -1;
     267/* But looks like a bad one which will leave behind persistence */
     268         if(box->ey-box->sy+1 > 4) box->burned = 1;
     269         return(0);
     270      }
     271
     272/* Do a top-bottom test for excess flux */
     273   } else {
     274      dx = 0;
     275      dy = MAX(ymid-box->sy, box->ey-ymid);
     276      if(dy < FIT_EDGE) dy = FIT_EDGE;
     277      y0 = ymid + dy;
     278      y1 = y0 + MIN(ny-1-y0, 2*ymid-y0-1);
     279      if(y1-y0 > 100) y1 = y0 + 100;
     280   }
     281
     282/* Do the test; get the median of the averages across x */
     283   nmed = 0;
     284   for(j=y0; j<y1; j++) {
     285      xburn = xref = 0;
     286      nburn = nref = 0;
     287      for(i=box->sx; i<=box->ex; i++) {
     288         if(mask[i+j*NX] == MASK_NONE) {
     289            xburn += data[i+j*NX];
     290            nburn++;
     291         }
     292         if(dx != 0) {  /* Side to side */
     293            if(mask[i+dx+j*NX] == MASK_NONE) {
     294               xref += data[i+dx+j*NX];
     295               nref++;
     296            }
     297         } else {       /* top-bottom */
     298            if(mask[i+(2*ymid-j)*NX] == MASK_NONE) {
     299               xref += data[i+(2*ymid-j)*NX];
     300               nref++;
     301            }
     302         }
     303      }
     304      if(nburn > 0) xburn /= nburn;
     305      if(nref > 0) xref /= nref;
     306      if(nref > 0 && nburn > 0) median_buf[nmed++] = xburn - xref;
     307   }
     308   box->diff = int_median(nmed, median_buf);
     309   box->burned = (box->diff > 0.3*rms);
     310   return(0);
     311}
     312
     313#ifdef ORIG_BURN_TEST
     314// This has a lot of problems -- chief among which is what happens with
     315// a huge kite-shaped bad region.  It's fundamentally trying to balance
     316// the flux of above-below to see whether there's a net burn above.  But
     317// it has to cope with the case that the box is so low there is no above
     318// in which case it compares center-side.
     319/****************************************************************/
     320/* burn_test() tests whether a box is burned or not */
     321STATIC int burn_test(int nx, int ny, int NX, DTYPE *data, int rms,
     322                       MTYPE *mask, OBJBOX *box)
     323{
    223324   int i, j, n, nrow, nmed;
    224325   int y0, y1, ymid, xsum, dx=0;
     
    229330/* Center line */
    230331   ymid = (box->y0m + box->y0p + box->y1m + box->y1p + 2) / 4;
     332
    231333/* Starting point offset */
    232334   y0 = MAX(ymid-box->sy, box->ey-ymid);
     
    259361      nrow = 0;
    260362      for(i=box->sx; i<=box->ex; i++) {
     363// IS THIS THE PROBLEM?
    261364         xsum += data[i+(ymid+y0+j)*NX]*(mask[i+(ymid+y0+j)*NX] == MASK_NONE);
    262365         if(y1 < ny) {
     
    279382   return(0);
    280383}
     384#endif
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/burnparams.h

    r23924 r25404  
    5555EXTERN int EXPIRE_TRAIL_TIME;   /* Expire trails after this interval */
    5656
     57EXTERN int PERSIST_RETAIN;      /* Retain bad-slope persistence fits */
     58
    5759#endif /* _INCLUDED_burnparams_ */
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/burntool.c

    r24391 r25404  
    100100   EXPIRE_TRAIL_TIME = 2000;    /* Expire a persist after this [sec] */
    101101
     102   PERSIST_RETAIN = 0;          /* Retain persists with bad slopes? */
     103
    102104/* Parse the args */
    103105   cellxy = -1;
     
    175177         persistfitsfile = argv[i] + 7;
    176178
     179/* Keep persistence streaks which had a bad slope? */
     180      } else if(strncmp(argv[i], "persist=", 8) == 0) {/* persist={t|f} */
     181         PERSIST_RETAIN = argv[i][8] == 'y' || argv[i][8] == '1' || argv[i][8] == 't';
     182
    177183/* Output file for PSF gallery */
    178184      } else if(strncmp(argv[i], "psf=", 4) == 0) {     /* psf=fname */
     
    286292         CONCAT_FITS = argv[i][10] == 'n' || argv[i][10] == '0' ||
    287293            argv[i][10] == 'f';
     294
     295/* Set the e/ADU for the noise gate that cells must pass */
     296      } else if(strncmp(argv[i], "EADU=", 5) == 0) {    /* EADU=e */
     297         if(sscanf(argv[i]+5, "%lf", &MIN_EADU) != 1) {
     298            fprintf(stderr, "\rerror: cannot get e/ADU size from `%s'\n", argv[i]);
     299            exit(EXIT_FAILURE);
     300         }
     301
     302
     303        /* Set the read noise for the noise gate that cells must pass */
     304      } else if(strncmp(argv[i], "RN=", 3) == 0) {      /* EADU=e */
     305         if(sscanf(argv[i]+3, "%d", &MAX_READ_NOISE) != 1) {
     306            fprintf(stderr, "\rerror: cannot get read noise size from `%s'\n", argv[i]);
     307            exit(EXIT_FAILURE);
     308         }
    288309
    289310/* Quiet? */
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/burntool.h

    r24391 r25404  
    9797#define FIT_TOP_ERROR  2        /* Saturation extends to top: no points */
    9898#define FIT_SLOPE_ERROR  3      /* Unreasonable fit */
     99#define FIT_ALL_GONE  4         /* No column survived as significant */
    99100#define FIT_EXPIRED 9           /* Don't carry any more as persistent */
    100101
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/burnutils.c

    r23490 r25404  
    115115   if(VERBOSE & VERB_BOXGROW) {
    116116      printf("box: %d %d %d %d\n", box->sx, box->sy, box->ex, box->ey);
     117      fflush(stdout);
    117118   }
    118119
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/man/burntool.1

    r24391 r25404  
    5353        power laws; downward burns as exponentials.
    5454       
     55        The fit to downward, persistence burns may have an unreasonable "slope"
     56        (meaning exponential sign), increasing away from the burn origin.
     57        These are discarded unless "persist=t" is invoked.  It is possible
     58        for the fit to be fooled by uncataloged stars, so the persistence
     59        can be kept in the output file with "persist=t" (although no fit
     60        correction is applied) and they will propagate from input to output
     61        until they finally achieve a legal fit with negligible amplitude.
     62
    5563        Burntool also identifies really blasted areas which are saturated from
    5664        top to bottom.  These cannot be fitted, but are carried along for
     
    231239                'in' takes precedence.
    232240
     241        persist={t|f}
     242                Retain persistence streaks whose fit slope turned out to be
     243                unreasonable.
     244
    233245        out=fname     
    234246                Output file for burn streaks
     
    290302        expire=N
    291303                Retire a blasted burn after N seconds
     304
     305        EADU=x
     306                Set the minimum e/ADU for acceptable cell sky noise
     307                (default 0.3).  Should not normally be changed!
     308        RN=x
     309                Set the maximum read noise for acceptable cell sky noise
     310                (default 20).  Should not normally be changed!
     311
     312                Any cell whose noise variance in the sky is greater than
     313                  sky/EADU+RN*RN  is rejected out of hand, and skipped for
     314                further processing.
    292315
    293316        quiet={t|f}   
     
    332355BUGS:
    333356        090224: Still in development
     357        090810: Squished a few memory bugs
    334358
    335359SEE ALSO:
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/persist_fits.c

    r23924 r25404  
    222222      for(k=0; k<cell[j].npersist; k++)
    223223      {
    224          if(cell[j].persist[k].fiterr) continue;
    225          if(cell[j].persist[k].nfit <= 0) continue;
     224         if(PERSIST_RETAIN) {
     225/* Keep fits which have a dubious slope */
     226            if(cell[j].persist[k].fiterr != FIT_SLOPE_ERROR) {
     227               if(cell[j].persist[k].fiterr) continue;
     228               if(cell[j].persist[k].nfit <= 0) continue;
     229            }
     230         } else {
     231            if(cell[j].persist[k].fiterr) continue;
     232            if(cell[j].persist[k].nfit <= 0) continue;
     233         }
    226234         num_areas++;
    227235         num_fits += cell[j].persist[k].nfit;
     
    232240      {
    233241         if(!cell[j].burn[k].burned) continue;
    234          if(cell[j].burn[k].fiterr &&
    235             cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
    236          if(cell[j].burn[k].nfit <= 0) continue;
     242         if(PERSIST_RETAIN) {
     243/* Keep fits which have a dubious slope */
     244            if(cell[j].burn[k].fiterr != FIT_SLOPE_ERROR) {
     245               if(cell[j].burn[k].fiterr &&
     246                  cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     247               if(cell[j].burn[k].nfit <= 0) continue;
     248            }
     249         } else {
     250            if(cell[j].burn[k].fiterr &&
     251               cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     252            if(cell[j].burn[k].nfit <= 0) continue;
     253         }
    237254         num_areas++;
    238255         num_fits += cell[j].burn[k].nfit;
     
    329346      for(k=0; k<cell[j].npersist; k++)
    330347      {
    331          if(cell[j].persist[k].fiterr) continue;
    332          if(cell[j].persist[k].nfit <= 0) continue;     
     348         if(PERSIST_RETAIN) {
     349/* Keep fits which have a dubious slope */
     350            if(cell[j].persist[k].fiterr != FIT_SLOPE_ERROR) {
     351               if(cell[j].persist[k].fiterr) continue;
     352               if(cell[j].persist[k].nfit <= 0) continue;     
     353            }
     354         } else {
     355            if(cell[j].persist[k].fiterr) continue;
     356            if(cell[j].persist[k].nfit <= 0) continue;     
     357         }
    333358
    334359         result = write_area_row(hu, data, table, row++, &(cell[j].persist[k]));
     
    340365      {
    341366         if(!cell[j].burn[k].burned) continue;
    342          if(cell[j].burn[k].fiterr &&
    343             cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
    344          if(cell[j].burn[k].nfit <= 0) continue;
     367         if(PERSIST_RETAIN) {
     368/* Keep fits which have a dubious slope */
     369            if(cell[j].burn[k].fiterr != FIT_SLOPE_ERROR) {
     370               if(cell[j].burn[k].fiterr &&
     371                  cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     372               if(cell[j].burn[k].nfit <= 0) continue;
     373            }
     374         } else {
     375            if(cell[j].burn[k].fiterr &&
     376               cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     377            if(cell[j].burn[k].nfit <= 0) continue;
     378         }
    345379
    346380         result = write_area_row(hu, data, table, row++, &(cell[j].burn[k]));
     
    426460      for(k=0; k<cell[j].npersist; k++)
    427461      {
    428          if(cell[j].persist[k].fiterr) continue;
     462         if(PERSIST_RETAIN) {
     463/* Keep fits which have a dubious slope */
     464            if(cell[j].persist[k].fiterr != FIT_SLOPE_ERROR) {
     465               if(cell[j].persist[k].fiterr) continue;
     466            }
     467         } else {
     468            if(cell[j].persist[k].fiterr) continue;
     469         }
    429470         for(i=0; i<cell[j].persist[k].nfit; i++)
    430471         {
     
    441482      {
    442483         if(!cell[j].burn[k].burned) continue;
    443          if(cell[j].burn[k].fiterr &&
    444             cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     484         if(PERSIST_RETAIN) {
     485/* Keep fits which have a dubious slope */
     486            if(cell[j].burn[k].fiterr != FIT_SLOPE_ERROR) {
     487               if(cell[j].burn[k].fiterr &&
     488                  cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     489            }
     490         } else {
     491            if(cell[j].burn[k].fiterr &&
     492               cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     493         }
    445494
    446495         for(i=0; i<cell[j].burn[k].nfit; i++)
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/persistio.c

    r23924 r25404  
    5151             &boxbuf[nbox].slope, &boxbuf[nbox].nfit,
    5252             &boxbuf[nbox].sxfit, &boxbuf[nbox].exfit);
    53       if(boxbuf[nbox].nfit <= 0) continue;
    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++) {
    58          if(fgets(line, 1024, fp) == NULL) {
    59             fprintf(stderr, "\rerror: short read of burn lines\n");
    60             return(-1);
    61          }
    62          sscanf(line, "%d %d %lf\n", &boxbuf[nbox].xfit[i],
    63                 &boxbuf[nbox].yfit[i], &boxbuf[nbox].zero[i]);
     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++) {
     58            if(fgets(line, 1024, fp) == NULL) {
     59               fprintf(stderr, "\rerror: short read of burn lines\n");
     60               return(-1);
     61            }
     62            sscanf(line, "%d %d %lf\n", &boxbuf[nbox].xfit[i],
     63                   &boxbuf[nbox].yfit[i], &boxbuf[nbox].zero[i]);
     64         }
    6465      }
    6566      boxbuf[nbox].fiterr = 0;
     
    147148      for(kp=0; kp<n; kp++) {
    148149         k = boxid[kp];
    149          zk = box[k].zero[box[k].nfit/2];
     150         zk = 0.0;
     151         if(box[k].nfit > 0) zk = box[k].zero[box[k].nfit/2];
    150152         for(jp=kp+1; jp<n; jp++) {
    151153            j = boxid[jp];
    152             zj = box[j].zero[box[j].nfit/2];
     154            zj = 0.0;
     155            if(box[j].nfit > 0) zj = box[j].zero[box[j].nfit/2];
    153156            if(ABS(yctr[jp]-yctr[kp]) > DIFFERENT_STREAK) {
    154157/* Trim back the feebler streak */
     
    238241/* First: patched up persists */
    239242      for(k=0; k<cell[j].npersist; k++) {
    240          if(cell[j].persist[k].fiterr) continue;
    241          if(cell[j].persist[k].nfit <= 0) continue;
     243
     244         if(PERSIST_RETAIN) {
     245/* Keep fits which have a dubious slope */
     246            if(cell[j].persist[k].fiterr != FIT_SLOPE_ERROR) {
     247               if(cell[j].persist[k].fiterr) continue;
     248               if(cell[j].persist[k].nfit <= 0) continue;
     249            }
     250         } else {
     251            if(cell[j].persist[k].fiterr) continue;
     252            if(cell[j].persist[k].nfit <= 0) continue;
     253         }
    242254         fprintf(fp, "%3d %7d  %3d %3d %5d %3d  %3d %3d  %3d %3d  %3d %3d %3d %3d %3d %3d %3d %3d  %1d %1d %9.6f %3d %3d %3d\n",
    243255                 j, cell[j].persist[k].time,
     
    262274      for(k=0; k<cell[j].nburn; k++) {
    263275         if(!cell[j].burn[k].burned) continue;
    264          if(cell[j].burn[k].fiterr &&
    265             cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
    266          if(cell[j].burn[k].nfit <= 0) continue;
     276         if(PERSIST_RETAIN) {
     277/* Keep fits which have a dubious slope */
     278            if(cell[j].burn[k].fiterr != FIT_SLOPE_ERROR) {
     279               if(cell[j].burn[k].fiterr &&
     280                  cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     281               if(cell[j].burn[k].nfit <= 0) continue;
     282            }
     283         } else {
     284            if(cell[j].burn[k].fiterr &&
     285               cell[j].burn[k].fiterr != FIT_TOP_ERROR) continue;
     286            if(cell[j].burn[k].nfit <= 0) continue;
     287         }
    267288
    268289         i = (cell[j].burn[k].ex - cell[j].burn[k].sx + 1) / 2;
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/stardetect.c

    r23490 r25404  
    9898                         boxbuf[nbox].ex, boxbuf[nbox].ey,
    9999                         boxbuf[nbox].max);
     100                  fflush(stdout);
    100101               }
    101102/* Mark the veto mask so as not to trigger on this one again */
     
    139140               printf("   %d %d %d %d\n",
    140141                      boxbuf[nbox].y0m, boxbuf[nbox].y0p,boxbuf[nbox].y1m, boxbuf[nbox].y1p);
     142               fflush(stdout);
    141143            }
    142144            xon = -1;
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/burntool/trailfit.c

    r23924 r25404  
    226226/* FIXME: sanity check fits */
    227227   if(slope >= FIT_MAX_SLOPE || slope < FIT_MIN_SLOPE) {
     228      box->slope = slope;
     229      box->nfit = 0;
    228230      box->fiterr = FIT_SLOPE_ERROR;
    229231      return(-1);
     
    283285   }
    284286/* Update fit ranges */
    285    box->sxfit = box->xfit[0];
    286    box->exfit = box->xfit[box->nfit-1];
    287 
     287   if(box->nfit > 0) {
     288      box->sxfit = box->xfit[0];
     289      box->exfit = box->xfit[box->nfit-1];
     290   } else {
     291      box->sxfit = xs;
     292      box->exfit = xs - 1;
     293      box->fiterr = FIT_ALL_GONE;
     294   }
     295//   if(box->nfit <= 0) fprintf(stderr, "WHOA, got nfit = 0\n");
    288296   return(0);
    289297}
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/libfh/fh.c

    r24391 r25404  
    10391039         newval[strlen(newval) - 1] = '\0';
    10401040         fh_set_str(hu, idx, name, newval, comment);
     1041         free(newval);
    10411042         return;
    10421043      }
     
    15191520      i++;
    15201521   }
     1522   return FH_SUCCESS;
     1523}
     1524
     1525static void
     1526pad_header(HeaderUnit hu, int n)
     1527{
     1528   int i;
     1529   double idx = 900000000;
     1530
     1531   for (i = 0; i < n; i++)
     1532   {
     1533      fh_set_card(hu, idx++, FH_RESERVE);
     1534   }
     1535}
     1536
     1537fh_result
     1538fh_copy(HeaderUnit hu, const HeaderUnit source_)
     1539{
     1540   fh_result result;
     1541   int reserve;
     1542
     1543   result = fh_merge(hu, source_);
     1544   if (result != FH_SUCCESS) return result;
     1545   reserve = fh_get_reserve(source_);
     1546   if (reserve) pad_header(hu, reserve);
    15211547   return FH_SUCCESS;
    15221548}
     
    17571783}
    17581784
     1785int
     1786fh_get_reserve(HeaderUnit hu)
     1787{
     1788   HeaderUnitStruct* list = FH_HU(hu);
     1789
     1790   if (!list)
     1791   {
     1792      log_error("invalid argument to fh_get_reserve()");
     1793      return -1;
     1794   }
     1795
     1796   if (list->reserve)
     1797      return list->reserve;
     1798   else
     1799      return list->reserve_found;
     1800}
     1801
    17591802fh_result
    17601803fh_rewrite(HeaderUnit hu)
  • branches/eam_branches/20090715/extsrc/gpcsw/gpcsrc/fits/libfh/fh.h

    r23924 r25404  
    174174 * is used to create a new FITS header.  NOT for use with fh_rewrite().
    175175 */
     176int fh_get_reserve(HeaderUnit hu);
     177/*
     178 * Get the current setting or the number of reserve cards found in
     179 * a header unit.  Returns -1 if hu is invalid.
     180 */
    176181fh_result fh_validate(HeaderUnit hu); /* fh_validate.c; for use by fhtool.c */
    177182
     
    386391double fh_idx(HeaderUnit hu); /* idx of the last card returned by fh_next */
    387392fh_result fh_merge(HeaderUnit hu, const HeaderUnit source); /* source unchanged */
     393fh_result fh_copy(HeaderUnit hu, const HeaderUnit source); /* fh_merge+keep reserve */
    388394
    389395/* ---------------------------------------------------------
     
    459465 */
    460466
    461 
    462467#endif /* _INCLUDED_fh */
Note: See TracChangeset for help on using the changeset viewer.