IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34819


Ignore:
Timestamp:
Dec 14, 2012, 3:03:53 PM (14 years ago)
Author:
eugene
Message:

add -skip-images, fix memleak, add -vv (VERBOSE2)

Location:
branches/eam_branches/ipp-20121130/Ohana/src/delstar
Files:
5 edited

Legend:

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

    r34749 r34819  
    2727double ALPHA;
    2828int    VERBOSE;
     29int    VERBOSE2;
    2930int    ORPHAN;
    3031int    MISSED;
     
    3839int          HOST_ID;
    3940char        *HOSTDIR;
     41
     42int SKIP_IMAGES;
    4043
    4144time_t    START;
  • branches/eam_branches/ipp-20121130/Ohana/src/delstar/src/args.c

    r34749 r34819  
    4444  }
    4545
     46  VERBOSE2 = FALSE;
     47  if ((N = get_argument (argc, argv, "-vv"))) {
     48    VERBOSE = TRUE;
     49    VERBOSE2 = TRUE;
     50    remove_argument (N, &argc, argv);
     51  }
     52
    4653  // region of interest
    4754  UserPatch.Rmin = 0;
     
    5865    remove_argument (N, &argc, argv);
    5966    UserPatch.Dmax = atof (argv[N]);
     67    remove_argument (N, &argc, argv);
     68  }
     69
     70  SKIP_IMAGES = FALSE;
     71  if ((N = get_argument (argc, argv, "-skip-images"))) {
     72    SKIP_IMAGES = TRUE;
    6073    remove_argument (N, &argc, argv);
    6174  }
     
    205218  }
    206219
     220  VERBOSE2 = FALSE;
     221  if ((N = get_argument (argc, argv, "-v"))) {
     222    VERBOSE = TRUE;
     223    VERBOSE2 = TRUE;
     224    remove_argument (N, &argc, argv);
     225  }
     226
    207227  /* specify portion of the sky */
    208228  UserPatch.Rmin = 0;
  • branches/eam_branches/ipp-20121130/Ohana/src/delstar/src/delete_photcodes.c

    r34749 r34819  
    4646
    4747    // an error exit status here is a significant error
    48     if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE, "a")) {
     48    if (!dvo_catalog_open (&catalog, skylist[0].regions[i], VERBOSE2, "a")) {
    4949      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
    5050      exit (2);
    5151    }
    5252    if (!catalog.Naves_disk) {
    53       if (VERBOSE) fprintf (stderr, "no data in %s, skipping\n", catalog.filename);
     53      if (VERBOSE2) fprintf (stderr, "no data in %s, skipping\n", catalog.filename);
    5454      dvo_catalog_unlock (&catalog);
    5555      dvo_catalog_free (&catalog);
     
    5858
    5959    delete_photcodes_catalog (&catalog, photcodes, Nphotcodes);
    60     dvo_catalog_save_complete (&catalog, VERBOSE);
     60    dvo_catalog_save_complete (&catalog, VERBOSE2);
    6161    dvo_catalog_unlock (&catalog);
    6262    dvo_catalog_free (&catalog);
     
    9797    char tmpline[1024];
    9898    if (VERBOSE)       { snprintf (tmpline, 1024, "%s -v",              command);                    strcpy (command, tmpline); }
     99    if (VERBOSE2)      { snprintf (tmpline, 1024, "%s -vv",             command);                    strcpy (command, tmpline); }
    99100
    100101    fprintf (stderr, "command: %s\n", command);
     
    287288  FREE(measure);
    288289  FREE(average);
     290  FREE(secfilt);
    289291  catalog[0].measure = measureOut;
    290292  catalog[0].average = averageOut;
     
    299301  for (i = 0; i < NaveOut; i++) {
    300302    NmeasureTotal += catalog[0].average[i].Nmeasure;
    301     if (VERBOSE && !(NmeasureTotal <= catalog[0].Nmeasure)) {
     303    if (VERBOSE2 && !(NmeasureTotal <= catalog[0].Nmeasure)) {
    302304      fprintf (stderr, "too few measurements: %d %d %d\n", (int) i, NmeasureTotal, (int) catalog[0].Nmeasure);
    303305    }
    304306    measureOffsetOK &= (catalog[0].average[i].measureOffset < catalog[0].Nmeasure);
    305     if (VERBOSE && !(catalog[0].average[i].measureOffset < catalog[0].Nmeasure)) {
     307    if (VERBOSE2 && !(catalog[0].average[i].measureOffset < catalog[0].Nmeasure)) {
    306308      fprintf (stderr, "offset too large: %d %d %d\n", (int) i, catalog[0].average[i].Nmeasure, (int) catalog[0].Nmeasure);
    307309    }
    308310    measureOffsetOK &= (catalog[0].average[i].measureOffset + catalog[0].average[i].Nmeasure <= catalog[0].Nmeasure);
    309     if (VERBOSE && !(catalog[0].average[i].measureOffset + catalog[0].average[i].Nmeasure <= catalog[0].Nmeasure)) {
     311    if (VERBOSE2 && !(catalog[0].average[i].measureOffset + catalog[0].average[i].Nmeasure <= catalog[0].Nmeasure)) {
    310312      fprintf (stderr, "orrset + Nmeasure too large: %d + %d > %d %d\n", (int) i, catalog[0].average[i].measureOffset, catalog[0].average[i].Nmeasure, (int) catalog[0].Nmeasure);
    311313    }
     
    313315    for (j = 0; j < catalog[0].average[i].Nmeasure; j++) {
    314316      averefOK &= (catalog[0].measure[m+j].averef == i);
    315       if (VERBOSE && !(catalog[0].measure[m+j].averef == i)) {
     317      if (VERBOSE2 && !(catalog[0].measure[m+j].averef == i)) {
    316318        fprintf (stderr, "averef broken: %d vs %d (measure %d)\n", (int) i, catalog[0].measure[m+j].averef, (int) (m+j));
    317319      }
     
    340342  FREE (measureSeqRaw);
    341343  FREE (measureSeqOut);
     344  FREE (measureRefOut);
    342345  FREE (measureAveRaw);
    343346  FREE (averageNmeas);
  • branches/eam_branches/ipp-20121130/Ohana/src/delstar/src/delstar.c

    r34749 r34819  
    1010  args (argc, argv);
    1111
    12   set_db (&db);
    13   status = dvo_image_lock (&db, ImageCat, 60.0, LCK_XCLD); /* XCLD */
    14   if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
    15   if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename);
    16 
    17   status = dvo_image_load (&db, VERBOSE, FALSE);
    18   if (!status) Shutdown ("can't read image catalog %s", db.filename);
     12  if (!SKIP_IMAGES) {
     13    set_db (&db);
     14    status = dvo_image_lock (&db, ImageCat, 60.0, LCK_XCLD); /* XCLD */
     15    if (!status) Shutdown ("ERROR: failure to lock image catalog %s", db.filename);
     16    if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename);
     17    status = dvo_image_load (&db, VERBOSE, FALSE);
     18    if (!status) Shutdown ("can't read image catalog %s", db.filename);
     19  }
    1920
    2021  switch (MODE) {
     
    2930      break;
    3031    case MODE_PHOTCODES: {
    31       if (!delete_image_photcodes (&db)) exit (1);
     32      if (!SKIP_IMAGES) {
     33        if (!delete_image_photcodes (&db)) exit (1);
     34      }
    3235
    3336      if (!delete_photcodes (0, NULL)) {
  • branches/eam_branches/ipp-20121130/Ohana/src/delstar/src/delstar_client.c

    r34749 r34819  
    3232      break;
    3333    case MODE_PHOTCODES:
    34       delete_photcodes (HOST_ID, HOSTDIR);
    35       break;
     34      if (!delete_photcodes (HOST_ID, HOSTDIR)) {
     35        fprintf (stderr, "failure deleting measurements from %s\n", HOSTDIR);
     36        exit (1);
     37      }
     38      exit (0);
    3639    case MODE_ORPHAN:
    3740      break;
Note: See TracChangeset for help on using the changeset viewer.