IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 6, 2013, 3:30:44 PM (13 years ago)
Author:
eugene
Message:

option to specify output format for fits table columns; add dbinsert; pass db info on command line; option to make a guess for vgauss; option to rename a spline; option to get results files for remote clients; some improvments to gstar (sorting, optional fields)

Location:
trunk/Ohana/src/opihi
Files:
17 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi

  • trunk/Ohana/src/opihi/cmd.astro

  • trunk/Ohana/src/opihi/cmd.data

  • trunk/Ohana/src/opihi/cmd.data/Makefile

    r34584 r35109  
    4242$(SRC)/dbconnect.$(ARCH).o      \
    4343$(SRC)/dbselect.$(ARCH).o       \
     44$(SRC)/dbinsert.$(ARCH).o       \
    4445$(SRC)/erase.$(ARCH).o          \
    4546$(SRC)/extract.$(ARCH).o        \
  • trunk/Ohana/src/opihi/cmd.data/dbconnect.c

    r34584 r35109  
    88int dbconnect (int argc, char **argv) {
    99 
     10  int N;
    1011  char query[256];
    11   char password[1024];
    1212  MYSQL_RES *result;
     13
     14  char *password = NULL;
     15  if ((N = get_argument (argc, argv, "-p"))) {
     16    remove_argument (N, &argc, argv);
     17    password = strcreate (argv[N]);
     18    remove_argument (N, &argc, argv);
     19  }
    1320
    1421  if (argc != 4) {
     
    1724  }
    1825
    19   fprintf (stdout, "Enter password: ");
    20   scan_line (stdin, password);
     26  if (!password) {
     27      ALLOCATE (password, char, 1024);
     28      fprintf (stdout, "Enter password: ");
     29      scan_line (stdin, password);
    2130
    2231# if (0)
    23   int i;
    24   char c;
     32      int i;
     33      char c;
    2534
    26   initscr();
    27   noecho();
    28   i = 0;
    29   while (((c = getch()) != EOF) && (c != '\n')) {
    30     password[i] = c;
    31     i++;
     35      initscr();
     36      noecho();
     37      i = 0;
     38      while (((c = getch()) != EOF) && (c != '\n')) {
     39          password[i] = c;
     40          i++;
     41      }
     42      password[i] = 0;
     43# endif
    3244  }
    33   password[i] = 0;
    34 # endif
    3545
    3646  // XXX do I need to call mysql_library_init()?
  • trunk/Ohana/src/opihi/cmd.data/init.c

    r34584 r35109  
    2424int dbconnect        PROTO((int, char **));
    2525int dbselect         PROTO((int, char **));
     26int dbinsert         PROTO((int, char **));
    2627int delete           PROTO((int, char **));
    2728int densify          PROTO((int, char **));
     
    170171  {1, "dbconnect",    dbconnect,        "setup mysql db connection"},
    171172  {1, "dbselect",     dbselect,         "extract vectors from mysql database table"},
     173  {1, "dbinsert",     dbinsert,         "sql insert command"},
    172174  {1, "delete",       delete,           "delete vectors or images"},
    173175  {1, "densify",      densify,          "create an image histogram from a set of vectors"},
  • trunk/Ohana/src/opihi/cmd.data/spline.c

    r34584 r35109  
    22
    33int spline_list (int argc, char **argv);
     4int spline_help (int argc, char **argv);
    45int spline_create (int argc, char **argv);
    56int spline_apply (int argc, char **argv);
     
    78int spline_save (int argc, char **argv);
    89int spline_delete (int argc, char **argv);
     10int spline_rename (int argc, char **argv);
    911int spline_getspline (int argc, char **argv);
    1012
    1113static Command spline_commands[] = {
     14  {1, "help",       spline_help,       "list spline help info"},
    1215  {1, "list",       spline_list,       "list splines"},
    1316  {1, "create",     spline_create,     "create a spline"},
     
    1619  {1, "save",       spline_save,       "read a spline from a FITS file"},
    1720  {1, "delete",     spline_delete,     "delete a spline"},
     21  {1, "rename",     spline_rename,     "rename a spline"},
    1822};
     23
     24int spline_help (int argc, char **argv) {
     25
     26  gprint (GP_ERR, "USAGE: spline (command)\n");
     27  gprint (GP_ERR, "    spline help                                  : this listing\n");
     28  gprint (GP_ERR, "    spline list                                  : list splines\n");
     29  gprint (GP_ERR, "    spline create (spline) (Xknots) (Yknots)     : create a spline\n");
     30  gprint (GP_ERR, "    spline apply  (spline) (Xpts) (Ypts)         : apply a spline to Xpts to get Ypts\n");
     31  gprint (GP_ERR, "    spline delete (spline)                       : delete named spline\n");
     32  gprint (GP_ERR, "    spline rename (spline) (new)                 : change spline name to new name\n");
     33  gprint (GP_ERR, "    spline load   (spline) (filename)            : load a spline from a FITS file\n");
     34  gprint (GP_ERR, "    spline save   (spline) (filename) [-append]  : save a spline in FITS format\n");
     35
     36  return FALSE;
     37}
    1938
    2039int spline_command (int argc, char **argv) {
     
    2342
    2443  if (argc < 2) {
    25     gprint (GP_ERR, "USAGE: spline (command)\n");
    26     gprint (GP_ERR, "    spline list                                    : list splines\n");
    27     gprint (GP_ERR, "    spline create   (spline)                       : create a spline\n");
    28     gprint (GP_ERR, "    spline delete   (spline)                       : delete a spline\n");
     44    spline_help(0,NULL);
    2945    return (FALSE);
    3046  }
  • trunk/Ohana/src/opihi/cmd.data/spline_commands.c

    r34584 r35109  
    126126}
    127127
     128int spline_rename (int argc, char **argv) {
     129
     130  Spline *spline;
     131
     132  if (argc != 3) {
     133    gprint (GP_ERR, "USAGE: spline rename (spline) (newname)\n");
     134    return FALSE;
     135  }
     136
     137  spline = FindSpline (argv[1]);
     138  if (spline == NULL) {
     139    gprint (GP_ERR, "spline %s not found\n", argv[1]);
     140    return FALSE;
     141  }
     142
     143  free (spline->name);
     144  spline->name = strcreate (argv[2]);
     145  return TRUE;
     146}
     147
    128148/*
    129149int spline_listspline (int argc, char **argv) {
  • trunk/Ohana/src/opihi/cmd.data/subset.c

    r34461 r35109  
    3535  }
    3636  if ((tvec = SelectVector (out, OLDVECTOR, TRUE)) == NULL) goto error;
    37   /* check size of ivec, tvec: must match */
     37  if (ivec->Nelements != tvec->Nelements) {
     38    /* check size of ivec, tvec: must match */
     39    gprint (GP_ERR, "logical expression has different length from input vector\n");
     40    goto error;
     41  }
    3842
    3943  // ovec matches ivec in type
  • trunk/Ohana/src/opihi/cmd.data/vgauss.c

    r29938 r35109  
    3131  }
    3232
     33//   Guess = FALSE;
     34//   if ((N = get_argument (argc, argv, "-guess"))) {
     35//     Guess = TRUE;
     36//     remove_argument (N, &argc, argv);
     37//   }
     38
    3339  if (argc != 5) {
    3440    gprint (GP_ERR, "USAGE: vgauss <x> <y> <dy> (out)\n");
     41    gprint (GP_ERR, "  <dy> may be the words 'con[stant]' or 'poi[sson]', in which case the error is constructed'\n");
    3542    gprint (GP_ERR, " uses guesses: C0 (mean), C1 (sigma), C2 (norm), C3 (sky)\n");
    3643    return (FALSE);
     
    3946  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
    4047  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
    41   if ((svec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
    4248  if ((ovec = SelectVector (argv[4], ANYVECTOR, TRUE)) == NULL) return (FALSE);
     49
     50  int Nsvec = strlen(argv[3]);
     51
     52  if ((Nsvec >= 3) && (!strncasecmp ("poisson", argv[3], Nsvec) || !strncasecmp ("constant", argv[3], Nsvec))) {
     53    svec = SelectVector ("vgauss_err", ANYVECTOR, TRUE);
     54    if (svec == NULL) return (FALSE);
     55    MatchVector (svec, xvec, OPIHI_FLT);
     56    v1 = svec[0].elements.Flt;
     57    v2 = yvec[0].elements.Flt;
     58    if (!strncasecmp ("poisson", argv[3], Nsvec)) {
     59      for (i = 0; i < svec[0].Nelements; i++) {
     60        v1[i] = (isfinite(v2[i]) && (v2[i] > 0)) ? sqrt(v2[i]) : 1.0;
     61      }
     62    } else {
     63      for (i = 0; i < svec[0].Nelements; i++) {
     64        v1[i] = 1.0;
     65      }
     66    }
     67  } else {
     68    if ((svec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
     69  }
    4370
    4471  CastVector (xvec, OPIHI_FLT);
     
    4673  CastVector (svec, OPIHI_FLT);
    4774  // XXX Cast is failing.
    48    
    4975
    5076  Npts = xvec[0].Nelements;
     
    5884  GET_VAR (par[3], "C3");
    5985  Npar = 4;
     86
    6087
    6188  // mrqmin takes the inverse variance (do not generate NANs)
  • trunk/Ohana/src/opihi/cmd.data/vstats.c

    r33963 r35109  
    123123
    124124    ALLOCATE (Nval, int, Nbin + 2);
    125     bzero (Nval, Nbin*sizeof(int));
     125    bzero (Nval, (Nbin + 2)*sizeof(int));
    126126    var = 0;
    127127    if (vec[0].type == OPIHI_FLT) {
  • trunk/Ohana/src/opihi/cmd.data/write_vectors.c

    r34584 r35109  
    1010  Vector **vec;
    1111
     12  if ((N = get_argument (argc, argv, "-h"))) goto usage;
     13  if ((N = get_argument (argc, argv, "--h"))) goto usage;
     14  if ((N = get_argument (argc, argv, "-help"))) goto usage;
     15  if ((N = get_argument (argc, argv, "--help"))) goto usage;
     16
    1217  /* look for format option */
    1318  format = (char *) NULL;
     
    1722    remove_argument (N, &argc, argv);
    1823  }
     24  if ((N = get_argument (argc, argv, "-format"))) {
     25    if (format) {
     26      gprint (GP_ERR, "ERROR: do not mix -f and -format\n");
     27      free (format);
     28      return (FALSE);
     29    }
     30    remove_argument (N, &argc, argv);
     31    format = strcreate (argv[N]);
     32    remove_argument (N, &argc, argv);
     33  }
    1934
    2035  /* option generate a FITS output table */
    2136  FITS = NULL;
    2237  if ((N = get_argument (argc, argv, "-fits"))) {
    23     if (format) {
    24       gprint (GP_ERR, "ERROR: do not mix -fits and -format\n");
    25       free (format);
    26       return (FALSE);
    27     }
    2838    remove_argument (N, &argc, argv);
    2939    FITS = strcreate (argv[N]);
     
    6171
    6272  if (argc < 3) {
    63     gprint (GP_ERR, "USAGE: write [-append] [-f \"format\"] file vector vector ...\n");
     73    gprint (GP_ERR, "USAGE: write [options] file vector vector ...\n");
     74    gprint (GP_ERR, "OPTIONS: [-header] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n");
    6475    return (FALSE);
    6576  }
     
    222233  return (TRUE);
    223234
     235 usage:
     236    gprint (GP_ERR, "USAGE: write [options] file vector vector ...\n");
     237    gprint (GP_ERR, "OPTIONS: [-header] [-append] [-f \"format\"] [-fits NAME] [-csv] [-h,--help]\n\n");
     238
     239    gprint (GP_ERR, "OPTIONS: \n");
     240    gprint (GP_ERR, "  -header : add a descriptive header line to ascii or csv output\n");
     241    gprint (GP_ERR, "  -append : write to the end of the existing file\n");
     242    gprint (GP_ERR, "  -fits NAME : write a fits table (extention name is NAME, column names match vector names)\n");
     243    gprint (GP_ERR, "  -csv : write a comma-separated values file (eg, to read in excel)\n");
     244    gprint (GP_ERR, "  -f \"format\" : provide formatting codes for output:\n");
     245    gprint (GP_ERR, "    ascii / csv : format consists of c-style format codes in form %NN.Md\n");
     246    gprint (GP_ERR, ",     the following codes are allowed\n");
     247    gprint (GP_ERR, "        %e -- double, %f -- float\n");
     248    gprint (GP_ERR, "        %d -- int, %c -- char, %x -- hex int\n");
     249    gprint (GP_ERR, "    FITS : format consists of the following FITS binary table format codes:\n");
     250    gprint (GP_ERR, "      B : 1 byte int\n");   
     251    gprint (GP_ERR, "      I : 2 byte int\n");   
     252    gprint (GP_ERR, "      J : 4 byte int\n");   
     253    gprint (GP_ERR, "      K : 8 byte int\n");   
     254    gprint (GP_ERR, "      D : 4 byte float\n");   
     255    gprint (GP_ERR, "      F : 1 byte float\n");   
     256    gprint (GP_ERR, "   -h : this help listing\n");
     257    gprint (GP_ERR, "   --h : this help listing\n");
     258    gprint (GP_ERR, "   -help : this help listing\n");
     259    gprint (GP_ERR, "   --help : this help listing\n");
     260    return FALSE;
    224261}
    225262
  • trunk/Ohana/src/opihi/dvo/dvo_host_utils.c

    r34749 r35109  
    295295  return TRUE;
    296296}
     297
     298// re-gather the remote results files: this can be used in case one of the clients failed,
     299// and has since been re-run
     300int HostTableGetResults (char *uniquer, int VERBOSE) {
     301
     302  int i;
     303
     304  // load the list of hosts
     305  SkyTable *sky = GetSkyTable();
     306  if (!sky) {
     307    gprint (GP_ERR, "failed to load sky table for database\n");
     308    return FALSE;
     309  }
     310
     311  char *CATDIR = GetCATDIR ();
     312  if (!CATDIR) {
     313    gprint (GP_ERR, "failed to get CATDIR for database\n");
     314    return FALSE;
     315  }
     316
     317  HostTable *table = HostTableLoad (CATDIR, sky->hosts);
     318  if (!table) {
     319    gprint (GP_ERR, "ERROR: failure reading Host Table %s for database %s\n", sky->hosts, CATDIR);
     320    return FALSE;
     321  }   
     322
     323  // create the result file list
     324  char name[256];
     325  snprintf (name, 256, "RESULT_FILE:n");
     326  set_int_variable (name, table->Nhosts);
     327  snprintf (name, 256, "RESULT_DATA:n");
     328  set_int_variable (name, table->Nhosts);
     329  snprintf (name, 256, "RESULT_STATUS:n");
     330  set_int_variable (name, table->Nhosts);
     331
     332  char results[DVO_MAX_PATH];
     333
     334  // load fields from file
     335  for (i = 0; i < table->Nhosts; i++) {
     336
     337    // need to save the results filename with the uniquer
     338    snprintf (results, DVO_MAX_PATH, "%s/dvo.results.%s.fits", table->hosts[i].pathname, uniquer);
     339
     340    snprintf (name, 256, "RESULT_FILE:%d", i);
     341    set_str_variable (name, results);
     342
     343    // DATA : 0 (unread), 1 (read)
     344    snprintf (name, 256, "RESULT_DATA:%d", i);
     345    set_int_variable (name, 0);
     346
     347    // STATUS : 0 (normal exit), -1 (crash), N (failure exit status)
     348    snprintf (name, 256, "RESULT_STATUS:%d", i);
     349    set_int_variable (name, table->hosts[i].status);
     350  }
     351
     352  free (table);
     353  return TRUE;
     354}
  • trunk/Ohana/src/opihi/dvo/gstar.c

    r34844 r35109  
    11# include "dvoshell.h"
     2
     3typedef enum {
     4  GSTAR_BY_SEQ,
     5  GSTAR_BY_TIME,
     6  GSTAR_BY_PHOTCODE,
     7} GSTAR_SORT_CODES;
    28
    39typedef enum {
     
    713  GSTAR_FILTER_NAMES,
    814  GSTAR_SECF_FLAGS,
     15  GSTAR_UCDIST,
    916  GSTAR_AVE_AP_MAG,
    1017  GSTAR_AVE_MAG_20,
     
    2229void printPhotcodeSequence (Average *average, SecFilt *secfilt, int entry, int type);
    2330
     31void sort_index_float (float *X, int *IDX, int N) {
     32
     33# define SWAPFUNC(A,B){ float tmp; int itmp;    \
     34  tmp = X[A]; X[A] = X[B]; X[B] = tmp; \
     35  itmp = IDX[A]; IDX[A] = IDX[B]; IDX[B] = itmp; \
     36}
     37# define COMPARE(A,B)(X[A] < X[B])
     38
     39  OHANA_SORT (N, COMPARE, SWAPFUNC);
     40
     41# undef SWAPFUNC
     42# undef COMPARE
     43
     44}
     45
    2446int gstar (int argc, char **argv) {
    2547 
     
    3052  off_t i, Nstars, *N1;
    3153  off_t j, k, m, N, Nlo, Nhi;
    32   int Nsecfilt, NPTS, QUIET, FULL_OUTPUT, STACK_OUTPUT, INST;
     54  int Nsecfilt, NPTS, QUIET, FULL_OUTPUT, STACK_OUTPUT, INST, SHOW_MASKS;
    3355  int found, GetMeasures;
    3456  int SaveVectors;
     
    4365  Nsecfilt = GetPhotcodeNsecfilt ();
    4466
     67  GSTAR_SORT_CODES sortCode = GSTAR_BY_SEQ;
     68  if ((N = get_argument (argc, argv, "-sort"))) {
     69    remove_argument (N, &argc, argv);
     70    if (!strcasecmp (argv[N], "time")) {
     71      sortCode = GSTAR_BY_TIME;
     72    }
     73    if (!strcasecmp (argv[N], "photcode")) {
     74      sortCode = GSTAR_BY_PHOTCODE;
     75    }
     76    remove_argument (N, &argc, argv);
     77  }
     78
    4579  QUIET = FALSE;
    4680  if ((N = get_argument (argc, argv, "-q"))) {
     
    5286  if ((N = get_argument (argc, argv, "-inst"))) {
    5387    INST = TRUE;
     88    remove_argument (N, &argc, argv);
     89  }
     90
     91  SHOW_MASKS = FALSE;
     92  if ((N = get_argument (argc, argv, "-masks"))) {
     93    SHOW_MASKS = TRUE;
    5494    remove_argument (N, &argc, argv);
    5595  }
     
    275315          gprint (GP_LOG, "\n");
    276316
     317          /* UCDIST */
     318          for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, GSTAR_UCDIST);;
     319          gprint (GP_LOG, "\n");
     320
    277321          /* secfilt flags */
    278322          for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, GSTAR_SECF_FLAGS);
     
    300344      }
    301345      if (GetMeasures || SaveVectors) {
     346
     347        if (catalog.average[k].Nmeasure == 0) continue;
     348
    302349        m = catalog.average[k].measureOffset;
     350
     351        int *index = NULL;
     352        float *value = NULL;
     353        ALLOCATE (index, int, catalog.average[k].Nmeasure);
     354        ALLOCATE (value, float, catalog.average[k].Nmeasure);
     355        for (j = 0; j < catalog.average[k].Nmeasure; j++) {
     356          index[j] = j + m;
     357          switch (sortCode) {
     358            case GSTAR_BY_SEQ:
     359              value[j] = j + m;
     360              break;
     361            case GSTAR_BY_PHOTCODE:
     362              value[j] = catalog.measure[j + m].photcode;
     363              break;
     364            case GSTAR_BY_TIME:
     365              value[j] = catalog.measure[j + m].t;
     366              break;
     367          }
     368        }
     369
     370        sort_index_float (value, index, catalog.average[k].Nmeasure);
     371
    303372        for (j = 0; j < catalog.average[k].Nmeasure; j++, m++) {
    304373
    305           Mcat = PhotCat (&catalog.measure[m]);
     374          int Nv = index[j];
     375
     376          Mcat = PhotCat (&catalog.measure[Nv]);
    306377          if (INST) {
    307             Mrel = PhotInst (&catalog.measure[m]);
     378            Mrel = PhotInst (&catalog.measure[Nv]);
    308379          } else {
    309             Mrel = PhotRel (&catalog.measure[m], &catalog.average[k], &catalog.secfilt[k*Nsecfilt]);
     380            Mrel = PhotRel (&catalog.measure[Nv], &catalog.average[k], &catalog.secfilt[k*Nsecfilt]);
    310381          }
    311382
    312383          if (GetMeasures && !QUIET) {
    313             date = ohana_sec_to_date (catalog.measure[m].t);
     384            date = ohana_sec_to_date (catalog.measure[Nv].t);
    314385            gprint (GP_LOG, "%6.3f ",  Mcat);
    315386            gprint (GP_LOG, "%6.3f ",  Mrel);
    316             gprint (GP_LOG, "%5.3f  ", catalog.measure[m].dM);
     387            gprint (GP_LOG, "%6.3f  ", catalog.measure[Nv].dM);
    317388            gprint (GP_LOG, "%20s  ",  date);
    318             gprint (GP_LOG, "%7.4f ",  catalog.measure[m].dR);
    319             gprint (GP_LOG, "%7.4f ",  catalog.measure[m].dD);
    320             gprint (GP_LOG, "0x%08x ", catalog.measure[m].photFlags);
    321             gprint (GP_LOG, "0x%08x ", catalog.measure[m].dbFlags);
    322             gprint (GP_LOG, "%5d ",    catalog.measure[m].photcode);
    323             gprint (GP_LOG, "%-20s ",  GetPhotcodeNamebyCode (catalog.measure[m].photcode));
    324             gprint (GP_LOG, "%5.2f ",  FromShortPixels(catalog.measure[m].FWx));
    325             gprint (GP_LOG, "%5.2f ",  FromShortPixels(catalog.measure[m].FWy));
     389            gprint (GP_LOG, "%7.4f ",  catalog.measure[Nv].dR);
     390            gprint (GP_LOG, "%7.4f ",  catalog.measure[Nv].dD);
     391            gprint (GP_LOG, "0x%08x ", catalog.measure[Nv].photFlags);
     392            gprint (GP_LOG, "0x%08x ", catalog.measure[Nv].dbFlags);
     393            if (SHOW_MASKS) {
     394              gprint (GP_LOG, "%5d ",    catalog.measure[Nv].photcode);
     395              PhotCode *code = GetPhotcodebyCode (catalog.measure[Nv].photcode);
     396              int badMask = 0;
     397              int poorMask = 0;
     398              if (code) {
     399                badMask = catalog.measure[Nv].photFlags & code->photomBadMask;
     400                poorMask = catalog.measure[Nv].photFlags & code->photomPoorMask;
     401              }
     402              gprint (GP_LOG, "0x%08x ", poorMask);
     403              gprint (GP_LOG, "0x%08x ", badMask);
     404            }
     405            gprint (GP_LOG, "%5d ",    catalog.measure[Nv].photcode);
     406            gprint (GP_LOG, "%-20s ",  GetPhotcodeNamebyCode (catalog.measure[Nv].photcode));
     407            gprint (GP_LOG, "%5.2f ",  FromShortPixels(catalog.measure[Nv].FWx));
     408            gprint (GP_LOG, "%5.2f ",  FromShortPixels(catalog.measure[Nv].FWy));
    326409
    327410            if (FULL_OUTPUT) {
    328                 gprint (GP_LOG, "%6.3f ", catalog.measure[m].Mcal);
    329                 gprint (GP_LOG, "%6.3f ", catalog.measure[m].Map);
    330                 gprint (GP_LOG, "%6.3f ", catalog.measure[m].Mkron);
    331                 gprint (GP_LOG, "%6.3f ", catalog.measure[m].dMkron);
    332                 gprint (GP_LOG, "%5.1f ", pow(10.0, 0.4*catalog.measure[m].dt));
    333                 gprint (GP_LOG, "%5.3f ", catalog.measure[m].airmass);
    334                 gprint (GP_LOG, "%6.1f ", catalog.measure[m].az);
    335                 gprint (GP_LOG, "%6.1f ", catalog.measure[m].Xccd);
    336                 gprint (GP_LOG, "%6.1f ", catalog.measure[m].Yccd);
    337                 gprint (GP_LOG, "%3.1f ", FromShortPixels(catalog.measure[m].dXccd));
    338                 gprint (GP_LOG, "%3.1f ", FromShortPixels(catalog.measure[m].dYccd));
    339                 gprint (GP_LOG, "%6.1f ", catalog.measure[m].Sky);
    340                 gprint (GP_LOG, "%5.1f ", catalog.measure[m].dSky);
    341                 gprint (GP_LOG, "%8d ", catalog.measure[m].averef);
    342                 gprint (GP_LOG, "0x%08x ", catalog.measure[m].detID);
    343                 gprint (GP_LOG, "0x%08x ", catalog.measure[m].imageID);
    344                 gprint (GP_LOG, "%.3f ", catalog.measure[m].psfQF);
    345                 gprint (GP_LOG, "%.1f ", catalog.measure[m].psfChisq);
    346                 gprint (GP_LOG, "%.1f ", catalog.measure[m].crNsigma);
    347                 gprint (GP_LOG, "%.1f ", catalog.measure[m].extNsigma);
    348                 gprint (GP_LOG, "%.1f ", FromShortDegrees(catalog.measure[m].theta));
     411                gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].Mcal);
     412                gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].Map);
     413                gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].Mkron);
     414                gprint (GP_LOG, "%6.3f ", catalog.measure[Nv].dMkron);
     415                gprint (GP_LOG, "%5.1f ", pow(10.0, 0.4*catalog.measure[Nv].dt));
     416                gprint (GP_LOG, "%5.3f ", catalog.measure[Nv].airmass);
     417                gprint (GP_LOG, "%6.1f ", catalog.measure[Nv].az);
     418                gprint (GP_LOG, "%6.1f ", catalog.measure[Nv].Xccd);
     419                gprint (GP_LOG, "%6.1f ", catalog.measure[Nv].Yccd);
     420                gprint (GP_LOG, "%3.1f ", FromShortPixels(catalog.measure[Nv].dXccd));
     421                gprint (GP_LOG, "%3.1f ", FromShortPixels(catalog.measure[Nv].dYccd));
     422                gprint (GP_LOG, "%6.1f ", catalog.measure[Nv].Sky);
     423                gprint (GP_LOG, "%5.1f ", catalog.measure[Nv].dSky);
     424                gprint (GP_LOG, "%8d ", catalog.measure[Nv].averef);
     425                gprint (GP_LOG, "0x%08x ", catalog.measure[Nv].detID);
     426                gprint (GP_LOG, "0x%08x ", catalog.measure[Nv].imageID);
     427                gprint (GP_LOG, "%.3f ", catalog.measure[Nv].psfQF);
     428                gprint (GP_LOG, "%.1f ", catalog.measure[Nv].psfChisq);
     429                gprint (GP_LOG, "%.1f ", catalog.measure[Nv].crNsigma);
     430                gprint (GP_LOG, "%.1f ", catalog.measure[Nv].extNsigma);
     431                gprint (GP_LOG, "%.1f ", FromShortDegrees(catalog.measure[Nv].theta));
    349432            }
    350433            if (STACK_OUTPUT) {
    351                 gprint (GP_LOG, "%10.3e ", catalog.measure[m].FluxPSF);
    352                 gprint (GP_LOG, "%10.3e ", catalog.measure[m].dFluxPSF);
    353                 gprint (GP_LOG, "%10.3e ", catalog.measure[m].FluxKron);
    354                 gprint (GP_LOG, "%10.3e ", catalog.measure[m].dFluxKron);
     434                gprint (GP_LOG, "%10.3e ", catalog.measure[Nv].FluxPSF);
     435                gprint (GP_LOG, "%10.3e ", catalog.measure[Nv].dFluxPSF);
     436                gprint (GP_LOG, "%10.3e ", catalog.measure[Nv].FluxKron);
     437                gprint (GP_LOG, "%10.3e ", catalog.measure[Nv].dFluxKron);
    355438            }
    356439            gprint (GP_LOG, "\n");
     
    361444          if (SaveVectors) {
    362445            vec1[0].elements.Flt[N] = Mcat;
    363             vec2[0].elements.Flt[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat);
    364             vec3[0].elements.Flt[N] = catalog.measure[m].airmass;
    365             vec4[0].elements.Flt[N] = catalog.measure[m].photcode;
    366             vec5[0].elements.Flt[N] = catalog.measure[m].dR;
    367             vec6[0].elements.Flt[N] = catalog.measure[m].dD;
     446            vec2[0].elements.Flt[N] = TimeValue (catalog.measure[Nv].t, TimeReference, TimeFormat);
     447            vec3[0].elements.Flt[N] = catalog.measure[Nv].airmass;
     448            vec4[0].elements.Flt[N] = catalog.measure[Nv].photcode;
     449            vec5[0].elements.Flt[N] = catalog.measure[Nv].dR;
     450            vec6[0].elements.Flt[N] = catalog.measure[Nv].dD;
    368451            N ++;
    369452            if (N == NPTS - 1) {
     
    378461          }
    379462        }
     463        free (value);
     464        free (index);
    380465      }
    381466    }
     
    495580      break;
    496581
     582    case GSTAR_UCDIST: /* ubercal distance */
     583      if (seq == -1) {
     584        gprint (GP_LOG, "%5d ", 0);
     585      } else {
     586        gprint (GP_LOG, "%5d ", secfilt[seq].ubercalDist);
     587      }
     588      break;
     589
    497590    case GSTAR_AVE_AP_MAG: /* average ap mags */
    498591      if (seq == -1) {
  • trunk/Ohana/src/opihi/dvo/remote.c

    r34749 r35109  
    2626    gprint (GP_ERR, "  -v : verbose mode:\n");
    2727    gprint (GP_ERR, "OR:    remote -reload (uniquer)\n");
     28    gprint (GP_ERR, "OR:    remote -get-results (uniquer)\n");
    2829    return FALSE;
    2930  }
     
    4849  }
    4950
     51  if ((N = get_argument (argc, argv, "-get-results"))) {
     52    remove_argument (N, &argc, argv);
     53    if (argc != 2) {
     54      gprint (GP_ERR, "USAGE: remote -get-results (uniquer)\n");
     55      gprint (GP_ERR, " (uniquer) is the element in the middle of the results file\n");
     56      gprint (GP_ERR, " eg: dvo.results.XXXXX.YYYYY.fits\n");
     57      return FALSE;
     58    }
     59    int status = HostTableGetResults (argv[1], VERBOSE);
     60    return status;
     61  }
     62
    5063  // strip of the 'remote' and send the remaining arguments to the remote machine
    5164  int status = HostTableParallelOps (argc - 1, &argv[1], NULL, ReadVectors, 0, VERBOSE);
  • trunk/Ohana/src/opihi/include/dvoshell.h

    r34749 r35109  
    102102int          HostTableParallelOps   PROTO((int argc, char **argv, char *ResultFile, int ReadVectors, int Nelements, int VERBOSE));
    103103int          HostTableReloadResults PROTO((char *uniquer, int VERBOSE));
     104int          HostTableGetResults    PROTO((char *uniquer, int VERBOSE));
    104105
    105106# endif // DVOSHELL_H
  • trunk/Ohana/src/opihi/lib.shell/VectorIO.c

    r34584 r35109  
    2323        goto escape;
    2424      }
    25       if ((*ptr != 'B') && (*ptr != 'I') && (*ptr != 'J') && (*ptr != 'D') && (*ptr != 'E')) {
     25      if ((*ptr != 'B') && (*ptr != 'I') && (*ptr != 'J') && (*ptr != 'K') && (*ptr != 'D') && (*ptr != 'E')) {
    2626        gprint (GP_ERR, "error in binary table format %s: invalid character %c\n", format, *ptr);
    2727        goto escape;
Note: See TracChangeset for help on using the changeset viewer.