Changeset 21153 for trunk/Ohana/src/opihi/dvo/dbFields.c
- Timestamp:
- Jan 22, 2009, 10:43:26 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/dbFields.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/dbFields.c
r20936 r21153 30 30 int GetMagMode (char *string) { 31 31 32 if (!strcasecmp (string, "inst")) return (MAG_INST); 33 if (!strcasecmp (string, "cat")) return (MAG_CAT); 34 if (!strcasecmp (string, "sys")) return (MAG_SYS); 35 if (!strcasecmp (string, "rel")) return (MAG_REL); 36 if (!strcasecmp (string, "cal")) return (MAG_CAL); 37 if (!strcasecmp (string, "ave")) return (MAG_AVE); 38 if (!strcasecmp (string, "ref")) return (MAG_REF); 39 if (!strcasecmp (string, "err")) return (MAG_ERR); 40 if (!strcasecmp (string, "chisq")) return (MAG_CHISQ); 41 if (!strcasecmp (string, "ncode")) return (MAG_NCODE); 42 if (!strcasecmp (string, "nphot")) return (MAG_NPHOT); 32 if (!strcasecmp (string, "inst")) return (MAG_INST); 33 if (!strcasecmp (string, "cat")) return (MAG_CAT); 34 if (!strcasecmp (string, "sys")) return (MAG_SYS); 35 if (!strcasecmp (string, "rel")) return (MAG_REL); 36 if (!strcasecmp (string, "cal")) return (MAG_CAL); 37 if (!strcasecmp (string, "ave")) return (MAG_AVE); 38 if (!strcasecmp (string, "ref")) return (MAG_REF); 39 if (!strcasecmp (string, "err")) return (MAG_ERR); 40 if (!strcasecmp (string, "photflags")) return (MAG_PHOT_FLAGS); 41 if (!strcasecmp (string, "chisq")) return (MAG_CHISQ); 42 if (!strcasecmp (string, "ncode")) return (MAG_NCODE); 43 if (!strcasecmp (string, "nphot")) return (MAG_NPHOT); 43 44 return (MAG_NONE); 44 45 } … … 75 76 } 76 77 77 78 78 // enforce compatibility 79 // XXX this is kind of poorly done 80 if ((code[0].type == PHOT_REF) && (*mode != MAG_ERR)) { 81 *mode = MAG_CAT; 82 } 83 if (code[0].type == PHOT_DEP) { 84 if (useDefault) { 79 if (useDefault) { 80 if (code[0].type == PHOT_REF) { 81 *mode = MAG_CAT; 82 } 83 if (code[0].type == PHOT_DEP) { 85 84 *mode = MAG_REL; 86 85 } … … 186 185 if (!strcasecmp (fieldName, "DETID")) ESCAPE (MEAS_DET_ID, MAG_NONE, OPIHI_INT); 187 186 if (!strcasecmp (fieldName, "OBJID")) ESCAPE (MEAS_OBJ_ID, MAG_NONE, OPIHI_INT); 187 if (!strcasecmp (fieldName, "CATID")) ESCAPE (MEAS_CAT_ID, MAG_NONE, OPIHI_INT); 188 188 if (!strcasecmp (fieldName, "IMAGEID")) ESCAPE (MEAS_IMAGE_ID, MAG_NONE, OPIHI_INT); 189 189 if (!strcasecmp (fieldName, "PSF_QF")) ESCAPE (MEAS_PSF_QF, MAG_NONE, OPIHI_FLT); … … 206 206 field->ID = MEAS_MAG; 207 207 field->magMode = mode; 208 field->type = OPIHI_FLT; 208 switch (mode) { 209 case MAG_NCODE: 210 case MAG_NPHOT: 211 case MAG_PHOT_FLAGS: 212 field->type = OPIHI_INT; 213 break; 214 default: 215 field->type = OPIHI_FLT; 216 break; 217 } 209 218 field->photcode = code; 210 219 return (TRUE); … … 280 289 field->ID = AVE_MAG; 281 290 field->magMode = mode; 282 field->type = OPIHI_FLT; 291 switch (mode) { 292 case MAG_NCODE: 293 case MAG_NPHOT: 294 case MAG_PHOT_FLAGS: 295 field->type = OPIHI_INT; 296 break; 297 default: 298 field->type = OPIHI_FLT; 299 break; 300 } 283 301 field->photcode = code; 284 302 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
