IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 18, 2007, 8:46:45 AM (19 years ago)
Author:
eugene
Message:

return NULL if field is not founddvo/dbFields.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/avextract.c

    r14191 r14287  
    33int avextract (int argc, char **argv) {
    44 
    5   int i, j, n, m, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
    6   int Nsecfilt, mode;
     5  int i, j, n, m, N, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
     6  int Nsecfilt, mode, VERBOSE;
    77  char *RegionName, *RegionList, *p;
    88  char **cstack, name[1024];
    99  float *values;
     10  void *Signal;
    1011
    1112  Catalog catalog;
     
    2425  fields = NULL;
    2526  stack = NULL;
     27
     28  VERBOSE = FALSE;
     29  if ((N = get_argument (argc, argv, "-v"))) {
     30    remove_argument (N, &argc, argv);
     31    VERBOSE = TRUE;
     32  }
    2633
    2734  dvo_catalog_init (&catalog, TRUE);
     
    6976  NPTS = 1;
    7077
    71   // XXX need to add interrupt test to this loop
    72   for (i = 0; i < skylist[0].Nregions; i++) {
     78  // grab data from all selected sky regions
     79  Signal = signal (SIGINT, handle_interrupt);
     80  interrupt = FALSE;
     81  for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) {
    7382    /* lock, load, unlock catalog */
    7483    catalog.filename = skylist[0].filename[i];
     
    7685    catalog.Nsecfilt = 0;
    7786
     87    if (VERBOSE) gprint (GP_ERR, "trying %s (%d of %d)\n", catalog.filename, i, skylist[0].Nregions);
     88     
    7889    // an error exit status here is a significant error
    7990    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
    80       fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
     91      gprint (GP_ERR, "ERROR: failure to open catalog file %s\n", catalog.filename);
    8192      exit (2);
    8293    }
    8394    dvo_catalog_unlock (&catalog);
    8495
    85     for (j = 0; j < catalog.Naverage; j++) {
     96    for (j = 0; (j < catalog.Naverage) && !interrupt; j++) {
    8697      m = catalog.average[j].offset;
    8798      // extract the relevant values
     
    105116    dvo_catalog_free (&catalog);
    106117  }
     118  signal (SIGINT, Signal);
     119  interrupt = FALSE;
    107120  for (n = 0; n < Nreturn; n++) {
    108121    vec[n][0].Nelements = Npts;
Note: See TracChangeset for help on using the changeset viewer.