Changeset 35546 for branches/eam_branches/ipp-20130419/ippTools/src
- Timestamp:
- May 9, 2013, 11:26:59 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130419/ippTools/src
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
camtool.c (modified) (1 prop)
-
camtoolConfig.c (modified) (1 prop)
-
magictool.c (modified) (1 prop)
-
releasetool.c (modified) (11 diffs)
-
releasetoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130419/ippTools/src
- Property svn:mergeinfo changed
/trunk/ippTools/src merged: 35430,35437,35460,35470,35473
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130419/ippTools/src/camtool.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130419/ippTools/src/camtoolConfig.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130419/ippTools/src/magictool.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20130419/ippTools/src/releasetool.c
r35397 r35546 702 702 PXOPT_COPY_STR(config->args, where, "-cam_data_group", "camRun.data_group", "LIKE"); 703 703 PXOPT_COPY_STR(config->args, where, "-warp_data_group", "warpRun.data_group", "LIKE"); 704 PXOPT_COPY_STR(config->args, where, "-tess_id", "warpRun.tess_id", "=="); 705 PXOPT_COPY_STR(config->args, where, "-skycell_id", "warpSkyfile.skycell_id", "=="); 706 707 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", false, false); 704 708 705 709 PXOPT_COPY_STR(config->args, where, "-surveyName", "survey.surveyName", "LIKE"); … … 715 719 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 716 720 return false; 721 } 722 723 if (skycell_id) { 724 psStringAppend(&query, "\nJOIN warpSkyfile ON warpRun.warp_id = warpSkyfile.warp_id AND warpRun.tess_id = warpSkyfile.tess_id"); 717 725 } 718 726 … … 741 749 742 750 if (priority_order) { 743 psStringAppend(&query, "\nAND priority > 0 order by exp_id, priority ");751 psStringAppend(&query, "\nAND priority > 0 order by exp_id, priority DESC"); 744 752 } 745 753 … … 787 795 bool includeSkycal = false; 788 796 797 PXOPT_COPY_STR(config->args, where, "-skycal_label", "skycalRun.label", "=="); 798 PXOPT_COPY_STR(config->args, where, "-skycal_data_group", "skycalRun.data_group", "LIKE"); 789 799 PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycalRun.skycal_id", "=="); 790 PXOPT_COPY_STR(config->args, where, "-skycal_label", "skycalRun.label", "==");791 PXOPT_COPY_STR(config->args, where, "-skycal_data_group", "skycalRun.data_group", "==");792 800 if (psListLength(where->list)) { 793 801 includeSkycal = true; … … 795 803 796 804 PXOPT_COPY_STR(config->args, where, "-label", "stackRun.label", "=="); 797 PXOPT_COPY_STR(config->args, where, "-data_group", "stackRun.data_group", " ==");805 PXOPT_COPY_STR(config->args, where, "-data_group", "stackRun.data_group", "LIKE"); 798 806 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackRun.stack_id", "=="); 799 807 … … 848 856 } 849 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 850 869 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 851 psStringAppend(&query, " AND %s", whereClause);870 psStringAppend(&query, "\nAND %s", whereClause); 852 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 } 853 878 854 879 psFree(where); … … 860 885 } 861 886 862 if (!p_psDBRunQuery (config->dbh, query)) {887 if (!p_psDBRunQueryF(config->dbh, query, joinConditions)) { 863 888 psError(PS_ERR_UNKNOWN, false, "database error"); 864 889 psFree(query); 890 psFree(joinConditions); 865 891 return false; 866 892 } 867 893 psFree(query); 894 psFree(joinConditions); 868 895 869 896 psArray *output = p_psDBFetchResult(config->dbh); … … 985 1012 PXOPT_COPY_F32(config->args, where, "-mjd_min", "stackSumSkyfile.mjd_obs", ">="); 986 1013 PXOPT_COPY_F32(config->args, where, "-mjd_max", "stackSumSkyfile.mjd_obs", "<="); 987 PXOPT_COPY_F32(config->args, where, "-fwhm_min", "skycalResult.fwhm_minor", ">=");988 PXOPT_COPY_F32(config->args, where, "-fwhm_max", "skycalresult.fwhm_major", "<=");989 1014 PXOPT_COPY_STR(config->args, where, "-tess_id", "relStack.tess_id", "=="); 990 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", "=="); 991 1017 PXOPT_COPY_STR(config->args, where, "-stack_data_group", "stackRun.data_group", "LIKE"); 992 1018 PXOPT_COPY_STR(config->args, where, "-skycal_data_group", "skycalRun.data_group", "LIKE"); … … 996 1022 pxskycellAddWhere(config, where); 997 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)", "<="); 1026 998 1027 PXOPT_LOOKUP_BOOL(priority_order, config->args, "-priority_order", false); 999 1028 1000 1029 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1001 1030 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1031 1032 pxAddLabelSearchArgs (config, where, "-stack_type", "relStack.stack_type", "=="); 1002 1033 1003 1034 psString query = pxDataGet("releasetool_listrelstack.sql"); … … 1018 1049 1019 1050 if (priority_order) { 1020 psStringAppend(&query, "\nAND priority > 0 order by stack_id, priority ");1051 psStringAppend(&query, "\nAND priority > 0 order by stack_id, priority DESC"); 1021 1052 } 1022 1053 … … 1487 1518 PXOPT_COPY_TIME(config->args, where, "-dateobs_end", "rawExp.dateobs", "<="); 1488 1519 PXOPT_COPY_F32(config->args, where, "-fwhm_min", "skycalResult.fwhm_major", ">="); 1489 PXOPT_COPY_F32(config->args, where, "-fwhm_max", "skycal result.fwhm_major", "<=");1520 PXOPT_COPY_F32(config->args, where, "-fwhm_max", "skycalResult.fwhm_major", "<="); 1490 1521 PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_ame", "=="); 1491 1522 PXOPT_COPY_S64(config->args, where, "-exp_id", "relExp.exp_id", "=="); -
branches/eam_branches/ipp-20130419/ippTools/src/releasetoolConfig.c
r35397 r35546 164 164 psMetadataAddStr(listrelexpArgs, PS_LIST_TAIL, "-cam_data_group", 0, "camRun.data_group (LIKE comparison)", NULL); 165 165 psMetadataAddStr(listrelexpArgs, PS_LIST_TAIL, "-warp_data_group", 0, "warpRun.data_group (LIKE comparison)", NULL); 166 psMetadataAddStr(listrelexpArgs, PS_LIST_TAIL, "-skycell_id", 0, "select by skycell", NULL); 167 psMetadataAddStr(listrelexpArgs, PS_LIST_TAIL, "-tess_id", 0, "warpRun.tess_id", NULL); 166 168 167 169 psMetadataAddStr(listrelexpArgs, PS_LIST_TAIL, "-surveyName", 0, "select by survey name (LIKE comparision)", NULL); … … 220 222 psMetadataAddF32(listrelstackArgs, PS_LIST_TAIL, "-fwhm_max", 0, "search by seeing (<=)", NAN); 221 223 224 psMetadataAddF32(listrelstackArgs, PS_LIST_TAIL, "-mjd_min", 0, "search by MJD seeing (>=)", NAN); 225 psMetadataAddF32(listrelstackArgs, PS_LIST_TAIL, "-mjd_max", 0, "search by MJD (<=)", NAN); 226 222 227 psMetadataAddStr(listrelstackArgs, PS_LIST_TAIL, "-tess_id", 0, "select by tess_id", NULL); 223 228 psMetadataAddStr(listrelstackArgs, PS_LIST_TAIL, "-skycell_id", 0, "select by skycell_id (LIKE comparision)", NULL); 229 psMetadataAddStr(listrelstackArgs, PS_LIST_TAIL, "-stack_type", PS_META_DUPLICATE_OK, "select by stack_type", NULL); 224 230 225 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.
