IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34277


Ignore:
Timestamp:
Aug 2, 2012, 9:38:03 AM (14 years ago)
Author:
eugene
Message:

only report a missing image once, not once per detection

Location:
trunk/Ohana/src/dvomerge
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvomerge/include/dvomerge.h

    r34260 r34277  
    4242  unsigned int *old;
    4343  unsigned int *new;
     44  char *notFound;
    4445} IDmapType;
    4546
     
    128129int        IDmapSave               PROTO((char *filename, IDmapType *IDmap));
    129130IDmapType *IDmapLoad               PROTO((char *filename));
     131int        create_IDmap_lookup     PROTO((IDmapType *IDmap));
  • trunk/Ohana/src/dvomerge/src/IDmapIO.c

    r33963 r34277  
    133133  fprintf (stderr, "loaded data for %lld images\n", (long long) Nrow);
    134134
     135  create_IDmap_lookup (IDmap);
     136
    135137  return IDmap;
    136138}
  • trunk/Ohana/src/dvomerge/src/dvo_image_merge_dbs.c

    r33963 r34277  
    5454  }
    5555
     56  create_IDmap_lookup (IDmap);
     57
    5658  FREE(TgtIndex);
    5759  FREE(TgtTimes);
     
    105107  }
    106108
     109
    107110  // sort IDmap->old,new on the basis of IDmap->old:
    108111  sort_IDmap (IDmap);
     112
     113  create_IDmap_lookup (IDmap);
    109114
    110115  if (!out[0].swapped) {
     
    172177    newID = dvo_map_image_ID (IDmap, oldID);
    173178    if (newID == 0) {
    174       fprintf (stderr, "cannot find image ID "OFF_T_FMT"\n",  oldID);
     179      if (!IDmap->notFound[oldID]) {
     180        fprintf (stderr, "cannot find image ID "OFF_T_FMT"\n",  oldID);
     181        IDmap->notFound[oldID] = TRUE;
     182        // once we discover an imageID is not found, record that fact so we do not complain for every detection
     183      }
     184      // optionally exit here? or wait until end to report an error?
    175185      // exit (2);
    176186    }
     
    242252}
    243253
     254// we need a lookup table of length (oldIDmax + 1) to record if a given oldIDmax has not been found in Tgt
     255int create_IDmap_lookup (IDmapType *IDmap) {
     256 
     257  off_t i;
     258  unsigned int oldIDmax = 0;
     259
     260  for (i = 0; i < IDmap->Nmap; i++) {
     261    if (oldIDmax > IDmap->old[i]) continue;
     262    oldIDmax = IDmap->old[i];
     263  }
     264  ALLOCATE (IDmap->notFound, char, oldIDmax + 1);
     265  memset (IDmap->notFound, 0, sizeof(char) * (oldIDmax + 1));
     266  return TRUE;
     267}
Note: See TracChangeset for help on using the changeset viewer.