IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 30, 2012, 1:46:12 PM (14 years ago)
Author:
eugene
Message:

merge changes from eam_branches/ipp-20120405

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/Ohana/src/opihi/dvo/avextract.c

    r33662 r33963  
    3737  }
    3838
     39  int VERBOSE2 = FALSE;
     40  if ((N = get_argument (argc, argv, "-vv"))) {
     41    remove_argument (N, &argc, argv);
     42    VERBOSE = TRUE;
     43    VERBOSE2 = TRUE;
     44  }
     45
    3946  int PARALLEL = FALSE;
    4047  if ((N = get_argument (argc, argv, "-parallel"))) {
     
    6572      return FALSE;
    6673    }   
     74  }
     75
     76  // this is used to NOT save the results in the results file
     77  // use this option when mextract is used in a script which does its
     78  // own job of packaging the results
     79  int SKIP_RESULTS = FALSE;
     80  if ((N = get_argument (argc, argv, "-skip-results"))) {
     81    remove_argument (N, &argc, argv);
     82    SKIP_RESULTS = TRUE;
    6783  }
    6884
     
    8096    goto escape;
    8197  }
     98
     99  // init locally static variables (time refs)
     100  dbExtractAveragesInit ();
    82101
    83102  // command-line is of the form: avextract field,field, field [where (field op value)...]
     
    173192    catalog.filename = (HOST_ID || PARALLEL_LOCAL) ? hostfile : skylist[0].filename[i];
    174193    catalog.catflags = LOAD_AVES | LOAD_SECF;
    175     if (needMeasures) {
    176       catalog.catflags |= LOAD_MEAS;
    177     }
     194    catalog.catflags |= needMeasures ? LOAD_MEAS : SKIP_MEAS;
    178195    catalog.Nsecfilt = 0;
    179196
     
    181198     
    182199    // an error exit status here is a significant error
    183     if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
     200    if (!dvo_catalog_open (&catalog, NULL, VERBOSE2, "r")) {
    184201      gprint (GP_ERR, "ERROR: failure to open catalog file %s\n", catalog.filename);
    185202      exit (2);
     
    193210      m = catalog.average[j].measureOffset;
    194211
    195       // reset counters for saved fields, extract fields
    196       dbExtractAveragesInit ();
     212      dbExtractAveragesInitAve ();  // reset counters for saved fields (costs very little)
     213
    197214      for (n = 0; n < Nfields; n++) {
    198215        values[n] = dbExtractAverages (&catalog.average[j], &catalog.secfilt[j*Nsecfilt], &catalog.measure[m], &fields[n]);
     
    229246
    230247  // write vectors to a table (this is used by parallel dvo operations, but can be used elsewhere)
    231   if (RESULT_FILE) {
     248  if (RESULT_FILE && !SKIP_RESULTS) {
    232249    int status = WriteVectorTableFITS (RESULT_FILE, "RESULT", vec, Nreturn, FALSE, NULL);
    233     if (!status) goto escape;
     250    if (!status) {
     251      goto escape;
     252    }
    234253  }
    235254
Note: See TracChangeset for help on using the changeset viewer.