Changeset 42837 for trunk/ippTools/src
- Timestamp:
- May 9, 2025, 9:40:41 AM (14 months ago)
- Location:
- trunk/ippTools
- Files:
-
- 11 edited
- 9 copied
-
. (modified) (1 prop)
-
src (modified) (2 props)
-
src/Makefile.am (modified) (3 diffs)
-
src/addtool.c (modified) (3 diffs)
-
src/disttool.c (modified) (5 diffs)
-
src/disttoolConfig.c (modified) (2 diffs)
-
src/fftool.c (modified) (4 diffs)
-
src/pztool.c (modified) (6 diffs)
-
src/pztoolConfig.c (modified) (1 diff)
-
src/stacktool.c (modified) (1 diff)
-
src/staticskytool.c (modified) (1 diff)
-
src/xcfftool.c (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcfftool.c )
-
src/xcfftool.h (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcfftool.h )
-
src/xcfftoolConfig.c (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcfftoolConfig.c )
-
src/xcskytool.c (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcskytool.c )
-
src/xcskytool.h (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcskytool.h )
-
src/xcskytoolConfig.c (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcskytoolConfig.c )
-
src/xcstacktool.c (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcstacktool.c )
-
src/xcstacktool.h (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcstacktool.h )
-
src/xcstacktoolConfig.c (copied) (copied from branches/eam_branches/ipp-20230313/ippTools/src/xcstacktoolConfig.c )
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools
-
trunk/ippTools/src
- Property svn:ignore
-
old new 50 50 remotetool 51 51 fpcamtool 52 xcstacktool 53 xcskytool 54 xcfftool
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
trunk/ippTools/src/Makefile.am
r42387 r42837 24 24 stacktool \ 25 25 staticskytool \ 26 xcstacktool \ 27 xcskytool \ 28 xcfftool \ 26 29 warptool \ 27 30 receivetool \ … … 82 85 regtool.h \ 83 86 stacktool.h \ 87 xcstacktool.h \ 88 xcskytool.h \ 89 xcfftool.h \ 84 90 staticskytool.h \ 85 91 warptool.h \ … … 245 251 staticskytoolConfig.c 246 252 253 xcstacktool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 254 xcstacktool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la 255 xcstacktool_SOURCES = \ 256 xcstacktool.c \ 257 xcstacktoolConfig.c 258 259 xcskytool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 260 xcskytool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la 261 xcskytool_SOURCES = \ 262 xcskytool.c \ 263 xcskytoolConfig.c 264 265 xcfftool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 266 xcfftool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la 267 xcfftool_SOURCES = \ 268 xcfftool.c \ 269 xcfftoolConfig.c 270 247 271 pxadmin_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 248 272 pxadmin_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la -
trunk/ippTools/src/addtool.c
r42712 r42837 1694 1694 // required 1695 1695 PXOPT_LOOKUP_STR(minidvodb_group, config->args, "-set_minidvodb_group", true, false); 1696 PXOPT_LOOKUP_STR(minidvodb_path , config->args, "-set_minidvodb_path", false, false);1696 PXOPT_LOOKUP_STR(minidvodb_path_raw, config->args, "-set_minidvodb_path", false, false); 1697 1697 PXOPT_LOOKUP_STR(minidvodb_host, config->args, "-set_minidvodb_host", false, false); 1698 1698 //optional 1699 PXOPT_LOOKUP_STR(minidvodb_name , config->args, "-set_minidvodb_name", false, false);1699 PXOPT_LOOKUP_STR(minidvodb_name_raw, config->args, "-set_minidvodb_name", false, false); 1700 1700 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1701 1701 PXOPT_LOOKUP_STR(note, config->args, "-set_note", false, false); … … 1706 1706 } 1707 1707 1708 // psString minidvodbpath = "NULL";1709 1710 // I don't know how to get around the complaints of minidvodb_path can't be null. this 'fixes' it, but someone smarter can fix it properly.1711 // if (minidvodb_path) {1712 // minidvodbpath = minidvodb_path;1713 // } else {1714 // psError(PS_ERR_UNKNOWN, false, "require minidvodb_path");1715 // return false;1716 // }1717 1718 1708 if (!minidvodbRunInsert(config->dbh, 1719 1709 0, // job_id 1720 minidvodb_name ,1710 minidvodb_name_raw, 1721 1711 minidvodb_group, 1722 minidvodb_path ,1712 minidvodb_path_raw, 1723 1713 minidvodb_host, 1724 1714 "new", … … 1741 1731 printf("%" PRId64 "\n", minidvodb_id); 1742 1732 1743 1744 if (!minidvodb_name) { 1745 psStringAppend(&minidvodb_name, "%s.%" PRIu64,minidvodb_group,minidvodb_id); 1746 } 1747 if (minidvodb_path) { 1748 psStringAppend(&minidvodb_path,"/%s",minidvodb_name); 1749 } 1750 1751 psString query = NULL; 1752 1753 psStringAppend(&query, "UPDATE minidvodbRun SET minidvodb_path = '%s', minidvodb_name = '%s' where minidvodb_id = %" PRIu64";", minidvodb_path, minidvodb_name, minidvodb_id); 1754 1755 if (!p_psDBRunQuery(config->dbh, query)) { 1756 psError(PS_ERR_UNKNOWN, false, "database error"); 1757 psFree(query); 1758 return false; 1759 } 1760 1761 if (!psDBCommit(config->dbh)) { 1762 psError(PS_ERR_UNKNOWN, false, "database error"); 1763 return false; 1764 } 1733 // we created a new entry using the values supplied above for minidvodb_name_raw, minidvodb_host_raw. 1734 // If minidvodb_name is not specified, it will be generated based on the value of minidvodb_group and 1735 // the minidvodb_id of the new entry. But this means we need to insert first, get the ID, then update. 1736 1737 bool doUpdate = false; 1738 1739 // Below: note that minidvodb_name_raw and minidvodb_path_raw are stored on config->args 1740 // we need to work with a temporary external variable to avoid changing entries on the MD 1741 1742 // if minidvodb_name_raw is not specified above, create it from minidvodb_group 1743 psString minidvodb_name = NULL; 1744 if (minidvodb_name_raw) { 1745 minidvodb_name = psStringCopy (minidvodb_name_raw); 1746 } else { 1747 psStringAppend(&minidvodb_name, "%s.%" PRIu64, minidvodb_group, minidvodb_id); 1748 doUpdate = true; 1749 } 1750 1751 // if minidvodb_path_raw IS specified above, update it with the minidvodb_name 1752 psString minidvodb_path = NULL; 1753 if (minidvodb_path_raw) { 1754 psStringAppend(&minidvodb_path, "%s/%s", minidvodb_path_raw, minidvodb_name); 1755 doUpdate = true; 1756 } 1757 1758 if (doUpdate) { 1759 psString query = NULL; 1760 1761 psStringAppend(&query, "UPDATE minidvodbRun SET minidvodb_path = '%s', minidvodb_name = '%s' where minidvodb_id = %" PRIu64";", minidvodb_path, minidvodb_name, minidvodb_id); 1762 1763 if (!p_psDBRunQuery(config->dbh, query)) { 1764 psError(PS_ERR_UNKNOWN, false, "database error"); 1765 psFree(query); 1766 return false; 1767 } 1768 1769 if (!psDBCommit(config->dbh)) { 1770 psError(PS_ERR_UNKNOWN, false, "database error"); 1771 return false; 1772 } 1773 } 1774 1775 psFree (minidvodb_name); 1776 psFree (minidvodb_path); 1765 1777 1766 1778 return true; -
trunk/ippTools/src/disttool.c
r37130 r42837 765 765 } 766 766 767 if (simple) {/* no option? */}768 769 767 if (pretend) { 770 if (!ippdbPrintMetadatas(stdout, output, "distRunsToUpdate", true)) {768 if (!ippdbPrintMetadatas(stdout, output, "distRunsToUpdate", !simple)) { 771 769 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 772 770 psFree(output); … … 1652 1650 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1653 1651 PXOPT_LOOKUP_STR(comment, config->args, "-comment", false, false); 1652 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1654 1653 1655 1654 distTargetRow *row = distTargetRowAlloc( … … 1676 1675 row->target_id = psDBLastInsertID(config->dbh); 1677 1676 1678 if (!distTargetPrintObject(stdout, row, true)) {1677 if (!distTargetPrintObject(stdout, row, !simple)) { 1679 1678 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 1680 1679 psFree(row); … … 1815 1814 PXOPT_LOOKUP_STR(last_fileset, config->args, "-last_fileset", false, false); 1816 1815 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1816 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1817 1817 1818 1818 // XXX: should we insure that these names do not contatin any whitespace? … … 1842 1842 row->dest_id = psDBLastInsertID(config->dbh); 1843 1843 1844 if (!rcDestinationPrintObject(stdout, row, true)) {1844 if (!rcDestinationPrintObject(stdout, row, !simple)) { 1845 1845 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 1846 1846 psFree(row); -
trunk/ippTools/src/disttoolConfig.c
r37130 r42837 275 275 psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-last_fileset",0, "define last_fileset", NULL); 276 276 psMetadataAddStr(definedestinationArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL); 277 psMetadataAddBool(definedestinationArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 277 278 278 279 // -updatedestination … … 292 293 psMetadataAddStr(definetargetArgs, PS_LIST_TAIL, "-set_state", 0, "define state", NULL); 293 294 psMetadataAddStr(definetargetArgs, PS_LIST_TAIL, "-comment", 0, "define comment", NULL); 295 psMetadataAddBool(definetargetArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 294 296 295 297 // -updatetarget -
trunk/ippTools/src/fftool.c
r42480 r42837 104 104 } 105 105 106 106 // NOTE: this mode seems to be insufficiently constrained. It first identifies the 107 // set of stackRun/skycalRun entries that lack a fullForceRun match. But the 108 // second stage is selecting all warps only based on (tess_id, skycell_id, filter) without 109 // restriction to those which contributed to the stack 107 110 static bool definebyqueryMode(pxConfig *config) 108 111 { … … 150 153 } 151 154 PXOPT_COPY_F32(config->args, warpWhereMD, "-select_good_frac_min", "warpSkyfile.good_frac", ">="); 155 // XXX the tess_id and filter below can never be used because they are removed above (for stack) 156 // these options should be something like -select_warp_tess_id and -select_warp_filter 152 157 PXOPT_COPY_STR(config->args, warpWhereMD, "-select_tess_id", "warpRun.tess_id", "=="); 153 158 pxAddLabelSearchArgs(config, warpWhereMD, "-select_filter", "rawExp.filter", "LIKE"); … … 223 228 psString warpQueryTemplate = pxDataGet("fftool_definebyquery_select_warps.sql"); 224 229 230 // NOTE: these allow the set of input warps to be restricted 225 231 whereClause = psDBGenerateWhereConditionSQL(warpWhereMD, NULL); 226 232 psStringAppend(&warpQueryTemplate, "\nAND %s", whereClause); … … 339 345 } 340 346 347 // NOTE: this mode and 'definebyquery' seem to be nearly identical except that 348 // 'definebyquery' allows for restrictions on the input warps by label, data_group, 349 // warp_id, tess_id, filter, good_frac 341 350 static bool defineforstacksMode(pxConfig *config) 342 351 { -
trunk/ippTools/src/pztool.c
r41598 r42837 50 50 static bool updatenewexpMode(pxConfig *config); 51 51 52 // XXX EAM : 2021.05.18 : code for updatesummitExp was added but not finished. 53 // XXX static bool updatesummitExpMode(pxConfig *config); 52 static bool updatesummitExpMode(pxConfig *config); 54 53 55 54 // static bool copydoneCompleteExp(pxConfig *config); … … 93 92 MODECASE(PZTOOL_MODE_UPDATEPZEXP, updatepzexpMode); 94 93 MODECASE(PZTOOL_MODE_UPDATENEWEXP, updatenewexpMode); 95 // XXXMODECASE(PZTOOL_MODE_UPDATESUMMITEXP, updatesummitExpMode);94 MODECASE(PZTOOL_MODE_UPDATESUMMITEXP, updatesummitExpMode); 96 95 default: 97 96 psAbort("invalid option (this should not happen)"); … … 810 809 } 811 810 812 813 811 static bool updatecopiedMode(pxConfig *config) 814 812 { … … 939 937 } 940 938 941 # if (0) 942 static bool summitExpSetFault(pxConfig *config, const psS64 summit_id, const int fault) 939 static bool summitExpSetFault(pxConfig *config, const psString exp_name, const psS64 summit_id, const int fault) 943 940 { 944 941 // check that state is a valid string value … … 949 946 } 950 947 951 char *query = "UPDATE summitExp SET fault = %d WHERE summit_id = %ld ";952 if (!p_psDBRunQueryF(config->dbh, query, fault, summit_id )) {953 psError(PS_ERR_UNKNOWN, false, "failed to change state for %lld", (long long) summit_id);948 char *query = "UPDATE summitExp SET fault = %d WHERE summit_id = %ld AND exp_name = '%s'"; 949 if (!p_psDBRunQueryF(config->dbh, query, fault, summit_id, exp_name)) { 950 psError(PS_ERR_UNKNOWN, false, "failed to change state for %s = %lld", exp_name, (long long) summit_id); 954 951 return false; 955 952 } … … 960 957 static bool updatesummitExpMode(pxConfig *config) 961 958 { 962 int fault; 963 959 // require both exp_name and summit_id as a double-check 964 960 PS_ASSERT_PTR_NON_NULL(config, false); 965 961 PXOPT_LOOKUP_S64(summit_id, config->args, "-summit_id", true, false); 966 PXOPT_LOOKUP_S32(state, config->args, "-set_fault",true, false); 967 968 if (!summitExpSetFault(config,summit_id, fault)) { 969 psError(PS_ERR_UNKNOWN, false, "failed to change state for %lld", (long long) summit_id); 970 return false; 962 PXOPT_LOOKUP_STR(exp_name, config->args, "-exp_name", true, false); 963 PXOPT_LOOKUP_S32(fault, config->args, "-set_fault", true, false); 964 965 if (!summitExpSetFault(config, exp_name, summit_id, fault)) { 966 psError(PS_ERR_UNKNOWN, false, "failed to change state for %s = %lld", exp_name, (long long) summit_id); 967 return false; 971 968 } 972 969 return true; 973 970 } 974 # endif975 971 976 972 static bool updatepzexpMode(pxConfig *config) -
trunk/ippTools/src/pztoolConfig.c
r42254 r42837 171 171 psMetadataAddStr(updatepzexpArgs, PS_LIST_TAIL, "-set_state", 0, "define new state (required)", NULL); 172 172 173 # if (0)174 173 // -updatesummitexp 175 174 psMetadata *updatesummitexpArgs = psMetadataAlloc(); 176 175 psMetadataAddS64(updatesummitexpArgs, PS_LIST_TAIL, "-summit_id", 0, "define summit_id", 0); 177 176 psMetadataAddStr(updatesummitexpArgs, PS_LIST_TAIL, "-exp_name", 0, "search by exposure name (required)", NULL); 178 psMetadataAddStr(updatesummitexpArgs, PS_LIST_TAIL, "-inst", 0, "search by camera (required)", NULL);179 psMetadataAddStr(updatesummitexpArgs, PS_LIST_TAIL, "-telescope", 0, "search by telescope (required)", NULL);180 177 psMetadataAddS32(updatesummitexpArgs, PS_LIST_TAIL, "-set_fault", 0, "define new fault (required)", 0); 181 # endif182 178 183 179 // -updatenewexp -
trunk/ippTools/src/stacktool.c
r42097 r42837 496 496 psFree(insert); 497 497 psFree(list); 498 if (!psDBRollback(config->dbh)) {499 psError(PS_ERR_UNKNOWN, false, "database error");500 }501 498 return false; 502 499 } -
trunk/ippTools/src/staticskytool.c
r38561 r42837 1061 1061 PXOPT_COPY_S64(config->args, whereMD, "-select_sky_id", "staticskyRun.sky_id", "=="); 1062 1062 PXOPT_COPY_S64(config->args, whereMD, "-select_stack_id", "stackRun.stack_id", "=="); 1063 PXOPT_COPY_STR(config->args, whereMD, "-select_skycell_id", "stackRun.skycell_id", "==");1064 1063 PXOPT_COPY_STR(config->args, whereMD, "-select_tess_id", "stackRun.tess_id", "=="); 1064 PXOPT_COPY_STR(config->args, whereMD, "-select_skycell_id", "stackRun.skycell_id", "LIKE"); 1065 1065 pxAddLabelSearchArgs(config, whereMD, "-select_filter", "stackRun.filter", "LIKE"); 1066 1066 PXOPT_COPY_F32(config->args, whereMD, "-select_good_frac_min", "stackSumSkyfile.good_frac", ">=");
Note:
See TracChangeset
for help on using the changeset viewer.
