IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:19:27 PM (15 years ago)
Author:
eugene
Message:

updates from eam branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvomerge/src/dvoverify.c

    r30830 r31160  
    1313# define DEBUG 0
    1414
    15 int VERBOSE;
    16 int CHECKSORTED;
     15int VERBOSE = FALSE;
    1716int NNotSorted = 0;
    1817
     
    2827  // Catalog catalog;
    2928
    30   VERBOSE = FALSE;
     29  int CHECKSORTED;
     30
    3131  if ((N = get_argument (argc, argv, "-v"))) {
    3232    VERBOSE = TRUE;
    3333    remove_argument (N, &argc, argv);
    3434  }
     35  if ((N = get_argument (argc, argv, "-verbose"))) {
     36    VERBOSE = TRUE;
     37    remove_argument (N, &argc, argv);
     38  }
    3539  if ((N = get_argument (argc, argv, "-s"))) {
    3640    CHECKSORTED = TRUE;
    3741    remove_argument (N, &argc, argv);
    3842  }
    39 
     43  if ((N = get_argument (argc, argv, "-sorted"))) {
     44    CHECKSORTED = TRUE;
     45    remove_argument (N, &argc, argv);
     46  }
    4047
    4148  // restrict to a portion of the sky
     
    5764
    5865  if (argc != 2) {
    59     fprintf (stderr, "USAGE: dvoverify (catdir) [-region Rmin Rmax Dmin Dmax] [-v -s]\n\n -v = verbose \n -s = checks if sorted, return error if not\n");
    60     fprintf (stderr, "  catdir : database of interest\n");
     66    fprintf (stderr, "USAGE: dvoverify (catdir) [-region Rmin Rmax Dmin Dmax] [-v] [-s]\n\n");
     67    fprintf (stderr, "  -v : VERBOSE\n");
     68    fprintf (stderr, "  -s : checks if sorted, return error if not\n");
     69    fprintf (stderr, "  (catdir) : database of interest\n");
    6170    exit (2);
    6271  }
     
    96105  for (i = 0; i < inlist[0].Nregions; i++) {
    97106    if (!inlist[0].regions[i][0].table) continue;
    98     if ((NNotSorted > 0) && CHECKSORTED) continue;
    99107    if (i % 1000 == 0) fprintf (stderr, ".");
    100108
     
    116124    if (!CheckCatalogIndexes(catdir, inlist[0].filename[i], inlist[0].regions[i])){
    117125      Nbad ++;
     126    }
     127
     128    // exit immediately if any file are unsorted and we require sorted tables
     129    if (CHECKSORTED && NNotSorted) {
     130      fprintf (stderr, "ERROR: files are not sorted\n");
     131      exit (1);
    118132    }
    119133  }
     
    123137    exit (1);
    124138  }
    125   if ((NNotSorted > 0) && CHECKSORTED) {
    126     fprintf (stderr, "ERROR: files are not sorted\n");
    127      exit (1);
    128   }
    129139
    130140  fprintf (stderr, "SUCCESS: no files are bad\n");
     141  if (NNotSorted) {
     142    fprintf (stderr, "NOTE: %d files are not sorted\n", NNotSorted);
     143  }
    131144  exit (0);
    132145}
Note: See TracChangeset for help on using the changeset viewer.