Changeset 12061 for trunk/ippdb/src/ippdb.c
- Timestamp:
- Feb 26, 2007, 1:56:44 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippdb/src/ippdb.c (modified) (88 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/src/ippdb.c
r12033 r12061 6709 6709 static void chipProcessedImfileRowFree(chipProcessedImfileRow *object); 6710 6710 6711 chipProcessedImfileRow *chipProcessedImfileRowAlloc(const char *exp_tag, psS32 chip_version, psS32 guide_version, const char *class_id, const char *recipe, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)6711 chipProcessedImfileRow *chipProcessedImfileRowAlloc(const char *exp_tag, psS32 chip_version, psS32 guide_version, const char *class_id, const char *recipe, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 6712 6712 { 6713 6713 chipProcessedImfileRow *_object; … … 6725 6725 _object->bg_stdev = bg_stdev; 6726 6726 _object->bg_mean_stdev = bg_mean_stdev; 6727 _object->b1_uri = psStringCopy(b1_uri); 6728 _object->b2_uri = psStringCopy(b2_uri); 6727 _object->path_base = psStringCopy(path_base); 6729 6728 _object->fault = fault; 6730 6729 … … 6738 6737 psFree(object->recipe); 6739 6738 psFree(object->uri); 6740 psFree(object->b1_uri); 6741 psFree(object->b2_uri); 6739 psFree(object->path_base); 6742 6740 } 6743 6741 … … 6790 6788 return false; 6791 6789 } 6792 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, "255")) { 6793 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 6794 psFree(md); 6795 return false; 6796 } 6797 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, "255")) { 6798 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 6790 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, "255")) { 6791 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 6799 6792 psFree(md); 6800 6793 return false; … … 6818 6811 } 6819 6812 6820 bool chipProcessedImfileInsert(psDB * dbh, const char *exp_tag, psS32 chip_version, psS32 guide_version, const char *class_id, const char *recipe, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)6813 bool chipProcessedImfileInsert(psDB * dbh, const char *exp_tag, psS32 chip_version, psS32 guide_version, const char *class_id, const char *recipe, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 6821 6814 { 6822 6815 psMetadata *md = psMetadataAlloc(); … … 6866 6859 return false; 6867 6860 } 6868 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, b1_uri)) { 6869 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 6870 psFree(md); 6871 return false; 6872 } 6873 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 6874 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 6861 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, path_base)) { 6862 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 6875 6863 psFree(md); 6876 6864 return false; … … 6904 6892 bool chipProcessedImfileInsertObject(psDB *dbh, chipProcessedImfileRow *object) 6905 6893 { 6906 return chipProcessedImfileInsert(dbh, object->exp_tag, object->chip_version, object->guide_version, object->class_id, object->recipe, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object-> b1_uri, object->b2_uri, object->fault);6894 return chipProcessedImfileInsert(dbh, object->exp_tag, object->chip_version, object->guide_version, object->class_id, object->recipe, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->path_base, object->fault); 6907 6895 } 6908 6896 … … 7022 7010 return false; 7023 7011 } 7024 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, object->b1_uri)) { 7025 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 7026 psFree(md); 7027 return false; 7028 } 7029 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, object->b2_uri)) { 7030 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 7012 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, object->path_base)) { 7013 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 7031 7014 psFree(md); 7032 7015 return false; … … 7091 7074 return false; 7092 7075 } 7093 char* b1_uri = psMetadataLookupPtr(&status, md, "b1_uri"); 7094 if (!status) { 7095 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri"); 7096 return false; 7097 } 7098 char* b2_uri = psMetadataLookupPtr(&status, md, "b2_uri"); 7099 if (!status) { 7100 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri"); 7076 char* path_base = psMetadataLookupPtr(&status, md, "path_base"); 7077 if (!status) { 7078 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item path_base"); 7101 7079 return false; 7102 7080 } … … 7107 7085 } 7108 7086 7109 return chipProcessedImfileRowAlloc(exp_tag, chip_version, guide_version, class_id, recipe, uri, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);7087 return chipProcessedImfileRowAlloc(exp_tag, chip_version, guide_version, class_id, recipe, uri, bg, bg_stdev, bg_mean_stdev, path_base, fault); 7110 7088 } 7111 7089 psArray *chipProcessedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 7601 7579 static void camProcessedExpRowFree(camProcessedExpRow *object); 7602 7580 7603 camProcessedExpRow *camProcessedExpRowAlloc(const char *exp_tag, psS32 cam_version, psS32 chip_version, const char *label, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psS32 nastro, const char * b1_uri, const char *b2_uri, psF32 zp_mean, psF32 zp_stdev, psS16 fault, const char *expgroup, const char *dvodb)7581 camProcessedExpRow *camProcessedExpRowAlloc(const char *exp_tag, psS32 cam_version, psS32 chip_version, const char *label, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psS32 nastro, const char *path_base, psF32 zp_mean, psF32 zp_stdev, psS16 fault, const char *expgroup, const char *dvodb) 7604 7582 { 7605 7583 camProcessedExpRow *_object; … … 7620 7598 _object->sigma_dec = sigma_dec; 7621 7599 _object->nastro = nastro; 7622 _object->b1_uri = psStringCopy(b1_uri); 7623 _object->b2_uri = psStringCopy(b2_uri); 7600 _object->path_base = psStringCopy(path_base); 7624 7601 _object->zp_mean = zp_mean; 7625 7602 _object->zp_stdev = zp_stdev; … … 7637 7614 psFree(object->uri); 7638 7615 psFree(object->recipe); 7639 psFree(object->b1_uri); 7640 psFree(object->b2_uri); 7616 psFree(object->path_base); 7641 7617 psFree(object->expgroup); 7642 7618 psFree(object->dvodb); … … 7706 7682 return false; 7707 7683 } 7708 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, "255")) { 7709 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 7710 psFree(md); 7711 return false; 7712 } 7713 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, "255")) { 7714 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 7684 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, "255")) { 7685 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 7715 7686 psFree(md); 7716 7687 return false; … … 7754 7725 } 7755 7726 7756 bool camProcessedExpInsert(psDB * dbh, const char *exp_tag, psS32 cam_version, psS32 chip_version, const char *label, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psS32 nastro, const char * b1_uri, const char *b2_uri, psF32 zp_mean, psF32 zp_stdev, psS16 fault, const char *expgroup, const char *dvodb)7727 bool camProcessedExpInsert(psDB * dbh, const char *exp_tag, psS32 cam_version, psS32 chip_version, const char *label, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psS32 nastro, const char *path_base, psF32 zp_mean, psF32 zp_stdev, psS16 fault, const char *expgroup, const char *dvodb) 7757 7728 { 7758 7729 psMetadata *md = psMetadataAlloc(); … … 7817 7788 return false; 7818 7789 } 7819 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, b1_uri)) { 7820 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 7821 psFree(md); 7822 return false; 7823 } 7824 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 7825 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 7790 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, path_base)) { 7791 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 7826 7792 psFree(md); 7827 7793 return false; … … 7875 7841 bool camProcessedExpInsertObject(psDB *dbh, camProcessedExpRow *object) 7876 7842 { 7877 return camProcessedExpInsert(dbh, object->exp_tag, object->cam_version, object->chip_version, object->label, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->sigma_ra, object->sigma_dec, object->nastro, object-> b1_uri, object->b2_uri, object->zp_mean, object->zp_stdev, object->fault, object->expgroup, object->dvodb);7843 return camProcessedExpInsert(dbh, object->exp_tag, object->cam_version, object->chip_version, object->label, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->sigma_ra, object->sigma_dec, object->nastro, object->path_base, object->zp_mean, object->zp_stdev, object->fault, object->expgroup, object->dvodb); 7878 7844 } 7879 7845 … … 8008 7974 return false; 8009 7975 } 8010 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, object->b1_uri)) { 8011 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 8012 psFree(md); 8013 return false; 8014 } 8015 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, object->b2_uri)) { 8016 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 7976 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, object->path_base)) { 7977 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 8017 7978 psFree(md); 8018 7979 return false; … … 8112 8073 return false; 8113 8074 } 8114 char* b1_uri = psMetadataLookupPtr(&status, md, "b1_uri"); 8115 if (!status) { 8116 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri"); 8117 return false; 8118 } 8119 char* b2_uri = psMetadataLookupPtr(&status, md, "b2_uri"); 8120 if (!status) { 8121 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri"); 8075 char* path_base = psMetadataLookupPtr(&status, md, "path_base"); 8076 if (!status) { 8077 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item path_base"); 8122 8078 return false; 8123 8079 } … … 8148 8104 } 8149 8105 8150 return camProcessedExpRowAlloc(exp_tag, cam_version, chip_version, label, uri, recipe, bg, bg_stdev, bg_mean_stdev, sigma_ra, sigma_dec, nastro, b1_uri, b2_uri, zp_mean, zp_stdev, fault, expgroup, dvodb);8106 return camProcessedExpRowAlloc(exp_tag, cam_version, chip_version, label, uri, recipe, bg, bg_stdev, bg_mean_stdev, sigma_ra, sigma_dec, nastro, path_base, zp_mean, zp_stdev, fault, expgroup, dvodb); 8151 8107 } 8152 8108 psArray *camProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 9704 9660 static void detProcessedImfileRowFree(detProcessedImfileRow *object); 9705 9661 9706 detProcessedImfileRow *detProcessedImfileRowAlloc(psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)9662 detProcessedImfileRow *detProcessedImfileRowAlloc(psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 9707 9663 { 9708 9664 detProcessedImfileRow *_object; … … 9719 9675 _object->bg_stdev = bg_stdev; 9720 9676 _object->bg_mean_stdev = bg_mean_stdev; 9721 _object->b1_uri = psStringCopy(b1_uri); 9722 _object->b2_uri = psStringCopy(b2_uri); 9677 _object->path_base = psStringCopy(path_base); 9723 9678 _object->fault = fault; 9724 9679 … … 9732 9687 psFree(object->uri); 9733 9688 psFree(object->recipe); 9734 psFree(object->b1_uri); 9735 psFree(object->b2_uri); 9689 psFree(object->path_base); 9736 9690 } 9737 9691 … … 9779 9733 return false; 9780 9734 } 9781 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, "255")) { 9782 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 9783 psFree(md); 9784 return false; 9785 } 9786 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, "255")) { 9787 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 9735 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, "255")) { 9736 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 9788 9737 psFree(md); 9789 9738 return false; … … 9807 9756 } 9808 9757 9809 bool detProcessedImfileInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)9758 bool detProcessedImfileInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 9810 9759 { 9811 9760 psMetadata *md = psMetadataAlloc(); … … 9850 9799 return false; 9851 9800 } 9852 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, b1_uri)) { 9853 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 9854 psFree(md); 9855 return false; 9856 } 9857 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 9858 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 9801 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, path_base)) { 9802 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 9859 9803 psFree(md); 9860 9804 return false; … … 9888 9832 bool detProcessedImfileInsertObject(psDB *dbh, detProcessedImfileRow *object) 9889 9833 { 9890 return detProcessedImfileInsert(dbh, object->det_id, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object-> b1_uri, object->b2_uri, object->fault);9834 return detProcessedImfileInsert(dbh, object->det_id, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->path_base, object->fault); 9891 9835 } 9892 9836 … … 10001 9945 return false; 10002 9946 } 10003 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, object->b1_uri)) { 10004 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 10005 psFree(md); 10006 return false; 10007 } 10008 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, object->b2_uri)) { 10009 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 9947 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, object->path_base)) { 9948 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 10010 9949 psFree(md); 10011 9950 return false; … … 10065 10004 return false; 10066 10005 } 10067 char* b1_uri = psMetadataLookupPtr(&status, md, "b1_uri"); 10068 if (!status) { 10069 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri"); 10070 return false; 10071 } 10072 char* b2_uri = psMetadataLookupPtr(&status, md, "b2_uri"); 10073 if (!status) { 10074 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri"); 10006 char* path_base = psMetadataLookupPtr(&status, md, "path_base"); 10007 if (!status) { 10008 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item path_base"); 10075 10009 return false; 10076 10010 } … … 10081 10015 } 10082 10016 10083 return detProcessedImfileRowAlloc(det_id, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);10017 return detProcessedImfileRowAlloc(det_id, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, path_base, fault); 10084 10018 } 10085 10019 psArray *detProcessedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 10193 10127 static void detProcessedExpRowFree(detProcessedExpRow *object); 10194 10128 10195 detProcessedExpRow *detProcessedExpRowAlloc(psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)10129 detProcessedExpRow *detProcessedExpRowAlloc(psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 10196 10130 { 10197 10131 detProcessedExpRow *_object; … … 10206 10140 _object->bg_stdev = bg_stdev; 10207 10141 _object->bg_mean_stdev = bg_mean_stdev; 10208 _object->b1_uri = psStringCopy(b1_uri); 10209 _object->b2_uri = psStringCopy(b2_uri); 10142 _object->path_base = psStringCopy(path_base); 10210 10143 _object->fault = fault; 10211 10144 … … 10217 10150 psFree(object->exp_tag); 10218 10151 psFree(object->recipe); 10219 psFree(object->b1_uri); 10220 psFree(object->b2_uri); 10152 psFree(object->path_base); 10221 10153 } 10222 10154 … … 10254 10186 return false; 10255 10187 } 10256 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, "255")) { 10257 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 10258 psFree(md); 10259 return false; 10260 } 10261 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, "255")) { 10262 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 10188 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, "255")) { 10189 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 10263 10190 psFree(md); 10264 10191 return false; … … 10282 10209 } 10283 10210 10284 bool detProcessedExpInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)10211 bool detProcessedExpInsert(psDB * dbh, psS32 det_id, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 10285 10212 { 10286 10213 psMetadata *md = psMetadataAlloc(); … … 10315 10242 return false; 10316 10243 } 10317 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, b1_uri)) { 10318 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 10319 psFree(md); 10320 return false; 10321 } 10322 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 10323 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 10244 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, path_base)) { 10245 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 10324 10246 psFree(md); 10325 10247 return false; … … 10353 10275 bool detProcessedExpInsertObject(psDB *dbh, detProcessedExpRow *object) 10354 10276 { 10355 return detProcessedExpInsert(dbh, object->det_id, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object-> b1_uri, object->b2_uri, object->fault);10277 return detProcessedExpInsert(dbh, object->det_id, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->path_base, object->fault); 10356 10278 } 10357 10279 … … 10456 10378 return false; 10457 10379 } 10458 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, object->b1_uri)) { 10459 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 10460 psFree(md); 10461 return false; 10462 } 10463 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, object->b2_uri)) { 10464 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 10380 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, object->path_base)) { 10381 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 10465 10382 psFree(md); 10466 10383 return false; … … 10510 10427 return false; 10511 10428 } 10512 char* b1_uri = psMetadataLookupPtr(&status, md, "b1_uri"); 10513 if (!status) { 10514 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri"); 10515 return false; 10516 } 10517 char* b2_uri = psMetadataLookupPtr(&status, md, "b2_uri"); 10518 if (!status) { 10519 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri"); 10429 char* path_base = psMetadataLookupPtr(&status, md, "path_base"); 10430 if (!status) { 10431 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item path_base"); 10520 10432 return false; 10521 10433 } … … 10526 10438 } 10527 10439 10528 return detProcessedExpRowAlloc(det_id, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);10440 return detProcessedExpRowAlloc(det_id, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, path_base, fault); 10529 10441 } 10530 10442 psArray *detProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 11440 11352 static void detNormalizedImfileRowFree(detNormalizedImfileRow *object); 11441 11353 11442 detNormalizedImfileRow *detNormalizedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)11354 detNormalizedImfileRow *detNormalizedImfileRowAlloc(psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 11443 11355 { 11444 11356 detNormalizedImfileRow *_object; … … 11454 11366 _object->bg_stdev = bg_stdev; 11455 11367 _object->bg_mean_stdev = bg_mean_stdev; 11456 _object->b1_uri = psStringCopy(b1_uri); 11457 _object->b2_uri = psStringCopy(b2_uri); 11368 _object->path_base = psStringCopy(path_base); 11458 11369 _object->fault = fault; 11459 11370 … … 11465 11376 psFree(object->class_id); 11466 11377 psFree(object->uri); 11467 psFree(object->b1_uri); 11468 psFree(object->b2_uri); 11378 psFree(object->path_base); 11469 11379 } 11470 11380 … … 11507 11417 return false; 11508 11418 } 11509 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, "255")) { 11510 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 11511 psFree(md); 11512 return false; 11513 } 11514 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, "255")) { 11515 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 11419 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, "255")) { 11420 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 11516 11421 psFree(md); 11517 11422 return false; … … 11535 11440 } 11536 11441 11537 bool detNormalizedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)11442 bool detNormalizedImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *class_id, const char *uri, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 11538 11443 { 11539 11444 psMetadata *md = psMetadataAlloc(); … … 11573 11478 return false; 11574 11479 } 11575 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, b1_uri)) { 11576 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 11577 psFree(md); 11578 return false; 11579 } 11580 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 11581 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 11480 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, path_base)) { 11481 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 11582 11482 psFree(md); 11583 11483 return false; … … 11611 11511 bool detNormalizedImfileInsertObject(psDB *dbh, detNormalizedImfileRow *object) 11612 11512 { 11613 return detNormalizedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object-> b1_uri, object->b2_uri, object->fault);11513 return detNormalizedImfileInsert(dbh, object->det_id, object->iteration, object->class_id, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->path_base, object->fault); 11614 11514 } 11615 11515 … … 11719 11619 return false; 11720 11620 } 11721 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, object->b1_uri)) { 11722 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 11723 psFree(md); 11724 return false; 11725 } 11726 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, object->b2_uri)) { 11727 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 11621 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, object->path_base)) { 11622 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 11728 11623 psFree(md); 11729 11624 return false; … … 11778 11673 return false; 11779 11674 } 11780 char* b1_uri = psMetadataLookupPtr(&status, md, "b1_uri"); 11781 if (!status) { 11782 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri"); 11783 return false; 11784 } 11785 char* b2_uri = psMetadataLookupPtr(&status, md, "b2_uri"); 11786 if (!status) { 11787 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri"); 11675 char* path_base = psMetadataLookupPtr(&status, md, "path_base"); 11676 if (!status) { 11677 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item path_base"); 11788 11678 return false; 11789 11679 } … … 11794 11684 } 11795 11685 11796 return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);11686 return detNormalizedImfileRowAlloc(det_id, iteration, class_id, uri, bg, bg_stdev, bg_mean_stdev, path_base, fault); 11797 11687 } 11798 11688 psArray *detNormalizedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 11906 11796 static void detNormalizedExpRowFree(detNormalizedExpRow *object); 11907 11797 11908 detNormalizedExpRow *detNormalizedExpRowAlloc(psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)11798 detNormalizedExpRow *detNormalizedExpRowAlloc(psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 11909 11799 { 11910 11800 detNormalizedExpRow *_object; … … 11919 11809 _object->bg_stdev = bg_stdev; 11920 11810 _object->bg_mean_stdev = bg_mean_stdev; 11921 _object->b1_uri = psStringCopy(b1_uri); 11922 _object->b2_uri = psStringCopy(b2_uri); 11811 _object->path_base = psStringCopy(path_base); 11923 11812 _object->fault = fault; 11924 11813 … … 11929 11818 { 11930 11819 psFree(object->recipe); 11931 psFree(object->b1_uri); 11932 psFree(object->b2_uri); 11820 psFree(object->path_base); 11933 11821 } 11934 11822 … … 11966 11854 return false; 11967 11855 } 11968 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, "255")) { 11969 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 11970 psFree(md); 11971 return false; 11972 } 11973 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, "255")) { 11974 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 11856 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, "255")) { 11857 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 11975 11858 psFree(md); 11976 11859 return false; … … 11994 11877 } 11995 11878 11996 bool detNormalizedExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)11879 bool detNormalizedExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 11997 11880 { 11998 11881 psMetadata *md = psMetadataAlloc(); … … 12027 11910 return false; 12028 11911 } 12029 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, b1_uri)) { 12030 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 12031 psFree(md); 12032 return false; 12033 } 12034 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 12035 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 11912 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, path_base)) { 11913 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 12036 11914 psFree(md); 12037 11915 return false; … … 12065 11943 bool detNormalizedExpInsertObject(psDB *dbh, detNormalizedExpRow *object) 12066 11944 { 12067 return detNormalizedExpInsert(dbh, object->det_id, object->iteration, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object-> b1_uri, object->b2_uri, object->fault);11945 return detNormalizedExpInsert(dbh, object->det_id, object->iteration, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->path_base, object->fault); 12068 11946 } 12069 11947 … … 12168 12046 return false; 12169 12047 } 12170 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, object->b1_uri)) { 12171 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 12172 psFree(md); 12173 return false; 12174 } 12175 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, object->b2_uri)) { 12176 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 12048 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, object->path_base)) { 12049 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 12177 12050 psFree(md); 12178 12051 return false; … … 12222 12095 return false; 12223 12096 } 12224 char* b1_uri = psMetadataLookupPtr(&status, md, "b1_uri"); 12225 if (!status) { 12226 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri"); 12227 return false; 12228 } 12229 char* b2_uri = psMetadataLookupPtr(&status, md, "b2_uri"); 12230 if (!status) { 12231 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri"); 12097 char* path_base = psMetadataLookupPtr(&status, md, "path_base"); 12098 if (!status) { 12099 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item path_base"); 12232 12100 return false; 12233 12101 } … … 12238 12106 } 12239 12107 12240 return detNormalizedExpRowAlloc(det_id, iteration, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);12108 return detNormalizedExpRowAlloc(det_id, iteration, recipe, bg, bg_stdev, bg_mean_stdev, path_base, fault); 12241 12109 } 12242 12110 psArray *detNormalizedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 12350 12218 static void detResidImfileRowFree(detResidImfileRow *object); 12351 12219 12352 detResidImfileRow *detResidImfileRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)12220 detResidImfileRow *detResidImfileRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 12353 12221 { 12354 12222 detResidImfileRow *_object; … … 12366 12234 _object->bg_stdev = bg_stdev; 12367 12235 _object->bg_mean_stdev = bg_mean_stdev; 12368 _object->b1_uri = psStringCopy(b1_uri); 12369 _object->b2_uri = psStringCopy(b2_uri); 12236 _object->path_base = psStringCopy(path_base); 12370 12237 _object->fault = fault; 12371 12238 … … 12379 12246 psFree(object->uri); 12380 12247 psFree(object->recipe); 12381 psFree(object->b1_uri); 12382 psFree(object->b2_uri); 12248 psFree(object->path_base); 12383 12249 } 12384 12250 … … 12431 12297 return false; 12432 12298 } 12433 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, "255")) { 12434 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 12435 psFree(md); 12436 return false; 12437 } 12438 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, "255")) { 12439 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 12299 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, "255")) { 12300 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 12440 12301 psFree(md); 12441 12302 return false; … … 12459 12320 } 12460 12321 12461 bool detResidImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, psS16 fault)12322 bool detResidImfileInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, psS16 fault) 12462 12323 { 12463 12324 psMetadata *md = psMetadataAlloc(); … … 12507 12368 return false; 12508 12369 } 12509 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, b1_uri)) { 12510 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 12511 psFree(md); 12512 return false; 12513 } 12514 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 12515 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 12370 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, path_base)) { 12371 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 12516 12372 psFree(md); 12517 12373 return false; … … 12545 12401 bool detResidImfileInsertObject(psDB *dbh, detResidImfileRow *object) 12546 12402 { 12547 return detResidImfileInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object-> b1_uri, object->b2_uri, object->fault);12403 return detResidImfileInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->path_base, object->fault); 12548 12404 } 12549 12405 … … 12663 12519 return false; 12664 12520 } 12665 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, object->b1_uri)) { 12666 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 12667 psFree(md); 12668 return false; 12669 } 12670 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, object->b2_uri)) { 12671 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 12521 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, object->path_base)) { 12522 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 12672 12523 psFree(md); 12673 12524 return false; … … 12732 12583 return false; 12733 12584 } 12734 char* b1_uri = psMetadataLookupPtr(&status, md, "b1_uri"); 12735 if (!status) { 12736 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri"); 12737 return false; 12738 } 12739 char* b2_uri = psMetadataLookupPtr(&status, md, "b2_uri"); 12740 if (!status) { 12741 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri"); 12585 char* path_base = psMetadataLookupPtr(&status, md, "path_base"); 12586 if (!status) { 12587 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item path_base"); 12742 12588 return false; 12743 12589 } … … 12748 12594 } 12749 12595 12750 return detResidImfileRowAlloc(det_id, iteration, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, fault);12596 return detResidImfileRowAlloc(det_id, iteration, exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, path_base, fault); 12751 12597 } 12752 12598 psArray *detResidImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 12860 12706 static void detResidExpRowFree(detResidExpRow *object); 12861 12707 12862 detResidExpRow *detResidExpRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, bool accept, psS16 fault)12708 detResidExpRow *detResidExpRowAlloc(psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, bool accept, psS16 fault) 12863 12709 { 12864 12710 detResidExpRow *_object; … … 12874 12720 _object->bg_stdev = bg_stdev; 12875 12721 _object->bg_mean_stdev = bg_mean_stdev; 12876 _object->b1_uri = psStringCopy(b1_uri); 12877 _object->b2_uri = psStringCopy(b2_uri); 12722 _object->path_base = psStringCopy(path_base); 12878 12723 _object->accept = accept; 12879 12724 _object->fault = fault; … … 12886 12731 psFree(object->exp_tag); 12887 12732 psFree(object->recipe); 12888 psFree(object->b1_uri); 12889 psFree(object->b2_uri); 12733 psFree(object->path_base); 12890 12734 } 12891 12735 … … 12928 12772 return false; 12929 12773 } 12930 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, "255")) { 12931 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 12932 psFree(md); 12933 return false; 12934 } 12935 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, "255")) { 12936 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 12774 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, "255")) { 12775 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 12937 12776 psFree(md); 12938 12777 return false; … … 12961 12800 } 12962 12801 12963 bool detResidExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char * b1_uri, const char *b2_uri, bool accept, psS16 fault)12802 bool detResidExpInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_tag, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *path_base, bool accept, psS16 fault) 12964 12803 { 12965 12804 psMetadata *md = psMetadataAlloc(); … … 12999 12838 return false; 13000 12839 } 13001 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, b1_uri)) { 13002 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 13003 psFree(md); 13004 return false; 13005 } 13006 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, b2_uri)) { 13007 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 12840 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, path_base)) { 12841 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 13008 12842 psFree(md); 13009 12843 return false; … … 13042 12876 bool detResidExpInsertObject(psDB *dbh, detResidExpRow *object) 13043 12877 { 13044 return detResidExpInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object-> b1_uri, object->b2_uri, object->accept, object->fault);12878 return detResidExpInsert(dbh, object->det_id, object->iteration, object->exp_tag, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->path_base, object->accept, object->fault); 13045 12879 } 13046 12880 … … 13150 12984 return false; 13151 12985 } 13152 if (!psMetadataAdd(md, PS_LIST_TAIL, "b1_uri", PS_DATA_STRING, NULL, object->b1_uri)) { 13153 psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri"); 13154 psFree(md); 13155 return false; 13156 } 13157 if (!psMetadataAdd(md, PS_LIST_TAIL, "b2_uri", PS_DATA_STRING, NULL, object->b2_uri)) { 13158 psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri"); 12986 if (!psMetadataAdd(md, PS_LIST_TAIL, "path_base", PS_DATA_STRING, NULL, object->path_base)) { 12987 psError(PS_ERR_UNKNOWN, false, "failed to add item path_base"); 13159 12988 psFree(md); 13160 12989 return false; … … 13214 13043 return false; 13215 13044 } 13216 char* b1_uri = psMetadataLookupPtr(&status, md, "b1_uri"); 13217 if (!status) { 13218 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri"); 13219 return false; 13220 } 13221 char* b2_uri = psMetadataLookupPtr(&status, md, "b2_uri"); 13222 if (!status) { 13223 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri"); 13045 char* path_base = psMetadataLookupPtr(&status, md, "path_base"); 13046 if (!status) { 13047 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item path_base"); 13224 13048 return false; 13225 13049 } … … 13235 13059 } 13236 13060 13237 return detResidExpRowAlloc(det_id, iteration, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, accept, fault);13061 return detResidExpRowAlloc(det_id, iteration, exp_tag, recipe, bg, bg_stdev, bg_mean_stdev, path_base, accept, fault); 13238 13062 } 13239 13063 psArray *detResidExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 14466 14290 static void warpSkyCellMapRowFree(warpSkyCellMapRow *object); 14467 14291 14468 warpSkyCellMapRow *warpSkyCellMapRowAlloc(psS32 warp_id, const char *skycell_id, const char *tess_id, const char *exp_tag, psS32 cam_version, const char *class_id )14292 warpSkyCellMapRow *warpSkyCellMapRowAlloc(psS32 warp_id, const char *skycell_id, const char *tess_id, const char *exp_tag, psS32 cam_version, const char *class_id, psS16 fault) 14469 14293 { 14470 14294 warpSkyCellMapRow *_object; … … 14479 14303 _object->cam_version = cam_version; 14480 14304 _object->class_id = psStringCopy(class_id); 14305 _object->fault = fault; 14481 14306 14482 14307 return _object; … … 14524 14349 return false; 14525 14350 } 14351 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key", 0)) { 14352 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 14353 psFree(md); 14354 return false; 14355 } 14526 14356 14527 14357 bool status = psDBCreateTable(dbh, WARPSKYCELLMAP_TABLE_NAME, md); … … 14537 14367 } 14538 14368 14539 bool warpSkyCellMapInsert(psDB * dbh, psS32 warp_id, const char *skycell_id, const char *tess_id, const char *exp_tag, psS32 cam_version, const char *class_id )14369 bool warpSkyCellMapInsert(psDB * dbh, psS32 warp_id, const char *skycell_id, const char *tess_id, const char *exp_tag, psS32 cam_version, const char *class_id, psS16 fault) 14540 14370 { 14541 14371 psMetadata *md = psMetadataAlloc(); … … 14567 14397 if (!psMetadataAdd(md, PS_LIST_TAIL, "class_id", PS_DATA_STRING, NULL, class_id)) { 14568 14398 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); 14399 psFree(md); 14400 return false; 14401 } 14402 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) { 14403 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 14569 14404 psFree(md); 14570 14405 return false; … … 14593 14428 bool warpSkyCellMapInsertObject(psDB *dbh, warpSkyCellMapRow *object) 14594 14429 { 14595 return warpSkyCellMapInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->exp_tag, object->cam_version, object->class_id );14430 return warpSkyCellMapInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->exp_tag, object->cam_version, object->class_id, object->fault); 14596 14431 } 14597 14432 … … 14696 14531 return false; 14697 14532 } 14533 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 14534 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); 14535 psFree(md); 14536 return false; 14537 } 14698 14538 14699 14539 … … 14735 14575 return false; 14736 14576 } 14737 14738 return warpSkyCellMapRowAlloc(warp_id, skycell_id, tess_id, exp_tag, cam_version, class_id); 14577 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 14578 if (!status) { 14579 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault"); 14580 return false; 14581 } 14582 14583 return warpSkyCellMapRowAlloc(warp_id, skycell_id, tess_id, exp_tag, cam_version, class_id, fault); 14739 14584 } 14740 14585 psArray *warpSkyCellMapSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Note:
See TracChangeset
for help on using the changeset viewer.
