Changeset 28017 for branches/czw_branch/20100427/ippTools/src/warptool.c
- Timestamp:
- May 18, 2010, 5:06:01 PM (16 years ago)
- Location:
- branches/czw_branch/20100427
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTools/src/warptool.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20100427
- Property svn:mergeinfo changed
-
branches/czw_branch/20100427/ippTools/src/warptool.c
r27784 r28017 177 177 registered, 178 178 0, // magicked 179 note 179 NULL, // software version 180 0, // mask stat npix 181 NAN, // static 182 NAN, // dynamic 183 NAN, // magic 184 NAN, // advisory 185 note 180 186 ); 181 187 if (!warpRun) { … … 248 254 PXOPT_COPY_F64(config->args, where, "-posang_max", "rawExp.posang", "<"); 249 255 PXOPT_COPY_STR(config->args, where, "-object", "rawExp.object", "=="); 256 PXOPT_COPY_STR(config->args, where, "-comment", "rawExp.comment", "LIKE"); 257 PXOPT_COPY_STR(config->args, where, "-obs_mode", "rawExp.obs_mode", "LIKE"); 250 258 PXOPT_COPY_F32(config->args, where, "-sun_angle_min", "rawExp.sun_angle", ">="); 251 259 PXOPT_COPY_F32(config->args, where, "-sun_angle_max", "rawExp.sun_angle", "<"); … … 273 281 PXOPT_LOOKUP_TIME(registered, config->args, "-registered", false, false); 274 282 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 283 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 275 284 276 285 // check mode … … 310 319 if (!psArrayLength(output)) { 311 320 psTrace("warptool", PS_LOG_INFO, "no rows found"); 321 psFree(output); 322 return true; 323 } 324 325 if (pretend) { 326 // negative simple so the default is true 327 if (!ippdbPrintMetadatas(stdout, output, "rawExp", !simple)) { 328 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 329 psFree(output); 330 return false; 331 } 312 332 psFree(output); 313 333 return true; … … 925 945 // to avoid slow queries and to the query itself 926 946 // to satisfy the user's requested limit 927 psStringAppend(&limitString, psDBGenerateLimitSQL(limit));947 psStringAppend(&limitString, "%s", psDBGenerateLimitSQL(limit)); 928 948 psStringAppend(&query, " %s", limitString); 929 949 } … … 1012 1032 PXOPT_LOOKUP_STR(ver_streaks, config->args, "-ver_streaks", false, false); 1013 1033 1034 PXOPT_LOOKUP_S32(maskfrac_npix, config->args, "-maskfrac_npix", false, false); 1035 PXOPT_LOOKUP_F32(maskfrac_static, config->args, "-maskfrac_static", false, false); 1036 PXOPT_LOOKUP_F32(maskfrac_dynamic, config->args, "-maskfrac_dynamic", false, false); 1037 PXOPT_LOOKUP_F32(maskfrac_magic, config->args, "-maskfrac_magic", false, false); 1038 PXOPT_LOOKUP_F32(maskfrac_advisory, config->args, "-maskfrac_advisory", false, false); 1039 1014 1040 psTrace("czw.test",1,"Received versions: pslib %s psmodules %s psphot %s ppstats %s pswarp %s streaks %s\n", 1015 1041 ver_pslib,ver_psmodules,ver_psphot,ver_ppstats,ver_pswarp,ver_streaks); 1016 1042 psString ver_code = NULL; 1043 if ((ver_pslib)&&(ver_psmodules)) { 1044 ver_code = pxMergeCodeVersions(ver_pslib,ver_psmodules); 1045 } 1046 if (ver_psphot) { 1047 ver_code = pxMergeCodeVersions(ver_code,ver_psphot); 1048 } 1049 if (ver_ppstats) { 1050 ver_code = pxMergeCodeVersions(ver_code,ver_ppstats); 1051 } 1052 if (ver_pswarp) { 1053 ver_code = pxMergeCodeVersions(ver_code,ver_pswarp); 1054 } 1055 if (ver_streaks) { 1056 ver_code = pxMergeCodeVersions(ver_code,ver_streaks); 1057 } 1017 1058 1018 1059 // default values … … 1049 1090 fault, 1050 1091 quality, 1051 magicked 1052 /* magicked, */ 1053 /* ver_pslib, */ 1054 /* ver_psmodules, */ 1055 /* ver_psphot, */ 1056 /* ver_ppstats, */ 1057 /* ver_pswarp, */ 1058 /* ver_streaks */ 1092 magicked, 1093 ver_code, 1094 maskfrac_npix, 1095 maskfrac_static, 1096 maskfrac_dynamic, 1097 maskfrac_magic, 1098 maskfrac_advisory 1059 1099 )) { 1060 1100 if (!psDBRollback(config->dbh)) { … … 1121 1161 bool status; 1122 1162 psS64 warp_id = psMetadataLookupS64(&status, row, "warp_id"); 1163 1164 psString software_ver = NULL; 1165 psS32 maskfrac_npix = 0; 1166 psF32 maskfrac_static = 0; 1167 psF32 maskfrac_dynamic = 0; 1168 psF32 maskfrac_magic = 0; 1169 psF32 maskfrac_advisory = 0; 1170 1171 // Calculate run level masking and software state 1172 if (!pxCoalesceRunStatus(config,"warptool_coalesce_run.sql",warp_id, 1173 &software_ver,&maskfrac_npix, 1174 &maskfrac_static,&maskfrac_dynamic, 1175 &maskfrac_magic,&maskfrac_advisory)) { 1176 psError(PS_ERR_UNKNOWN, false, "failed to generate run level statistics"); 1177 psFree(output); 1178 if (!psDBRollback(config->dbh)) { 1179 psError(PS_ERR_UNKNOWN, false, "database error"); 1180 } 1181 return(false); 1182 } 1183 // Set warpRun.software_ver to the appropriate value 1184 if (!pxSetRunSoftware(config, "warpRun", "warp_id", warp_id, software_ver)) { 1185 psError(PS_ERR_UNKNOWN, false, "failed to set warpRun.software_ver for warp_id: %" PRId64, 1186 warp_id); 1187 psFree(output); 1188 if (!psDBRollback(config->dbh)) { 1189 psError(PS_ERR_UNKNOWN, false, "database error"); 1190 } 1191 return(false); 1192 } 1193 // Set warpRun.maskfrac* to the appropriate values. 1194 if (!pxSetRunMaskfrac(config, "warpRun", "warp_id", warp_id, maskfrac_npix, maskfrac_static, 1195 maskfrac_dynamic, maskfrac_magic, maskfrac_advisory)) { 1196 psError(PS_ERR_UNKNOWN, false, "failed to set warpRun.software_ver for warp_id: %" PRId64, 1197 warp_id); 1198 psFree(output); 1199 if (!psDBRollback(config->dbh)) { 1200 psError(PS_ERR_UNKNOWN, false, "database error"); 1201 } 1202 return(false); 1203 } 1204 1205 1123 1206 if (!status) { 1124 1207 psError(PS_ERR_UNKNOWN, false, "failed to look up value for warp_id");
Note:
See TracChangeset
for help on using the changeset viewer.
