Changeset 17145
- Timestamp:
- Mar 25, 2008, 1:23:41 PM (18 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 7 edited
-
scripts/warptest.sh (modified) (1 diff)
-
share/warptool_tooverlap.sql (modified) (3 diffs)
-
share/warptool_towarped.sql (modified) (2 diffs)
-
src/pxtables.c (modified) (2 diffs)
-
src/warptool.c (modified) (3 diffs)
-
src/warptool.h (modified) (1 diff)
-
src/warptoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/scripts/warptest.sh
r16687 r17145 16 16 warptool -tooverlap -warp_id 1 || exit 1 17 17 18 exit 1 19 18 20 warptool -addoverlap -mapfile mapfile.txt || exit 1 19 21 -
trunk/ippTools/share/warptool_tooverlap.sql
r16755 r17145 1 1 SELECT 2 2 warpRun.warp_id, 3 camProcessedExp.cam_id, 3 warpRun.cam_id, 4 warpRun.workdir, 4 5 warpRun.tess_id, 5 warpRun. workdir,6 warpRun.label, 6 7 rawExp.camera, 7 exp_id 8 exp_id, 9 warpRun.magiced 8 10 FROM warpRun 9 11 JOIN camProcessedExp … … 15 17 LEFT JOIN warpSkyCellMap 16 18 USING(warp_id, cam_id) 19 LEFT JOIN warpMask 20 ON warpRun.label = warpMask.label 17 21 WHERE 18 22 warpRun.state = 'run' … … 20 24 AND warpSkyCellMap.warp_id IS NULL 21 25 AND warpSkyCellMap.cam_id IS NULL 26 AND warpMask.label IS NULL -
trunk/ippTools/share/warptool_towarped.sql
r14236 r17145 21 21 AND warpSkyCellMap.skycell_id = warpSkyfile.skycell_id 22 22 AND warpSkyCellMap.tess_id = warpSkyfile.tess_id 23 LEFT JOIN warpMask 24 ON warpRun.label = warpMask.label 23 25 WHERE 24 26 warpRun.state = 'run' … … 27 29 AND warpSkyfile.tess_id IS NULL 28 30 AND warpSkyCellMap.fault = 0 29 31 AND warpMask.label IS NULL -
trunk/ippTools/src/pxtables.c
r16733 r17145 86 86 CREATE_TABLE(warpSkyCellMapCreateTable); 87 87 CREATE_TABLE(warpSkyfileCreateTable); 88 CREATE_TABLE(warpMaskCreateTable); 88 89 CREATE_TABLE(stackRunCreateTable); 89 90 CREATE_TABLE(stackInputSkyfileCreateTable); … … 185 186 DROP_TABLE(warpSkyCellMapDropTable); 186 187 DROP_TABLE(warpSkyfileDropTable); 188 DROP_TABLE(warpMaskDropTable); 187 189 DROP_TABLE(diffRunDropTable); 188 190 DROP_TABLE(diffInputSkyfileDropTable); -
trunk/ippTools/src/warptool.c
r17142 r17145 43 43 static bool warpedMode(pxConfig *config); 44 44 static bool revertwarpedMode(pxConfig *config); 45 static bool blockMode(pxConfig *config); 46 static bool maskedMode(pxConfig *config); 47 static bool unblockMode(pxConfig *config); 45 48 46 49 static bool parseAndInsertSkyCellMap(pxConfig *config, const char *mapfile); … … 77 80 MODECASE(WARPTOOL_MODE_WARPED, warpedMode); 78 81 MODECASE(WARPTOOL_MODE_REVERTWARPED, revertwarpedMode); 82 MODECASE(WARPTOOL_MODE_BLOCK, blockMode); 83 MODECASE(WARPTOOL_MODE_MASKED, maskedMode); 84 MODECASE(WARPTOOL_MODE_UNBLOCK, unblockMode); 85 79 86 default: 80 87 psAbort("invalid option (this should not happen)"); … … 926 933 927 934 935 static bool blockMode(pxConfig *config) 936 { 937 PS_ASSERT_PTR_NON_NULL(config, false); 938 939 PXOPT_LOOKUP_STR(label, config->args, "-label", true, false); 940 941 if (!warpMaskInsert(config->dbh, label)) { 942 psError(PS_ERR_UNKNOWN, false, "database error"); 943 return false; 944 } 945 946 return true; 947 } 948 949 950 static bool maskedMode(pxConfig *config) 951 { 952 PS_ASSERT_PTR_NON_NULL(config, false); 953 954 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 955 956 psString query = psStringCopy("SELECT * FROM warpMask"); 957 958 if (!p_psDBRunQuery(config->dbh, query)) { 959 psError(PS_ERR_UNKNOWN, false, "database error"); 960 psFree(query); 961 return false; 962 } 963 psFree(query); 964 965 psArray *output = p_psDBFetchResult(config->dbh); 966 if (!output) { 967 psError(PS_ERR_UNKNOWN, false, "database error"); 968 return false; 969 } 970 if (!psArrayLength(output)) { 971 psTrace("warpool", PS_LOG_INFO, "no rows found"); 972 psFree(output); 973 return true; 974 } 975 976 if (!convertIdToStr(output)) { 977 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 978 psFree(output); 979 return false; 980 } 981 982 // negative simple so the default is true 983 if (!ippdbPrintMetadatas(stdout, output, "warpMask", !simple)) { 984 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 985 psFree(output); 986 return false; 987 } 988 989 psFree(output); 990 991 return true; 992 } 993 994 995 static bool unblockMode(pxConfig *config) 996 { 997 PS_ASSERT_PTR_NON_NULL(config, false); 998 999 PXOPT_LOOKUP_STR(label, config->args, "-label", true, false); 1000 1001 char *query = "DELETE FROM warpMask WHERE label = '%s'"; 1002 1003 if (!p_psDBRunQuery(config->dbh, query, label)) { 1004 psError(PS_ERR_UNKNOWN, false, "database error"); 1005 return false; 1006 } 1007 1008 return true; 1009 } 1010 1011 928 1012 static bool isValidMode(pxConfig *config, const char *mode) 929 1013 { -
trunk/ippTools/src/warptool.h
r14262 r17145 38 38 WARPTOOL_MODE_WARPED, 39 39 WARPTOOL_MODE_REVERTWARPED, 40 WARPTOOL_MODE_BLOCK, 41 WARPTOOL_MODE_MASKED, 42 WARPTOOL_MODE_UNBLOCK, 40 43 } warptoolMode; 41 44 -
trunk/ippTools/src/warptoolConfig.c
r17142 r17145 196 196 "search by fault code", 0); 197 197 198 // -block 199 psMetadata *blockArgs = psMetadataAlloc(); 200 psMetadataAddStr(blockArgs, PS_LIST_TAIL, "-label", 0, 201 "name of a label to mask out (required)", NULL); 202 203 // -masked 204 psMetadata *maskedArgs = psMetadataAlloc(); 205 psMetadataAddBool(maskedArgs, PS_LIST_TAIL, "-simple", 0, 206 "use the simple output format", false); 207 208 // -unblock 209 psMetadata *unblockArgs = psMetadataAlloc(); 210 psMetadataAddStr(unblockArgs, PS_LIST_TAIL, "-label", 0, 211 "name of a label to unmask (required)", NULL); 198 212 199 213 psFree(now); 200 201 214 psMetadata *argSets = psMetadataAlloc(); 202 215 psMetadata *modes = psMetadataAlloc(); … … 213 226 PXOPT_ADD_MODE("-warped", "", WARPTOOL_MODE_WARPED, warpedArgs); 214 227 PXOPT_ADD_MODE("-revertwarped", "", WARPTOOL_MODE_REVERTWARPED, revertwarpedArgs); 228 PXOPT_ADD_MODE("-block", "set a label block", WARPTOOL_MODE_BLOCK, blockArgs); 229 PXOPT_ADD_MODE("-masked", "show blocked lables", WARPTOOL_MODE_MASKED, maskedArgs); 230 PXOPT_ADD_MODE("-unblock", "remove a label block", WARPTOOL_MODE_UNBLOCK, unblockArgs); 215 231 216 232 if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
Note:
See TracChangeset
for help on using the changeset viewer.
