IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 21, 2007, 3:38:16 PM (19 years ago)
Author:
eugene
Message:

boolean db extractions now working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/kapa-mods-2007-05/Ohana/src/opihi/dvo/dbFields.c

    r13443 r13454  
     1# include "dvoshell.h"
     2
     3dbInitField (dbField *field) {
     4  field->name = NULL;
     5  field->extract = FALSE;
     6  field->table = 0;
     7  field->ID = 0;
     8  field->magMode = 0;
     9  field->photcode = NULL;
     10}
    111
    212int GetMagMode (char *string) {
     
    1424}
    1525
    16 PhotCode *ParsePhotcodeField (char *field, int *mode, int default) {
     26PhotCode *ParsePhotcodeField (char *field, int *mode, int defMode) {
    1727
    1828  char *tmpstring, *p;
    1929  PhotCode *code;
    2030
    21   *mode = default;
     31  *mode = defMode;
    2232
    2333  p = strchr (field, ':');
     
    3949  field->magMode = (M); \
    4050  field->photcode = NULL; \
    41   return (TRUE);
     51  return (TRUE); }
    4252
    43 int ParseMeasureField (dvoField *field, char *fieldName) {
     53int ParseMeasureField (dbField *field, char *fieldName) {
    4454
     55  int mode;
    4556  PhotCode *code;
    4657
     
    6980
    7081  // check for code:mode in photcode name
    71   code = ParsePhotcodeField (&mode, MAG_REL);
     82  code = ParsePhotcodeField (fieldName, &mode, MAG_REL);
    7283  if (code == NULL) return (FALSE);
    7384
     
    8394}
    8495 
    85 int ParseAverageField (char *fieldName) {
     96int ParseAverageField (dbField *field, char *fieldName) {
    8697
     98  int mode;
    8799  PhotCode *code;
    88100
    89101  field->table = DVO_TABLE_AVERAGE;
     102  field->name  = strcreate (fieldName);
    90103
    91104  if (!strcasecmp (fieldName, "RA"))    ESCAPE (AVE_RA,        MAG_NONE);
     
    100113  if (!strcasecmp (fieldName, "dPAR"))  ESCAPE (AVE_PAR_ERR,   MAG_NONE);
    101114  if (!strcasecmp (fieldName, "MAG"))   ESCAPE (AVE_MAG,       MAG_AVE);
    102   if (!strcasecmp (fieldName, "dMAG"))  ESCAPE (AVE_dMAG,      MAG_AVE_ERR);
     115  if (!strcasecmp (fieldName, "dMAG"))  ESCAPE (AVE_dMAG,      MAG_ERR);
    103116  if (!strcasecmp (fieldName, "NMEAS")) ESCAPE (AVE_NMEAS,     MAG_NONE);
    104117  if (!strcasecmp (fieldName, "NMISS")) ESCAPE (AVE_NMISS,     MAG_NONE);
     
    114127
    115128  // check for code:mode in photcode name
    116   code = ParsePhotcodeField (&mode, MAG_AVE);
     129  code = ParsePhotcodeField (fieldName, &mode, MAG_AVE);
    117130  if (code == NULL) return (FALSE);
    118131
    119132  // need to distinguish phot, sys errors and scatter
    120133  if (mode == MAG_ERR) {
    121     field->ID = MEAS_dMAG;
     134    field->ID = AVE_dMAG;
    122135  } else {
    123     field->ID = MEAS_MAG;
     136    field->ID = AVE_MAG;
    124137  }   
    125138 
Note: See TracChangeset for help on using the changeset viewer.