Changeset 30906
- Timestamp:
- Mar 15, 2011, 9:05:36 AM (15 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
disttool.c (modified) (5 diffs)
-
disttoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/disttool.c
r30551 r30906 141 141 PXOPT_LOOKUP_BOOL(use_alternate, config->args, "-use_alternate", false); 142 142 PXOPT_LOOKUP_BOOL(no_magic, config->args, "-no_magic", false); 143 PXOPT_LOOKUP_BOOL(i_am_sure, config->args, "-i_am_sure", false); 143 144 PXOPT_LOOKUP_STR(set_label, config->args, "-set_label", false, false); 144 145 PXOPT_LOOKUP_STR(set_data_group, config->args, "-set_data_group", false, false); … … 150 151 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 151 152 153 // select arguments 154 psMetadata *where = psMetadataAlloc(); 155 156 PXOPT_COPY_S64(config->args, where, "-target_id", "distTarget.target_id", "=="); 157 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); 158 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 159 PXOPT_COPY_STR(config->args, where, "-exp_type", "exp_type", "==");; 160 PXOPT_COPY_STR(config->args, where, "-dist_group", "distTarget.dist_group", "==");; 161 162 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 163 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", false, false); 164 PXOPT_LOOKUP_STR(exp_type, config->args, "-exp_type", false, false); 165 PXOPT_LOOKUP_STR(dist_group, config->args, "-dist_group", false, false); 166 167 // queuing no_magic runs can be quite dangerous. Require confirmation 168 if (no_magic && !pretend && !i_am_sure) { 169 psError(PXTOOLS_ERR_SYS, true, "-i_am_sure required to queue no_magic distribution runs"); 170 return false; 171 } 172 152 173 if (use_alternate) { 153 174 if (strcmp(stage, "raw")) { … … 161 182 } 162 183 163 // select arguments 164 psMetadata *where = psMetadataAlloc(); 165 166 PXOPT_COPY_S64(config->args, where, "-target_id", "distTarget.target_id", "=="); 167 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); 168 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 169 170 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 171 PXOPT_LOOKUP_STR(dist_group, config->args, "-dist_group", false, false); 184 // We want to possible to distribute unmagicked raw exposures for the purpose 185 // of distributing detrend inputs 186 // To make it less likely that unmagicked raw stage exposures from being distributed 187 // accidentally we require that dist_group (to select target and destination with 188 // an interest) 189 // and exp_id to be supplied. We could add -exp_type and dateobs cuts to make it easier 190 if (!strcmp(stage, "raw") && no_magic && !(exp_id && dist_group && exp_type)) { 191 psError(PXTOOLS_ERR_SYS, true, "exp_id, exp_type, and dist_group are required for raw stage if no_magic"); 192 return false; 193 } 194 172 195 173 196 psString query = NULL; … … 182 205 runJoinStr = "camRun.exp_id"; 183 206 } 184 query = pxDataGet("disttool_definebyquery_raw.sql"); 207 if (!no_magic) { 208 query = pxDataGet("disttool_definebyquery_raw.sql"); 209 } else { 210 query = pxDataGet("disttool_definebyquery_raw_no_magic.sql"); 211 } 185 212 if (!query) { 186 213 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); … … 189 216 } 190 217 191 // for raw stage we select by camRun.label and dist_group because rawExp doesn't have those columns 192 if (label) { 193 psStringAppend(&query, " AND (magicDSRun.label = '%s')", label); 194 } 195 if (dist_group) { 196 psStringAppend(&query, " AND (camRun.dist_group = '%s')", dist_group); 218 if (!no_magic) { 219 if (label) { 220 psStringAppend(&query, " AND (magicDSRun.label = '%s')", label); 221 } 222 // for raw stage we select by camRun.label and dist_group because rawExp 223 // doesn't have those columns 224 if (dist_group) { 225 psStringAppend(&query, " AND (camRun.dist_group = '%s')", dist_group); 226 } 197 227 } 198 228 } else if (!strcmp(stage, "chip")) { -
trunk/ippTools/src/disttoolConfig.c
r30551 r30906 49 49 50 50 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-no_magic", 0, "magic is not needed", false); 51 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-i_am_sure", 0, "confirmation needed when -no_magic is supplied", false); 51 52 psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-use_alternate", 0, "use alternate inputs", false); 52 53 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label", 0, "define label for run", NULL); … … 57 58 58 59 // select args 59 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-target_id", 0, "define target_id", 0); 60 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-exp_id", 0, "define exp_id", 0); 61 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-chip_id", 0, "define chip_id", 0); 60 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-target_id", 0, "select by target_id", 0); 61 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-exp_id", 0, "select by exp_id", 0); 62 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-exp_type", 0, "select by exp_type", NULL); 63 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-chip_id", 0, "select by chip_id", 0); 62 64 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", 0, "select by run label", NULL); 63 65 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-dist_group", 0, "select by dist_group", NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
