IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35727


Ignore:
Timestamp:
Jul 1, 2013, 10:22:45 AM (13 years ago)
Author:
eugene
Message:

test for imageID out of range; only update catalogs which have been modified (logic here was wrong previously)

Location:
branches/eam_branches/ipp-20130509/Ohana/src/delstar
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130509/Ohana/src/delstar/include/delstar.h

    r35721 r35727  
    155155
    156156void initImageIndex (ImageSubset *image, off_t Nimage_init);
    157 int *getImageIndex ();
     157int *getImageIndex (int *maxIndex);
    158158int FindIDexp (off_t *ID, off_t *Seq, e_time time, short photcode);
    159159int FindIDstk (off_t *ID, off_t *Seq, short *photcode, off_t extID);
  • branches/eam_branches/ipp-20130509/Ohana/src/delstar/src/ImageOpsFixLAP.c

    r35721 r35727  
    1414unsigned int *imageSeq_stk = NULL;
    1515
     16int maxID = 0;
    1617int *imageIndex = NULL;
    1718
     
    4445  memset (Nimage_invalid, 0, sizeof(int)*Nimage);
    4546
    46   int maxID = 0;
    47 
    4847  // save the image data in the local static arrays
    4948  for (i = 0; i < Nimage; i++) {
     
    8584}
    8685
    87 int *getImageIndex () {
     86int *getImageIndex (int *maxIDout) {
     87  *maxIDout = maxID;
    8888  return imageIndex;
    8989}
  • branches/eam_branches/ipp-20130509/Ohana/src/delstar/src/delete_fix_LAP.c

    r35721 r35727  
    6464
    6565    // skip if nothing was deleted
    66     if (UPDATE && (NaverageStart == catalog.Naverage) && (NmeasureStart == catalog.Nmeasure)) {
     66    int noChange = (NaverageStart == catalog.Naverage) && (NmeasureStart == catalog.Nmeasure);
     67    if (UPDATE && !noChange) {
    6768      dvo_catalog_save_complete (&catalog, VERBOSE2);
    6869    }
     
    518519  }
    519520
    520   int *imageIndex = getImageIndex();
     521  int maxID = 0;
     522  int *imageIndex = getImageIndex(&maxID);
    521523
    522524  // check the image IDs for the remaining measures
     
    532534        resetID = TRUE;
    533535        goto resetID_exp;
     536      }
     537      if (imageID > maxID) {
     538        fprintf (stderr, "invalid image ID "OFF_T_FMT" for catalog %s\n", imageID, catalog[0].filename);
     539        exit (2);
    534540      }
    535541      off_t imageN = imageIndex[imageID];
     
    587593        goto resetID_stk;
    588594      }
     595      if (imageID > maxID) {
     596        fprintf (stderr, "invalid image ID "OFF_T_FMT" for catalog %s\n", imageID, catalog[0].filename);
     597        exit (2);
     598      }
    589599
    590600      off_t imageN = imageIndex[imageID];
Note: See TracChangeset for help on using the changeset viewer.