Changeset 31681
- Timestamp:
- Jun 22, 2011, 2:29:09 PM (15 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 3 edited
-
share/staticskytool_definebyquery_select.sql (modified) (3 diffs)
-
src/staticskytool.c (modified) (3 diffs)
-
src/staticskytoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/staticskytool_definebyquery_select.sql
r28091 r31681 1 1 SELECT 2 2 tess_id, 3 skycell_id, 3 skycell_id, 4 data_group, 5 label, 4 6 num_filter 5 7 FROM ( … … 7 9 tess_id, 8 10 skycell_id, 11 label, 12 data_group, 9 13 COUNT(DISTINCT filter) AS num_filter 10 14 FROM stackRun … … 17 21 GROUP BY 18 22 tess_id, 19 skycell_id 23 skycell_id, 24 data_group 20 25 ) AS TMP 26 LEFT JOIN ( 27 SELECT DISTINCT sky_id, 28 stackRun.skycell_id, 29 stackRun.label, 30 stackRun.data_group, 31 COUNT(stack_id) AS num_filter 32 FROM staticskyRun 33 JOIN staticskyInput USING(sky_id) 34 JOIN stackRun USING(stack_id) 35 JOIN stackSumSkyfile USING(stack_id) 36 WHERE 1 37 -- WHERE hook 2 %s 38 GROUP BY sky_id 39 ) AS oldRuns 40 USING(label, data_group, num_filter, skycell_id) 21 41 WHERE num_filter = %d 22 42 -- WHERE hook 3 %s -
trunk/ippTools/src/staticskytool.c
r31293 r31681 128 128 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 129 129 PXOPT_LOOKUP_BOOL(check_inputs, config->args, "-check_inputs", false); 130 PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false); 130 131 131 132 psString select = pxDataGet("staticskytool_definebyquery_select.sql"); … … 149 150 psFree(whereMD); 150 151 151 if (!p_psDBRunQueryF(config->dbh, select, where, num_filter)) { 152 psString make_unique = NULL; 153 if (!rerun) { 154 psStringAppend(&make_unique, "\nAND sky_id IS NULL"); 155 } 156 157 if (!p_psDBRunQueryF(config->dbh, select, where, where, num_filter, make_unique ? make_unique : "")) { 152 158 psError(PS_ERR_UNKNOWN, false, "database error"); 153 159 psFree(select); … … 155 161 } 156 162 psFree(select); 163 psFree(make_unique); 157 164 158 165 // we now have a list of (tess_id, skycell_id) that (potentially) meet out needs -
trunk/ippTools/src/staticskytoolConfig.c
r31293 r31681 61 61 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_reduction", 0, "define reduction", NULL); 62 62 psMetadataAddTime(definebyqueryArgs, PS_LIST_TAIL, "-set_registered", 0, "time detrend run was registered", now); 63 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-rerun", 0, "queue new run even if one already exists for inputs", false); 63 64 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-pretend", 0, "do not actually modify the database", false); 64 65 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-check_inputs", 0, "list inputs, do not modify database", false);
Note:
See TracChangeset
for help on using the changeset viewer.
