IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 31, 2012, 4:02:00 PM (14 years ago)
Author:
eugene
Message:

add PS1_V4 schema; add set mean fluxes based on stacks; define the primary image ID (based on distance from center or boundary tree) and set mean flux from stacks based on that info; fix (uniquify) psps ID for stack detections; mean fluxes are in Jy; detection fluxes are instrumental counts per second

File:
1 edited

Legend:

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

    r34088 r34260  
    22# include <glob.h>
    33# define DVO_MAX_PATH 1024
     4
     5enum {TEMP_NONE, TEMP_DVO_RESULTS, TEMP_DVO_LOG, TEMP_RELPHOT_RESULTS, TEMP_RELPHOT_LOG};
    46
    57// functions to manage the remote hosts
     
    1012    gprint (GP_ERR, "  commands:\n");
    1113    gprint (GP_ERR, "    purge-temp : delete all tempfiles for this shell\n");
     14    gprint (GP_ERR, "               : [-old-pid] [-all-pid] [-v] [-verbose] [-commit] [-type type]\n");
     15    gprint (GP_ERR, "    get-results : determine name of RESULTS file\n");
    1216    return FALSE;
    1317  }
     
    2731      remove_argument (N, &argc, argv);
    2832      ALL_PID = TRUE;
    29       remove_argument (N, &argc, argv);
    3033    }
    3134   
     
    4649    }
    4750   
     51    // we have the following types of temp files:
     52    // dvo.results.*.fits
     53    // dvo.results.*.fits.log
     54    // log.rlpc.* (relphot logs)
     55    // relphot.catalog.subset.dat [no glob needed]
     56    int TEMP_TYPE = TEMP_DVO_RESULTS;
     57    if ((N = get_argument (argc, argv, "-type"))) {
     58      TEMP_TYPE = TEMP_NONE;
     59      remove_argument (N, &argc, argv);
     60      if (!strcasecmp(argv[N], "dvo.results"))     TEMP_TYPE = TEMP_DVO_RESULTS;
     61      if (!strcasecmp(argv[N], "dvo.log"))         TEMP_TYPE = TEMP_DVO_LOG;
     62      if (!strcasecmp(argv[N], "relphot.results")) TEMP_TYPE = TEMP_RELPHOT_RESULTS;
     63      if (!strcasecmp(argv[N], "relphot.log"))     TEMP_TYPE = TEMP_RELPHOT_LOG;
     64      if (TEMP_TYPE == TEMP_NONE) {
     65        gprint (GP_ERR, "USAGE: hosts purge-temp [-type (type)]\n");
     66        gprint (GP_ERR, "  allowed types dvo.results, dvo.log, relphot.results, relphot.log]\n");
     67        return FALSE;
     68      }
     69      remove_argument (N, &argc, argv);
     70    }
     71
    4872    // XXX wrap this up in a function:
    4973    char *CATDIR = GetCATDIR();
     
    6387    }   
    6488   
     89    if (argc != 2) {
     90      gprint (GP_ERR, "USAGE: hosts purge-temp [-all-pid] [-old-pid PID] [-verbose] [-commit]\n");
     91      return FALSE;
     92    }
     93
    6594    int i;
    6695    for (i = 0; i < table->Nhosts; i++) {
     
    6897      char name[DVO_MAX_PATH];
    6998      if (ALL_PID) {
    70         snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.*.fits", table->hosts[i].pathname);
     99        if (TEMP_TYPE == TEMP_DVO_RESULTS)     snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.fits", table->hosts[i].pathname);
     100        if (TEMP_TYPE == TEMP_DVO_LOG)         snprintf (name, DVO_MAX_PATH, "%s/dvo.results.*.fits.log", table->hosts[i].pathname);
     101        if (TEMP_TYPE == TEMP_RELPHOT_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/log.rlpc.*", table->hosts[i].pathname);
     102        if (TEMP_TYPE == TEMP_RELPHOT_LOG)     snprintf (name, DVO_MAX_PATH, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);
    71103      } else {
    72         snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits", table->hosts[i].pathname, PID);
     104        if (TEMP_TYPE == TEMP_DVO_RESULTS)     snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits", table->hosts[i].pathname, PID);
     105        if (TEMP_TYPE == TEMP_DVO_LOG)         snprintf (name, DVO_MAX_PATH, "%s/dvo.results.%05d.*.fits.log", table->hosts[i].pathname, PID);
     106        if (TEMP_TYPE == TEMP_RELPHOT_RESULTS) snprintf (name, DVO_MAX_PATH, "%s/log.rlpc.*", table->hosts[i].pathname);
     107        if (TEMP_TYPE == TEMP_RELPHOT_LOG)     snprintf (name, DVO_MAX_PATH, "%s/relphot.catalog.subset.dat", table->hosts[i].pathname);
    73108      }
    74109      if (VERBOSE) gprint (GP_ERR, "checking %s\n", name);
     
    108143  }
    109144
    110  
    111 
    112145  gprint (GP_ERR, "error: unknown hosts command %s\n", argv[1]);
    113146  return FALSE;
Note: See TracChangeset for help on using the changeset viewer.