- Timestamp:
- Apr 19, 2013, 3:39:39 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130307/ippTools/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
releasetool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130307/ippTools/src
- Property svn:mergeinfo changed
/trunk/ippTools/src merged: 35357-35358,35365,35397
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130307/ippTools/src/releasetool.c
r35350 r35412 832 832 PXOPT_LOOKUP_BOOL(pretend, config->args, "-pretend", false); 833 833 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 834 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 834 835 835 836 // find the parameters of all the exposures that we want to add to the release … … 852 853 853 854 psFree(where); 855 856 if (limit) { 857 psString limitString = psDBGenerateLimitSQL(limit); 858 psStringAppend(&query, " %s", limitString); 859 psFree(limitString); 860 } 854 861 855 862 if (!p_psDBRunQuery(config->dbh, query)) { … … 968 975 psMetadata *where = psMetadataAlloc(); 969 976 977 PXOPT_COPY_S64(config->args, where, "-relstack_id", "relStack.relstack_id", "=="); 978 PXOPT_COPY_S64(config->args, where, "-stack_id", "relStack.stack_id", "=="); 979 PXOPT_COPY_S64(config->args, where, "-skycal_id", "relStack.skycal_id", "=="); 980 PXOPT_COPY_S64(config->args, where, "-relstack_id", "relStack.relstack_id", "=="); 970 981 PXOPT_COPY_STR(config->args, where, "-release_name", "ippRelease.release_name", "LIKE"); 971 982 pxAddLabelSearchArgs(config, where, "-release_state","ippRelease.state", "=="); 972 PXOPT_COPY_STR(config->args, where, "-state", "rel Exp.state", "==");973 PXOPT_COPY_STR(config->args, where, "-filter", "r awExp.filter", "LIKE");974 PXOPT_COPY_ TIME(config->args, where, "-dateobs_begin","rawExp.dateobs", ">=");975 PXOPT_COPY_ TIME(config->args, where, "-dateobs_end", "rawExp.dateobs", "<=");976 PXOPT_COPY_F32(config->args, where, "-fwhm_min", "skycalResult.fwhm_m ajor", ">=");983 PXOPT_COPY_STR(config->args, where, "-state", "relStack.state", "=="); 984 PXOPT_COPY_STR(config->args, where, "-filter", "relStack.filter", "LIKE"); 985 PXOPT_COPY_F32(config->args, where, "-mjd_min", "stackSumSkyfile.mjd_obs", ">="); 986 PXOPT_COPY_F32(config->args, where, "-mjd_max", "stackSumSkyfile.mjd_obs", "<="); 987 PXOPT_COPY_F32(config->args, where, "-fwhm_min", "skycalResult.fwhm_minor", ">="); 977 988 PXOPT_COPY_F32(config->args, where, "-fwhm_max", "skycalresult.fwhm_major", "<="); 978 PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_ame", "=="); 979 PXOPT_COPY_S64(config->args, where, "-exp_id", "relExp.exp_id", "=="); 980 PXOPT_COPY_S64(config->args, where, "-chip_id", "relExp.chip_id", "=="); 981 PXOPT_COPY_S64(config->args, where, "-cam_id", "relExp.cam_id", "=="); 982 PXOPT_COPY_S64(config->args, where, "-warp_id", "warpRun.warp_id", "=="); 983 PXOPT_COPY_STR(config->args, where, "-chip_data_group", "chipRun.data_group", "LIKE"); 984 PXOPT_COPY_STR(config->args, where, "-cam_data_group", "camRun.data_group", "LIKE"); 985 PXOPT_COPY_STR(config->args, where, "-warp_data_group", "warpRun.data_group", "LIKE"); 989 PXOPT_COPY_STR(config->args, where, "-tess_id", "relStack.tess_id", "=="); 990 PXOPT_COPY_STR(config->args, where, "-skycell_id", "relStack.skycell_id", "LIKE"); 991 PXOPT_COPY_STR(config->args, where, "-stack_data_group", "stackRun.data_group", "LIKE"); 992 PXOPT_COPY_STR(config->args, where, "-skycal_data_group", "skycalRun.data_group", "LIKE"); 986 993 987 994 PXOPT_COPY_STR(config->args, where, "-surveyName", "survey.surveyName", "LIKE"); 988 995 PXOPT_COPY_S32(config->args, where, "-rel_id", "relExp.rel_id", "=="); 996 pxskycellAddWhere(config, where); 989 997 990 998 PXOPT_LOOKUP_BOOL(priority_order, config->args, "-priority_order", false); … … 993 1001 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 994 1002 995 psString query = pxDataGet("releasetool_listrel exp.sql");1003 psString query = pxDataGet("releasetool_listrelstack.sql"); 996 1004 if (!query) { 997 1005 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 998 return false;999 }1000 1001 psString where2 = NULL;1002 if (!pxspaceAddWhere(config, &where2, "rawExp")) {1003 psError(psErrorCodeLast(), false, "pxspaceAddWhere failed");1004 1006 return false; 1005 1007 } … … 1009 1011 psStringAppend(&query, "\nWHERE %s", whereClause); 1010 1012 psFree(whereClause); 1011 } else if (where2) {1012 psStringAppend(&query, "\nWHERE ");1013 1013 } else { 1014 1014 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required\n"); … … 1017 1017 } 1018 1018 1019 if (where2) {1020 psStringAppend(&query, "\n%s", where2);1021 psFree(where2);1022 }1023 1024 1019 if (priority_order) { 1025 psStringAppend(&query, "\nAND priority > 0 order by exp_id, priority");1020 psStringAppend(&query, "\nAND priority > 0 order by stack_id, priority"); 1026 1021 } 1027 1022 … … 1051 1046 } 1052 1047 1053 if (!ippdbPrintMetadatas(stdout, output, "rel Exp", !simple)) {1048 if (!ippdbPrintMetadatas(stdout, output, "relStack", !simple)) { 1054 1049 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1055 1050 psFree(output); … … 1331 1326 PS_ASSERT_PTR_NON_NULL(config, false); 1332 1327 1333 PXOPT_LOOKUP_S32(group_id, config->args, "-group_id", true, false); 1328 PXOPT_LOOKUP_S32(group_id, config->args, "-group_id", false, false); 1329 PXOPT_LOOKUP_STR(group_name, config->args, "-group_name", false, false); 1330 if (!group_id && !group_name) { 1331 psError(PXTOOLS_ERR_CONFIG, true, "either group_id or group_name is required\n"); 1332 return false; 1333 } 1334 1334 1335 1335 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); … … 1352 1352 1353 1353 PXOPT_COPY_S64(config->args, where, "-group_id", "relGroup.group_id", "=="); 1354 PXOPT_COPY_STR(config->args, where, "-group_name", "relGroup.group_name", "=="); 1354 1355 // XXX TODO if label is enabled (for changing label or state for a block) we should 1355 1356 // disallow setting some parameters such as exp_list_path
Note:
See TracChangeset
for help on using the changeset viewer.
