Changeset 35460
- Timestamp:
- May 1, 2013, 3:32:11 PM (13 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
releasetool.c (modified) (5 diffs)
-
releasetoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/releasetool.c
r35437 r35460 856 856 } 857 857 858 psString joinConditions = psStringCopy(""); 859 // Finish up the selectors for the JOIN to previousRelStack 860 // join to rows with our stack_type 861 psStringAppend(&joinConditions, "\nAND previousRelStack.stack_type = '%s'", stack_type); 862 863 if (!strcmp(stack_type, "nightly")) { 864 // detect nightly stack entries that already exist for this day 865 psStringAppend(&joinConditions, "\nAND previousRelStack.mjd_obs = floor(stackSumSkyfile.mjd_obs)"); 866 } 867 868 // Add in the where conditions 858 869 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 859 psStringAppend(&query, " AND %s", whereClause);870 psStringAppend(&query, "\nAND %s", whereClause); 860 871 psFree(whereClause); 872 873 if (!strcmp(stack_type, "nightly")) { 874 // avoid stacks with NAN mjd_obs. These are old skycells that were lost due to system failure 875 // prior to the time that the mjd_obs was extracted from the headers and added to stackSumSkyfile 876 psStringAppend(&query, "\nAND stackSumSkyfile.mjd_obs IS NOT NULL"); 877 } 861 878 862 879 psFree(where); … … 868 885 } 869 886 870 if (!p_psDBRunQuery (config->dbh, query)) {887 if (!p_psDBRunQueryF(config->dbh, query, joinConditions)) { 871 888 psError(PS_ERR_UNKNOWN, false, "database error"); 872 889 psFree(query); 890 psFree(joinConditions); 873 891 return false; 874 892 } 875 893 psFree(query); 894 psFree(joinConditions); 876 895 877 896 psArray *output = p_psDBFetchResult(config->dbh); … … 993 1012 PXOPT_COPY_F32(config->args, where, "-mjd_min", "stackSumSkyfile.mjd_obs", ">="); 994 1013 PXOPT_COPY_F32(config->args, where, "-mjd_max", "stackSumSkyfile.mjd_obs", "<="); 995 PXOPT_COPY_F32(config->args, where, "-fwhm_min", "skycalResult.fwhm_minor", ">=");996 PXOPT_COPY_F32(config->args, where, "-fwhm_max", "skycalresult.fwhm_major", "<=");997 1014 PXOPT_COPY_STR(config->args, where, "-tess_id", "relStack.tess_id", "=="); 998 1015 PXOPT_COPY_STR(config->args, where, "-skycell_id", "relStack.skycell_id", "LIKE"); 1016 PXOPT_COPY_STR(config->args, where, "-stack_type", "relStack.stack_type", "=="); 999 1017 PXOPT_COPY_STR(config->args, where, "-stack_data_group", "stackRun.data_group", "LIKE"); 1000 1018 PXOPT_COPY_STR(config->args, where, "-skycal_data_group", "skycalRun.data_group", "LIKE"); … … 1003 1021 PXOPT_COPY_S32(config->args, where, "-rel_id", "relExp.rel_id", "=="); 1004 1022 pxskycellAddWhere(config, where); 1023 1024 PXOPT_COPY_F32(config->args, where, "-fwhm_min", "IFNULL(skycalResult.fwhm_major, 999)", ">="); 1025 PXOPT_COPY_F32(config->args, where, "-fwhm_max", "IFNULL(skycalResult.fwhm_major, 0)", "<="); 1005 1026 1006 1027 PXOPT_LOOKUP_BOOL(priority_order, config->args, "-priority_order", false); … … 1495 1516 PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "rawExp.dateobs", "<="); 1496 1517 PXOPT_COPY_F32(config->args, where, "-fwhm_min", "skycalResult.fwhm_major", ">="); 1497 PXOPT_COPY_F32(config->args, where, "-fwhm_max", "skycal result.fwhm_major", "<=");1518 PXOPT_COPY_F32(config->args, where, "-fwhm_max", "skycalResult.fwhm_major", "<="); 1498 1519 PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_ame", "=="); 1499 1520 PXOPT_COPY_S64(config->args, where, "-exp_id", "relExp.exp_id", "=="); -
trunk/ippTools/src/releasetoolConfig.c
r35437 r35460 227 227 psMetadataAddStr(listrelstackArgs, PS_LIST_TAIL, "-tess_id", 0, "select by tess_id", NULL); 228 228 psMetadataAddStr(listrelstackArgs, PS_LIST_TAIL, "-skycell_id", 0, "select by skycell_id (LIKE comparision)", NULL); 229 psMetadataAddStr(listrelstackArgs, PS_LIST_TAIL, "-stack_type", 0, "select by stack_type", NULL); 229 230 230 231 psMetadataAddStr(listrelstackArgs, PS_LIST_TAIL, "-stack_data_group", 0, "select by stackRun.data_group (LIKE comparison)", NULL);
Note:
See TracChangeset
for help on using the changeset viewer.
