Changeset 35144
- Timestamp:
- Feb 11, 2013, 2:06:32 PM (13 years ago)
- Location:
- branches/czw_branch/20130211
- Files:
-
- 6 edited
-
dbconfig/cam.md (modified) (1 diff)
-
dbconfig/changes.txt (modified) (3 diffs)
-
ippTools/share/pxadmin_create_tables.sql (modified) (4 diffs)
-
ippTools/share/warptool_scmap.sql (modified) (1 diff)
-
ippTools/src/camtool.c (modified) (6 diffs)
-
ippTools/src/camtoolConfig.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20130211/dbconfig/cam.md
r29902 r35144 118 118 deteff_uq F32 0 119 119 quality S16 0 120 background_model S16 0 120 121 END 121 122 -
branches/czw_branch/20130211/dbconfig/changes.txt
r35134 r35144 2266 2266 UPDATE dbversion set schema_version = '1.1.73', updated= CURRENT_TIMESTAMP(); 2267 2267 2268 ALTER TABLE warpBackgroundRun ADD COLUMN alt_cam_label VARCHAR(255) AFTER reduction;2269 2270 UPDATE dbversion set schema_version = '1.1.74', updated= CURRENT_TIMESTAMP();2271 2268 2272 2269 -- new tables for managing the "release" of ipp data … … 2285 2282 surveyID INT(8), 2286 2283 releaseName VARCHAR(64), 2287 release_stateVARCHAR(16), -- active, pending archive drop2284 state VARCHAR(16), -- active, pending archive drop 2288 2285 dataRelease INT(8), -- PSPS dataRelease 2289 2286 PRIMARY KEY(rel_id), … … 2315 2312 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2316 2313 2317 CREATE TABLE relStack ( 2318 relstack_id BIGINT AUTO_INCREMENT, 2319 rel_id INT(8), 2320 skycal_id BIGINT, -- id of the sky calibration run that supplied the calibration 2321 -- for this release. We get back to stack from here 2322 skycell_id varchar(64), 2323 tess_id varchar(64), 2324 state VARCHAR(16), -- released, pending, archive, drop 2325 flags INT UNSIGNED, 2326 stack_type VARCHAR(16), -- nightly, deep, reference 2327 zpt_obs FLOAT, -- calibrated zero point for this release of this skycell 2328 zpt_stdev FLOAT, 2329 fwhm_major FLOAT, -- seeing as measured by staticsky 2330 path_base VARCHAR(255), -- path_base of any supporting files, 2331 registered DATETIME, 2332 time_stamp DATETIME, 2333 PRIMARY KEY (relstack_id), 2334 KEY (tess_id, skycell_id), 2335 KEY (rel_id, tess_id, skycell_id), 2336 FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id), 2337 FOREIGN KEY(skycal_id) REFERENCES skycalRun(skycal_id) 2338 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2339 2340 ALTER TABLE warpBackgroundRun ADD COLUMN alt_cam_label VARCHAR(255) AFTER reduction; 2341 2314 UPDATE dbversion set schema_version = '1.1.74', updated= CURRENT_TIMESTAMP(); 2315 2316 -- Update camProcessedExp to hold a background_model value 2317 2318 ALTER TABLE camProcessedExp add column background_model SMALLINT after quality; 2342 2319 UPDATE dbversion set schema_version = '1.1.75', updated= CURRENT_TIMESTAMP(); 2320 -
branches/czw_branch/20130211/ippTools/share/pxadmin_create_tables.sql
r35134 r35144 521 521 deteff_uq FLOAT, 522 522 quality SMALLINT NOT NULL DEFAULT 0, 523 background_model SMALLINT, 523 524 PRIMARY KEY(cam_id), 524 525 KEY(fault), … … 1843 1844 data_group VARCHAR(64), -- group for data 1844 1845 dist_group VARCHAR(64), -- group for distribution 1845 reduction VARCHAR(64), -- reduction class (for altering recipe) 1846 alt_cam_label VARCHAR(64), -- label for alternate version of astrometry (optional) 1846 reduction VARCHAR(64), -- reduction class (for altering recipe) 1847 1847 note VARCHAR(255), -- note 1848 1848 registered TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- time run was registered … … 2162 2162 surveyID INT(8), 2163 2163 releaseName VARCHAR(64), 2164 relase_state VARCHAR(16), -- active, pending, archive,drop2164 state VARCHAR(16), -- active, pending archive drop 2165 2165 dataRelease INT(8), -- PSPS dataRelease 2166 priority INT(8),2167 2166 PRIMARY KEY(rel_id), 2168 2167 KEY(releaseName), 2169 2168 KEY(state), 2170 KEY(priority),2171 2169 FOREIGN KEY(surveyID) REFERENCES survey(surveyID) 2172 2170 ) ENGINE=Innodb DEFAULT CHARSET=latin1; … … 2194 2192 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2195 2193 2196 CREATE TABLE relStack ( 2197 relstack_id BIGINT AUTO_INCREMENT, 2198 rel_id INT(8), 2199 skycal_id BIGINT, -- id of the sky calibration run that supplied the calibration 2200 -- for this release. We get back to stack from here 2201 skycell_id varchar(64), 2202 tess_id varchar(64), 2203 state VARCHAR(16), -- released, pending, archive, drop 2204 flags INT UNSIGNED, 2205 stack_type VARCHAR(16), -- nightly, deep, reference 2206 zpt_obs FLOAT, -- calibrated zero point for this release of this skycell 2207 zpt_stdev FLOAT, 2208 fwhm_major FLOAT, -- seeing as measured by staticsky 2209 path_base VARCHAR(255), -- path_base of any supporting files, 2210 registered DATETIME, 2211 time_stamp DATETIME, 2212 PRIMARY KEY (relstack_id), 2213 KEY (tess_id, skycell_id), 2214 KEY (rel_id, tess_id, skycell_id), 2215 FOREIGN KEY(rel_id) REFERENCES ippRelease(rel_id), 2216 FOREIGN KEY(skycal_id) REFERENCES skycalRun(skycal_id) 2217 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2218 2219 2220 2221 -- These comment lines are here to avoid an empty query error. 2194 2195 -- This comment line is here to avoid empty query error. 2222 2196 -- Another way to avoid that problem is to omit the semicolon above but I think that is untidy. -
branches/czw_branch/20130211/ippTools/share/warptool_scmap.sql
r32570 r35144 5 5 camProcessedExp.path_base as cam_path_base, 6 6 camProcessedExp.fault as cam_fault, 7 camProcessedExp.background_model AS cam_background_model, 7 8 chipProcessedImfile.chip_id, 8 9 chipRun.state, -
branches/czw_branch/20130211/ippTools/src/camtool.c
r34587 r35144 500 500 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 501 501 PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false); 502 502 PXOPT_LOOKUP_S16(background_model, config->args, "-background_model", false, false); 503 503 504 PXOPT_LOOKUP_STR(ver_pslib, config->args, "-ver_pslib", false, false); 504 505 PXOPT_LOOKUP_STR(ver_psmodules, config->args, "-ver_psmodules", false, false); … … 520 521 PXOPT_LOOKUP_F32(maskfrac_max_magic, config->args, "-maskfrac_max_magic", false, false); 521 522 PXOPT_LOOKUP_F32(maskfrac_max_advisory, config->args, "-maskfrac_max_advisory", false, false); 522 523 523 524 // we store actual detection efficiency by adding in zpt_obs 524 525 PXOPT_LOOKUP_F32(deteff_inst, config->args, "-deteff_inst", false, false); … … 542 543 } 543 544 544 /* psTrace("czw.test",1,"Received versions: pslib %s psmodules %s psphot %s psastro %s ppstats %s ppImage %s streaks %s\n", */545 /* ver_pslib,ver_psmodules,ver_psphot,ver_psastro,ver_ppstats,ver_ppimage,ver_streaks); */546 545 psString software_ver = NULL; 547 546 if ((ver_pslib)&&(ver_psmodules)) { … … 692 691 deteff_lq, 693 692 deteff_uq, 694 quality 693 quality, 694 background_model 695 695 ); 696 696 … … 817 817 pxAddLabelSearchArgs (config, where, "-data_group", "camRun.data_group", "LIKE"); 818 818 PXOPT_COPY_STR(config->args, where, "-reduction", "camRun.reduction", "=="); 819 819 PXOPT_COPY_S16(config->args, where, "-background_model", "camProcessedExp.background_model", "=="); 820 820 821 psString where2 = NULL; 821 822 if (!pxspaceAddWhere(config, &where2, "rawExp")) { … … 987 988 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 988 989 PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", false, false); 989 990 psMetadata *where = psMetadataAlloc(); 991 PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "=="); 992 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 993 PXOPT_COPY_STR(config->args, where, "-class", "class", "=="); 994 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 995 996 if (!pxSetFaultCode(config->dbh, "camProcessedExp", where, fault, quality)) { 990 PXOPT_LOOKUP_S16(background_model, config->args, "-set_background_model", false, false); 991 if (background_model) { 992 // CZW Copied from warptool.c 993 psMetadata *where = psMetadataAlloc(); 994 psMetadata *values = psMetadataAlloc(); 995 PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "=="); 996 PXOPT_COPY_S16(config->args, values, "-set_background_model", "background_model", "=="); 997 long rows = psDBUpdateRows(config->dbh, "camProcessedExp", where, values); 998 psFree(values); 999 psFree(where); 1000 if (!rows) { 1001 psError(PS_ERR_UNKNOWN, true, "no rows changed"); 1002 } 1003 } 1004 else { 1005 psMetadata *where = psMetadataAlloc(); 1006 PXOPT_COPY_S64(config->args, where, "-cam_id", "cam_id", "=="); 1007 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 1008 PXOPT_COPY_STR(config->args, where, "-class", "class", "=="); 1009 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 1010 1011 if (!pxSetFaultCode(config->dbh, "camProcessedExp", where, fault, quality)) { 997 1012 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 998 1013 psFree (where); 999 1014 return false; 1000 }1001 psFree (where);1002 1015 } 1016 psFree (where); 1017 } 1003 1018 return true; 1004 1019 } -
branches/czw_branch/20130211/ippTools/src/camtoolConfig.c
r33111 r35144 204 204 psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-deteff_inst_lq", 0, "define deteff_lq", NAN); 205 205 psMetadataAddF32(addprocessedexpArgs, PS_LIST_TAIL, "-deteff_inst_uq", 0, "define deteff_uq", NAN); 206 206 psMetadataAddS16(addprocessedexpArgs, PS_LIST_TAIL, "-background_model", 0, "set background_model value", 0); 207 207 208 208 // -processedexp … … 222 222 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 223 223 psMetadataAddBool(processedexpArgs, PS_LIST_TAIL, "-faulted", 0, "only return imfiles with a fault status set", false); 224 psMetadataAddS16(processedexpArgs, PS_LIST_TAIL, "-background_model", 0, "search by background_model value", 0); 224 225 225 226 // -revertprocessedexp … … 246 247 psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", INT16_MAX); 247 248 psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "-set_quality", 0, "set quality", 0); 249 psMetadataAddS16(updateprocessedexpArgs, PS_LIST_TAIL, "-set_background_model", 0, "set background_model value", 0); 248 250 249 251 // -block
Note:
See TracChangeset
for help on using the changeset viewer.
