Changeset 30579 for branches/eam_branches/ipp-20101205/ippTools/src
- Timestamp:
- Feb 11, 2011, 2:49:34 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20101205/ippTools/src
- Files:
-
- 13 edited
-
. (modified) (1 prop)
-
chiptool.c (modified) (3 diffs)
-
difftool.c (modified) (3 diffs)
-
disttool.c (modified) (1 diff)
-
disttoolConfig.c (modified) (1 diff)
-
dqstatstool.c (modified) (6 diffs)
-
magicdstool.c (modified) (4 diffs)
-
magictool.c (modified) (1 diff, 1 prop)
-
magictoolConfig.c (modified) (1 diff)
-
pstamptool.c (modified) (2 diffs)
-
pstamptoolConfig.c (modified) (1 diff)
-
pxtools.h (modified) (1 diff)
-
warptool.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/ippTools/src
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20101205/ippTools/src/chiptool.c
r30102 r30579 838 838 PXOPT_COPY_S16(config->args, where, "-fault", "chipProcessedImfile.fault", "=="); 839 839 840 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 841 840 842 if (!psListLength(where->list) 841 843 && !psMetadataLookupBool(NULL, config->args, "-all")) { … … 874 876 } 875 877 psFree(query); 878 879 if (!fault) { 880 // If fault has not been supplied, don't revert update faults with the magic value 881 // We don't do this for new runs because then they would never complete 882 // quality should be used to drop bad components 883 psStringAppend(&query_update, " AND (chipProcessedImfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT); 884 } 876 885 if (!p_psDBRunQuery(config->dbh, query_update)) { 877 886 psError(PS_ERR_UNKNOWN, false, "database error"); … … 1919 1928 } 1920 1929 1930 // we do not update components with the magic fault value. They are non-updateable 1931 psStringAppend(&query, " AND (chipProcessedImfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT); 1932 1921 1933 if (!p_psDBRunQueryF(config->dbh, query, setHook, chip_id)) { 1922 1934 psError(PS_ERR_UNKNOWN, false, "database error"); -
branches/eam_branches/ipp-20101205/ippTools/src/difftool.c
r30530 r30579 917 917 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 918 918 919 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 920 919 921 if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) { 920 922 psFree(where); … … 950 952 psLogMsg("difftool", PS_LOG_INFO, "Deleted %" PRIu64 " rows", psDBAffectedRows(config->dbh)); 951 953 954 if (!fault) { 955 // If fault has not been supplied, don't revert update faults with the magic value 956 // We don't do this for new runs because then they would never complete 957 // quality should be used to drop bad components 958 psStringAppend(&query_updated, " AND (diffSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT); 959 } 952 960 if (!p_psDBRunQuery(config->dbh, query_updated)) { 953 961 psError(PS_ERR_UNKNOWN, false, "database error"); … … 3201 3209 psStringAppend(&query, " AND (diffSkyfile.skycell_id = '%s')", skycell_id); 3202 3210 } 3211 // we do not update components with the magic fault value. They are non-updateable 3212 // (But can be recovered with "difftool -revertwarped -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT) 3213 psStringAppend(&query, " AND (diffSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT); 3203 3214 3204 3215 if (!p_psDBRunQueryF(config->dbh, query, setHook, diff_id)) { -
branches/eam_branches/ipp-20101205/ippTools/src/disttool.c
r30446 r30579 1185 1185 PXOPT_COPY_S64(config->args, where, "-stage_id", "stage_id", "=="); 1186 1186 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 1187 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");1187 pxAddLabelSearchArgs(config, where, "-label", "label", "=="); 1188 1188 PXOPT_COPY_S16(config->args, where, "-fault", "rcDSFileset.fault", "=="); 1189 1189 -
branches/eam_branches/ipp-20101205/ippTools/src/disttoolConfig.c
r29067 r30579 197 197 psMetadataAddS64(revertfilesetArgs, PS_LIST_TAIL, "-stage_id",0, "define stage_id", 0); 198 198 psMetadataAddStr(revertfilesetArgs, PS_LIST_TAIL, "-state", 0, "define state", NULL); 199 psMetadataAddStr(revertfilesetArgs, PS_LIST_TAIL, "-label", 0, "define label", NULL);199 psMetadataAddStr(revertfilesetArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "define label", NULL); 200 200 psMetadataAddS16(revertfilesetArgs, PS_LIST_TAIL, "-fault", 0, "define fault code", 0); 201 201 psMetadataAddBool(revertfilesetArgs, PS_LIST_TAIL, "-all", 0, "revert all faulted runs", NULL); -
branches/eam_branches/ipp-20101205/ippTools/src/dqstatstool.c
r28427 r30579 92 92 } 93 93 else { 94 psStringAppend(&query, " AND ( invalid IS NULL OR invalid = 1) ");94 psStringAppend(&query, " AND (warp_id IS NOT NULL AND invalid IS NULL) "); 95 95 } 96 96 … … 402 402 403 403 if (psMetadataLookupStr(&status,enginedef,"COLNAME")&& 404 isfinite(psMetadataLookupF32(&status,enginedef,"MINIMUM"))&& 405 isfinite(psMetadataLookupF32(&status,enginedef,"MAXIMUM"))) { 404 (strcmp(psMetadataLookupStr(&status,enginedef,"RULETYPE"),"STRICT") == 0)&& 405 (isfinite(psMetadataLookupF32(&status,enginedef,"MINIMUM"))&& 406 isfinite(psMetadataLookupF32(&status,enginedef,"MAXIMUM")))) { 406 407 psArrayAdd(decisionRules,decisionRules->n,enginedef); 408 } 409 else if (psMetadataLookupStr(&status,enginedef,"COLNAME")&& 410 (strcmp(psMetadataLookupStr(&status,enginedef,"RULETYPE"),"CDF") == 0)&& 411 (isfinite(psMetadataLookupF32(&status,enginedef,"CDF00"))&& 412 isfinite(psMetadataLookupF32(&status,enginedef,"CDF50"))&& 413 isfinite(psMetadataLookupF32(&status,enginedef,"CDF100")))) { 414 psArrayAdd(decisionRules,decisionRules->n, enginedef); 415 } 416 else if (strcmp(psMetadataLookupStr(&status,enginedef,"RULETYPE"),"UNUSED") == 0) { 407 417 } 408 418 else { … … 637 647 // Calculate if this exposure was "good" or not. 638 648 bool accept = true; 649 psF32 quality = 1.0; 639 650 for (long j = 0; j < decisionRules->n; j++) { 640 651 psMetadata *rule = decisionRules->data[j]; … … 644 655 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find column name"); 645 656 return(false); 646 }647 psF32 min_value = psMetadataLookupF32(&status,rule,"MINIMUM");648 if (!status) {649 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find min value for %s",colname);650 return(false);651 }652 psF32 max_value = psMetadataLookupF32(&status,rule,"MAXIMUM");653 if (!status) {654 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find max value for %s",colname);655 return(false);656 }657 psString filter = psMetadataLookupStr(&status,rule,"FILTER");658 if (!status) {659 status = true;660 }661 if (filter) {662 psString imfilter = psMetadataLookupStr(&status,tableRow,"FILTER");663 if (strcmp(filter,imfilter) != 0) {664 continue;665 }666 657 } 667 658 // Not happy with this being set to a F32. Can this ever be something else? 668 659 psF32 value = psMetadataLookupF32(&status,tableRow,colname); 669 660 if (!status) { 670 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find column %s (%f %f %f) in compare with rule.",colname,min_value,max_value,value); 661 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find column %s (%f) in compare with rule.", 662 colname,value); 671 663 psFree(colNames); 672 664 psFree(colTypes); … … 677 669 return(false); 678 670 } 679 if ((value > max_value)||(value < min_value)) { 680 accept = false; 681 } 671 psString filter = psMetadataLookupStr(&status,rule,"FILTER"); 672 if (!status) { 673 status = true; 674 } 675 if (filter) { 676 psString imfilter = psMetadataLookupStr(&status,tableRow,"FILTER"); 677 if (strcmp(filter,imfilter) != 0) { 678 continue; 679 } 680 } 681 682 if (strcmp(psMetadataLookupStr(&status,rule,"RULETYPE"),"STRICT") == 0) { 683 psF32 min_value = psMetadataLookupF32(&status,rule,"MINIMUM"); 684 if (!status) { 685 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find min value for %s",colname); 686 return(false); 687 } 688 psF32 max_value = psMetadataLookupF32(&status,rule,"MAXIMUM"); 689 if (!status) { 690 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find max value for %s",colname); 691 return(false); 692 } 693 694 if ((value > max_value)||(value < min_value)) { 695 accept = false; 696 } 697 } // End STRICT min/max rule parsing 698 else if (strcmp(psMetadataLookupStr(&status,rule,"RULETYPE"),"CDF") == 0) { 699 // I'm just going to implement a quick linear interpolation over the points that exist. 700 psF32 min_value,max_value = 99; 701 psF32 min_cdf = 0.0,max_cdf = 1.0; 702 psF32 cdf; 703 psF32 try[22] = {0.00,0.05,0.10,0.15,0.20,0.25,0.30,0.35,0.40,0.45,0.50, 704 0.55,0.60,0.65,0.70,0.75,0.80,0.85,0.90,0.95,0.99,1.00}; 705 int i; 706 int done = 0; 707 status = true; 708 min_value = psMetadataLookupF32(&status,rule,"CDF00"); 709 min_cdf = 0.0; 710 if (!isfinite(value)) { 711 quality = 0.0; 712 continue; 713 } 714 if (!status) { 715 status = true; 716 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find CDF00 value for %s",colname); 717 } 718 if (value < min_value) { 719 if (quality > min_cdf) { 720 quality = 0.0; 721 continue; 722 } 723 } 724 725 for (i = 1; i < 22; i++) { 726 psString label = psStringCopy(""); 727 psStringAppend(&label,"CDF%02d",(int) (100 * try[i])); 728 729 max_value = psMetadataLookupF32(&status,rule,label); 730 max_cdf = try[i]; 731 if (!status) { 732 status = true; 733 psError(PS_EXIT_CONFIG_ERROR, false, "Unable to find %s value for %s",label,colname); 734 } 735 if ((value < max_value)&&(value > min_value)) { 736 cdf = ((value - min_value) * max_cdf + (max_value - value) * min_cdf) / (max_value - min_value); 737 // fprintf(stderr,"value: %f %f %f %f %f %f %d %d %f\n",value,quality,min_cdf,min_value,max_cdf,max_value, value < max_value, value > min_value,cdf); 738 if (quality > cdf) { 739 quality = cdf; 740 done = 1; 741 i = 25; 742 } 743 } 744 min_value = max_value; 745 min_cdf = max_cdf; 746 } 747 if (done) { 748 continue; 749 } 750 // Reached end of array without finding the value; 751 if (value > min_value) { 752 if (quality > min_cdf) { 753 quality = 1.0; 754 } 755 } 756 757 758 } // End CDF rule parsing 682 759 } 683 760 bool success; … … 695 772 return(false); 696 773 } 774 success = psMetadataAddF32(tableRow,PS_LIST_TAIL,"QUALITY",0,"",quality); 775 if (!success) { 776 psError(PS_ERR_UNKNOWN,false, "Error adding exposure quality to fits table row."); 777 psFree(colNames); 778 psFree(colTypes); 779 psFree(contents); 780 psFree(query); 781 psFree(outTable); 782 psFree(statsoutput); 783 psFree(statIter); 784 psFree(tableRow); 785 return(false); 786 } 697 787 698 788 // Add the row to the table array. -
branches/eam_branches/ipp-20101205/ippTools/src/magicdstool.c
r30446 r30579 1112 1112 1113 1113 PXOPT_LOOKUP_STR(state, config->args, "-state", false, false); 1114 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 1114 1115 1115 1116 psString queryFile = NULL; 1117 bool stateIsUpdate = false; 1116 1118 if (state) { 1117 1119 if (! strcmp(state, "new") || !strcmp(state, "goto_restored")) { … … 1119 1121 } else if (!strcmp(state, "update")) { 1120 1122 queryFile = "magicdstool_revertupdated.sql"; 1123 stateIsUpdate = true; 1121 1124 } else { 1122 1125 psError(PXTOOLS_ERR_SYS, true, "%s is not a valid value for state", state); … … 1141 1144 } 1142 1145 psFree(where); 1146 1147 if (stateIsUpdate && !fault) { 1148 // If fault has not been supplied, don't revert update faults with 1149 // the magic "do not update" value 1150 // We don't do this for new runs because then they would never complete 1151 // quality should be used to drop bad components 1152 psStringAppend(&query, " AND magicDSFile.fault != %d", PXTOOL_DO_NOT_REVERT_FAULT); 1153 } 1143 1154 1144 1155 if (!p_psDBRunQuery(config->dbh, query)) { … … 1744 1755 } 1745 1756 1757 // we do not update components with the magic fault value. They are non-updateable 1758 // (But can be recovered with "magicdstool -revertdestreakedfile -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT) 1759 psStringAppend(&query, " AND (magicDSFile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT); 1760 1746 1761 if (!p_psDBRunQueryF(config->dbh, query, setHook, magic_ds_id)) { 1747 1762 psError(PS_ERR_UNKNOWN, false, "database error"); -
branches/eam_branches/ipp-20101205/ippTools/src/magictool.c
- Property svn:mergeinfo changed
/trunk/ippTools/src/magictool.c merged: 30497
r30446 r30579 627 627 PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "=="); 628 628 PXOPT_COPY_S16(config->args, where, "-fault", "fault", "=="); 629 PXOPT_COPY_STR(config->args, where, "-label", "label", "==");629 pxAddLabelSearchArgs (config, where, "-label", "magicRun.label", "=="); 630 630 631 631 psString query = psStringCopy("UPDATE magicRun SET fault = 0 WHERE state = 'new' AND fault != 0"); - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20101205/ippTools/src/magictoolConfig.c
r30446 r30579 114 114 psMetadataAddS64(reverttreeArgs, PS_LIST_TAIL, "-magic_id", 0, "search by magictool ID", 0); 115 115 psMetadataAddS16(reverttreeArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 116 psMetadataAddStr(reverttreeArgs, PS_LIST_TAIL, "-label", 0, "search by label", NULL);116 psMetadataAddStr(reverttreeArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", NULL); 117 117 118 118 // -inputs -
branches/eam_branches/ipp-20101205/ippTools/src/pstamptool.c
r30446 r30579 571 571 PXOPT_COPY_S32(config->args, where, "-fault", "fault", "=="); 572 572 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 573 PXOPT_COPY_STR(config->args, where, "-reqType", "reqType", "=="); 574 PXOPT_COPY_STR(config->args, where, "-name", "name", "LIKE"); 573 575 PXOPT_COPY_TIME(config->args, where, "-timestamp_begin", "timestamp", ">="); 574 576 PXOPT_COPY_TIME(config->args, where, "-timestamp_end", "timestamp", "<="); … … 586 588 psStringAppend(&query, ", state = '%s'", state); 587 589 if (!strcmp(state, "goto_cleaned")) { 588 psStringAppend(&stateCheck, " AND state != 'cleaned'");590 psStringAppend(&stateCheck, " AND (state != 'cleaned' AND state != 'goto_cleaned')"); 589 591 } 590 592 } -
branches/eam_branches/ipp-20101205/ippTools/src/pstamptoolConfig.c
r30446 r30579 104 104 psMetadataAddS16(updatereqArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 105 105 psMetadataAddStr(updatereqArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL); 106 psMetadataAddStr(updatereqArgs, PS_LIST_TAIL, "-reqType", 0, "search by reqType", NULL); 107 psMetadataAddStr(updatereqArgs, PS_LIST_TAIL, "-name", 0, "search by reqType (LIKE comparsion)", NULL); 106 108 psMetadataAddStr(updatereqArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by pstampJob label (LIKE comparision)", NULL); 107 109 psMetadataAddTime(updatereqArgs, PS_LIST_TAIL, "-timestamp_begin", 0, "search by timestamp (>=)", NULL); -
branches/eam_branches/ipp-20101205/ippTools/src/pxtools.h
r28486 r30579 51 51 # define MAX_ROWS 10e9 52 52 # define PXTOOL_MODE_NONE 0x0 53 // we do not revert or update components with this fault value 54 // This is the same value as PSTAMP_GONE 55 # define PXTOOL_DO_NOT_REVERT_FAULT 26 53 56 54 57 bool pxIsValidState(const char *state); -
branches/eam_branches/ipp-20101205/ippTools/src/warptool.c
r29903 r30579 1485 1485 PXOPT_COPY_S16(config->args, where, "-fault", "warpSkyfile.fault", "=="); 1486 1486 1487 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 1488 1487 1489 if (!psListLength(where->list) 1488 1490 && !psMetadataLookupBool(NULL, config->args, "-all")) { … … 1510 1512 } 1511 1513 psFree(where); 1514 1515 if (!fault) { 1516 // If fault has not been supplied, don't revert update faults with the magic value 1517 // We don't do this for new runs because then they would never complete 1518 // quality should be used to drop bad components 1519 psStringAppend(&query_updated, " AND warpSkyfile.fault != %d", PXTOOL_DO_NOT_REVERT_FAULT); 1520 } 1512 1521 1513 1522 if (!p_psDBRunQuery(config->dbh, query)) { … … 2003 2012 // shared code for the modes -tocleanedskyfile -tofullskyfile -topurgedskyfile 2004 2013 2005 static bool change_skyfile_data_state(pxConfig *config, psString data_state , psString run_state)2014 static bool change_skyfile_data_state(pxConfig *config, psString data_state) 2006 2015 { 2007 2016 PS_ASSERT_PTR_NON_NULL(config, false); … … 2065 2074 static bool tocleanedskyfileMode(pxConfig *config) 2066 2075 { 2067 return change_skyfile_data_state(config, "cleaned" , "goto_cleaned");2076 return change_skyfile_data_state(config, "cleaned"); 2068 2077 } 2069 2078 static bool tofullskyfileMode(pxConfig *config) 2070 2079 { 2071 return change_skyfile_data_state(config, "full" , "update");2080 return change_skyfile_data_state(config, "full"); 2072 2081 } 2073 2082 static bool topurgedskyfileMode(pxConfig *config) 2074 2083 { 2075 return change_skyfile_data_state(config, "purged" , "goto_purged");2084 return change_skyfile_data_state(config, "purged"); 2076 2085 } 2077 2086 static bool toscrubbedskyfileMode(pxConfig *config) 2078 2087 { 2079 return change_skyfile_data_state(config, "scrubbed" , "goto_scrubbed");2088 return change_skyfile_data_state(config, "scrubbed"); 2080 2089 } 2081 2090 … … 2101 2110 else { 2102 2111 if (strcmp(state,"error_cleaned") == 0) { 2103 change_skyfile_data_state(config,"error_cleaned" ,"goto_cleaned");2112 change_skyfile_data_state(config,"error_cleaned"); 2104 2113 } 2105 2114 else if (strcmp(state, "error_scrubbed") == 0) { 2106 change_skyfile_data_state(config,"error_scrubbed" ,"goto_scrubbed");2115 change_skyfile_data_state(config,"error_scrubbed"); 2107 2116 } 2108 2117 else if (strcmp(state, "error_purged") == 0) { 2109 change_skyfile_data_state(config,"error_purged" ,"goto_purged");2118 change_skyfile_data_state(config,"error_purged"); 2110 2119 } 2111 2120 else { … … 2526 2535 psStringAppend(&query, " AND (warpSkyfile.skycell_id = '%s')", skycell_id); 2527 2536 } 2537 // we do not update components with the magic fault value. They are non-updateable 2538 // (But can be recovered with "warptool -revertwarped -fault 26" (PXTOOL_DO_NOT_REVERT_FAULT) 2539 psStringAppend(&query, " AND (warpSkyfile.fault != %d)", PXTOOL_DO_NOT_REVERT_FAULT); 2528 2540 2529 2541 if (!p_psDBRunQueryF(config->dbh, query, setHook, warp_id)) {
Note:
See TracChangeset
for help on using the changeset viewer.
