Changeset 13937 for trunk/ippTools/src/dettool.c
- Timestamp:
- Jun 21, 2007, 2:10:11 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r13849 r13937 449 449 } 450 450 451 psString reduction = psMetadataLookupStr(&status, config->args, "-reduction"); 452 if (!status) { 453 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -reduction"); 454 return false; 455 } 456 451 457 psString label = psMetadataLookupStr(&status, config->args, "-label"); 452 458 if (!status) { … … 528 534 // XXX det_id 529 535 detRunInsert(config->dbh, 530 0, 531 0, 532 det_type, 533 mode, 534 "run", 535 filelevel, 536 workdir, 537 camera, 538 telescope, 539 exp_type, 540 filter, 541 airmass_min, 542 airmass_max, 543 exp_time_min, 544 exp_time_max, 545 ccd_temp_min, 546 ccd_temp_max, 547 posang_min, 548 posang_max, 549 registered, 550 time_begin, 551 time_end, 552 use_begin, 553 use_end, 554 solang_min, 555 solang_max, 556 label, 557 0 // parent 536 0, 537 0, 538 det_type, 539 mode, 540 "run", 541 filelevel, 542 workdir, 543 camera, 544 telescope, 545 exp_type, 546 reduction, 547 filter, 548 airmass_min, 549 airmass_max, 550 exp_time_min, 551 exp_time_max, 552 ccd_temp_min, 553 ccd_temp_max, 554 posang_min, 555 posang_max, 556 registered, 557 time_begin, 558 time_end, 559 use_begin, 560 use_end, 561 solang_min, 562 solang_max, 563 label, 564 0 // parent 558 565 ); 559 566 psFree(registered); … … 1172 1179 } 1173 1180 1181 psString reduction = psMetadataLookupStr(&status, config->args, "-reduction"); 1182 if (!status) { 1183 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -reduction"); 1184 return false; 1185 } 1186 1174 1187 psString label = psMetadataLookupStr(&status, config->args, "-label"); 1175 1188 if (!status) { … … 1251 1264 // XXX det_id 1252 1265 detRunInsert(config->dbh, 1253 0, // det_id 1254 0, // iteration 1255 det_type, 1256 mode, 1257 "run", // state 1258 filelevel, 1259 workdir, 1260 camera, 1261 telescope, 1262 "NA", 1263 filter, 1264 airmass_min, 1265 airmass_max, 1266 exp_time_min, 1267 exp_time_max, 1268 ccd_temp_min, 1269 ccd_temp_max, 1270 posang_min, 1271 posang_max, 1272 registered, 1273 time_begin, 1274 time_end, 1275 use_begin, 1276 use_end, 1277 solang_min, 1278 solang_max, 1279 label, 1280 0 // parent 1266 0, // det_id 1267 0, // iteration 1268 det_type, 1269 mode, 1270 "run", // state 1271 filelevel, 1272 workdir, 1273 camera, 1274 telescope, 1275 "NA", 1276 reduction, 1277 filter, 1278 airmass_min, 1279 airmass_max, 1280 exp_time_min, 1281 exp_time_max, 1282 ccd_temp_min, 1283 ccd_temp_max, 1284 posang_min, 1285 posang_max, 1286 registered, 1287 time_begin, 1288 time_end, 1289 use_begin, 1290 use_end, 1291 solang_min, 1292 solang_max, 1293 label, 1294 0 // parent 1281 1295 ); 1282 1296 psFree(registered); … … 1671 1685 psFree(use_end); 1672 1686 } 1687 } 1688 1689 psString reduction = psMetadataLookupStr(&status, config->args, "-set_reduction"); 1690 if (!status) { 1691 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -set_reduction"); 1692 return false; 1693 } 1694 if (reduction) { 1695 psFree(detRun->reduction); 1696 detRun->reduction = psStringCopy(reduction); 1673 1697 } 1674 1698 … … 2115 2139 " detRun.det_type," 2116 2140 " detRun.workdir," 2141 " detRun.reduction," 2117 2142 " rawImfile.*," 2118 2143 " rawExp.camera" … … 2862 2887 " detRun.det_type,\n" 2863 2888 " detRun.workdir,\n" 2889 " detRun.reduction,\n" 2864 2890 " detProcessedImfile.class_id,\n" 2865 2891 " rawExp.camera\n" … … 2987 3013 // add the two required restrictions: detRun.state and detRun.mode 2988 3014 if ((value = psMetadataLookupStr(&status, config->args, "-select_state"))) { 2989 psStringAppend(&query, " detRun.state = '%s'", value);3015 psStringAppend(&query, " detRun.state = '%s'", value); 2990 3016 } else { 2991 psStringAppend(&query, " detRun.state = 'run'");3017 psStringAppend(&query, " detRun.state = 'run'"); 2992 3018 } 2993 3019 if ((value = psMetadataLookupStr(&status, config->args, "-select_mode"))) { 2994 psStringAppend(&query, " AND detRun.mode = '%s'", value);3020 psStringAppend(&query, " AND detRun.mode = '%s'", value); 2995 3021 } else { 2996 psStringAppend(&query, " AND detRun.mode = 'master'");3022 psStringAppend(&query, " AND detRun.mode = 'master'"); 2997 3023 } 2998 3024 … … 4407 4433 " detRun.mode,\n" 4408 4434 " detRun.workdir,\n" 4435 " detRun.reduction,\n" 4409 4436 " detProcessedImfile.exp_tag,\n" 4410 4437 " detProcessedImfile.class_id,\n" … … 4444 4471 " detRun.mode,\n" 4445 4472 " detRun.workdir,\n" 4473 " detRun.reduction,\n" 4446 4474 " rawImfile.exp_tag,\n" 4447 4475 " rawImfile.class_id,\n" … … 6774 6802 6775 6803 if (!detRunInsert(config->dbh, 6776 0, // det_id 6777 0, // the iteration is fixed at 0 6778 det_type, 6779 mode, 6780 "reg", // state 6781 filelevel, 6782 workdir, 6783 camera, 6784 telescope, 6785 exp_type, 6786 filter, 6787 airmass_min, 6788 airmass_max, 6789 exp_time_min, 6790 exp_time_max, 6791 ccd_temp_min, 6792 ccd_temp_max, 6793 posang_min, 6794 posang_max, 6795 registered, 6796 time_begin, 6797 time_end, 6798 use_begin, 6799 use_end, 6800 solang_min, 6801 solang_max, 6802 label, // label 6803 parent ? (psS64)atoll(parent) : 0 6804 )) { 6804 0, // det_id 6805 0, // the iteration is fixed at 0 6806 det_type, 6807 mode, 6808 "reg", // state 6809 filelevel, 6810 workdir, 6811 camera, 6812 telescope, 6813 exp_type, 6814 NULL, 6815 filter, 6816 airmass_min, 6817 airmass_max, 6818 exp_time_min, 6819 exp_time_max, 6820 ccd_temp_min, 6821 ccd_temp_max, 6822 posang_min, 6823 posang_max, 6824 registered, 6825 time_begin, 6826 time_end, 6827 use_begin, 6828 use_end, 6829 solang_min, 6830 solang_max, 6831 label, // label 6832 parent ? (psS64)atoll(parent) : 0 6833 )) { 6805 6834 psError(PS_ERR_UNKNOWN, false, "database error"); 6806 6835 // rollback
Note:
See TracChangeset
for help on using the changeset viewer.
