Changeset 28245
- Timestamp:
- Jun 7, 2010, 12:00:46 PM (16 years ago)
- Location:
- branches/czw_branch/20100519
- Files:
-
- 14 edited
-
dbconfig/changes.txt (modified) (4 diffs)
-
dbconfig/diff.md (modified) (1 diff)
-
dbconfig/stack.md (modified) (2 diffs)
-
dbconfig/warp.md (modified) (1 diff)
-
ippScripts/scripts/skycell_jpeg.pl (modified) (7 diffs)
-
ippTools/share/Makefile.am (modified) (3 diffs)
-
ippTools/share/pxadmin_create_tables.sql (modified) (4 diffs)
-
ippTools/src/difftool.c (modified) (2 diffs)
-
ippTools/src/difftoolConfig.c (modified) (2 diffs)
-
ippTools/src/stacktool.c (modified) (12 diffs)
-
ippTools/src/stacktoolConfig.c (modified) (2 diffs)
-
ippTools/src/warptool.c (modified) (2 diffs)
-
ippTools/src/warptoolConfig.c (modified) (2 diffs)
-
ppSkycell/src/ppSkycellLoop.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20100519/dbconfig/changes.txt
r28164 r28245 1716 1716 CREATE TABLE warpSummary ( 1717 1717 warp_id BIGINT, 1718 tangent_planeVARCHAR(64) NOT NULL,1718 projection_cell VARCHAR(64) NOT NULL, 1719 1719 path_base VARCHAR(255) NOT NULL, 1720 1720 PRIMARY KEY(warp_id), 1721 KEY( tangent_plane),1721 KEY(projection_cell), 1722 1722 FOREIGN KEY(warp_id) REFERENCES warpRun(warp_id) 1723 1723 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 1725 1725 CREATE TABLE diffSummary ( 1726 1726 diff_id BIGINT, 1727 tangent_planeVARCHAR(64) NOT NULL,1727 projection_cell VARCHAR(64) NOT NULL, 1728 1728 path_base VARCHAR(255) NOT NULL, 1729 1729 PRIMARY KEY(diff_id), 1730 KEY( tangent_plane),1730 KEY(projection_cell), 1731 1731 FOREIGN KEY(diff_id) REFERENCES diffRun(diff_id) 1732 1732 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 1734 1734 CREATE TABLE stackSummary ( 1735 1735 stack_id BIGINT, 1736 tangent_planeVARCHAR(64) NOT NULL,1736 projection_cell VARCHAR(64) NOT NULL, 1737 1737 path_base VARCHAR(255) NOT NULL, 1738 1738 PRIMARY KEY(stack_id), 1739 KEY( tangent_plane),1739 KEY(projection_cell), 1740 1740 FOREIGN KEY(stack_id) REFERENCES stackRun(stack_id) 1741 1741 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 1744 1744 sass_id BIGINT AUTO_INCREMENT, 1745 1745 data_group VARCHAR(64) NOT NULL, 1746 tangent_planeVARCHAR(64) NOT NULL,1746 projection_cell VARCHAR(64) NOT NULL, 1747 1747 tess_id VARCHAR(64) NOT NULL, 1748 1748 filter VARCHAR(64) NOT NULL, 1749 1749 PRIMARY KEY(sass_id), 1750 1750 KEY(data_group), 1751 KEY( tangent_plane),1751 KEY(projection_cell), 1752 1752 KEY(tess_id) 1753 1753 ) ENGINE=innodb DEFAULT CHARSET=latin1; -
branches/czw_branch/20100519/dbconfig/diff.md
r28164 r28245 77 77 78 78 diffSummary METADATA 79 diff_id S64 0 # Primary Key fkey(diff_id) ref diffRun(diff_id)80 tangent_planeSTR 32 # Primary Key81 path_base STR 25579 diff_id S64 0 # Primary Key fkey(diff_id) ref diffRun(diff_id) 80 projection_cell STR 32 # Primary Key 81 path_base STR 255 82 82 END -
branches/czw_branch/20100519/dbconfig/stack.md
r28164 r28245 56 56 stackSummary METADATA 57 57 stack_id S64 0 # Primary Key fkey(stack_id) ref stackRun(stack_id) 58 tangent_planeSTR 32 # Primary Key58 projection_cell STR 32 # Primary Key 59 59 path_base STR 255 60 60 END … … 63 63 sass_id S64 0 # Primary Key AUTO_INCREMENT 64 64 data_group STR 64 # Key 65 tangent_planeSTR 64 # Key65 projection_cell STR 64 # Key 66 66 tess_id STR 64 # Key 67 67 filter STR 64 -
branches/czw_branch/20100519/dbconfig/warp.md
r28164 r28245 82 82 warpSummary METADATA 83 83 warp_id S64 0 # Primary Key fkey(warp_id) ref warpRun(warp_id) 84 tangent_planeSTR 32 # Primary Key84 projection_cell STR 32 # Primary Key 85 85 path_base STR 255 86 86 END -
branches/czw_branch/20100519/ippScripts/scripts/skycell_jpeg.pl
r28045 r28245 32 32 'save_temps' => \$save_temps, 33 33 'masks' => \$masks, 34 'no-op' => \$no_op,35 'no-update' => \$no_update,34 # 'no-op' => \$no_op, 35 # 'no-update' => \$no_update, 36 36 ) or pod2usage ( 2 ); 37 37 38 38 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2) if @ARGV; 39 39 pod2usage( 40 -msg => "Required options: --stage --stage_id --outroot ",40 -msg => "Required options: --stage --stage_id --outroot\nHelpful options: --camera --dbname", 41 41 -exitval => 3, 42 42 ) unless … … 80 80 my $quality = $imfile->{quality}; 81 81 my $state = $imfile->{data_state}; 82 my $ tangent_base= $skycell_id;82 my $projection_cell = $skycell_id; 83 83 if ($quality == 8007 or $state ne 'full') { 84 84 next; 85 85 } 86 86 87 $ tangent_base=~ s/^(.*)\..*$/$1/;88 89 unless (exists($tangents{$ tangent_base})) {87 $projection_cell =~ s/^(.*)\..*$/$1/; 88 89 unless (exists($tangents{$projection_cell})) { 90 90 # Make a temp file and fill, but be sure to save 91 ($tempFile, $tempName) = tempfile("/tmp/skycell.$ tangent_base.XXXX",91 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 92 92 UNLINK => !$save_temps); 93 $tangents{$ tangent_base}{FILE} = $tempFile;94 $tangents{$ tangent_base}{NAME} = $tempName;93 $tangents{$projection_cell}{FILE} = $tempFile; 94 $tangents{$projection_cell}{NAME} = $tempName; 95 95 if ($masks) { 96 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$ tangent_base.masks.XXXX",96 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 97 97 UNLINK => !$save_temps); 98 $tangents{$ tangent_base}{MFILE} = $maskFile;99 $tangents{$ tangent_base}{MNAME} = $maskName;98 $tangents{$projection_cell}{MFILE} = $maskFile; 99 $tangents{$projection_cell}{MNAME} = $maskName; 100 100 } 101 101 } 102 print "$skycell_id $ tangent_base\n";102 print "$skycell_id $projection_cell\n"; 103 103 my $file = $ipprc->filename("PSWARP.OUTPUT", $path_base, $skycell_id); 104 104 print "$file $state $quality\n"; 105 my $f_fh = $tangents{$ tangent_base}{FILE};105 my $f_fh = $tangents{$projection_cell}{FILE}; 106 106 print $f_fh "$file\n"; 107 107 if ($masks) { 108 108 my $mask = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base, $skycell_id); 109 109 print "$mask\n"; 110 my $m_fh = $tangents{$ tangent_base}{MFILE};110 my $m_fh = $tangents{$projection_cell}{MFILE}; 111 111 print $m_fh "$mask\n"; 112 112 } 113 113 } 114 foreach my $ tangent_base(keys %tangents) {115 $command = "$ppSkycell -images $tangents{$ tangent_base}{NAME}";116 if ($masks) { 117 $command .= " -masks $tangents{$ tangent_base}{MNAME} ";118 } 119 $command .= " ${outroot}.${ tangent_base} ";114 foreach my $projection_cell (keys %tangents) { 115 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 116 if ($masks) { 117 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 118 } 119 $command .= " ${outroot}.${projection_cell} "; 120 120 print "$command\n"; 121 121 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); … … 125 125 } 126 126 # Update database: 127 $command = "$warptool -addsummary -warp_id $stage_id - tangent_base $tangent_base-outroot $outroot";127 $command = "$warptool -addsummary -warp_id $stage_id -projection_cell $projection_cell -outroot $outroot"; 128 128 if (defined($dbname)) { 129 129 $command .= " -dbname $dbname"; … … 164 164 my $quality = $imfile->{quality}; 165 165 my $state = $imfile->{data_state}; 166 my $ tangent_base= $skycell_id;166 my $projection_cell = $skycell_id; 167 167 if ($quality == 8007 or $state ne 'full') { 168 168 next; 169 169 } 170 170 171 $ tangent_base=~ s/^(.*)\..*$/$1/;172 173 unless (exists($tangents{$ tangent_base})) {171 $projection_cell =~ s/^(.*)\..*$/$1/; 172 173 unless (exists($tangents{$projection_cell})) { 174 174 # Make a temp file and fill, but be sure to save 175 ($tempFile, $tempName) = tempfile("/tmp/skycell.$ tangent_base.XXXX",175 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 176 176 UNLINK => !$save_temps); 177 $tangents{$ tangent_base}{FILE} = $tempFile;178 $tangents{$ tangent_base}{NAME} = $tempName;177 $tangents{$projection_cell}{FILE} = $tempFile; 178 $tangents{$projection_cell}{NAME} = $tempName; 179 179 if ($masks) { 180 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$ tangent_base.masks.XXXX",180 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 181 181 UNLINK => !$save_temps); 182 $tangents{$ tangent_base}{MFILE} = $maskFile;183 $tangents{$ tangent_base}{MNAME} = $maskName;182 $tangents{$projection_cell}{MFILE} = $maskFile; 183 $tangents{$projection_cell}{MNAME} = $maskName; 184 184 } 185 185 } 186 print "$skycell_id $ tangent_base\n";186 print "$skycell_id $projection_cell\n"; 187 187 my $file = $ipprc->filename("PPSUB.OUTPUT", $path_base, $skycell_id); 188 188 print "$file $state $quality\n"; 189 my $f_fh = $tangents{$ tangent_base}{FILE};189 my $f_fh = $tangents{$projection_cell}{FILE}; 190 190 print $f_fh "$file\n"; 191 191 if ($masks) { 192 192 my $mask = $ipprc->filename("PPSUB.OUTPUT.MASK", $path_base, $skycell_id); 193 193 print "$mask\n"; 194 my $m_fh = $tangents{$ tangent_base}{MFILE};194 my $m_fh = $tangents{$projection_cell}{MFILE}; 195 195 print $m_fh "$mask\n"; 196 196 } 197 197 } 198 foreach my $ tangent_base(keys %tangents) {199 $command = "$ppSkycell -images $tangents{$ tangent_base}{NAME}";200 if ($masks) { 201 $command .= " -masks $tangents{$ tangent_base}{MNAME} ";202 } 203 $command .= " ${outroot}.${ tangent_base} ";198 foreach my $projection_cell (keys %tangents) { 199 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 200 if ($masks) { 201 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 202 } 203 $command .= " ${outroot}.${projection_cell} "; 204 204 print "$command\n"; 205 205 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); … … 209 209 } 210 210 # Update database: 211 $command = "$difftool -addsummary -diff_id $stage_id - tangent_base $tangent_base-outroot $outroot";211 $command = "$difftool -addsummary -diff_id $stage_id -projection_cell $projection_cell -outroot $outroot"; 212 212 if (defined($dbname)) { 213 213 $command .= " -dbname $dbname"; … … 248 248 my $quality = $imfile->{quality}; 249 249 my $state = $imfile->{data_state}; 250 my $ tangent_base= $skycell_id;250 my $projection_cell = $skycell_id; 251 251 if ($quality == 8007 or $state ne 'full') { 252 252 next; 253 253 } 254 254 255 $ tangent_base=~ s/^(.*)\..*$/$1/;256 257 unless (exists($tangents{$ tangent_base})) {255 $projection_cell =~ s/^(.*)\..*$/$1/; 256 257 unless (exists($tangents{$projection_cell})) { 258 258 # Make a temp file and fill, but be sure to save 259 ($tempFile, $tempName) = tempfile("/tmp/skycell.$ tangent_base.XXXX",259 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 260 260 UNLINK => !$save_temps); 261 $tangents{$ tangent_base}{FILE} = $tempFile;262 $tangents{$ tangent_base}{NAME} = $tempName;261 $tangents{$projection_cell}{FILE} = $tempFile; 262 $tangents{$projection_cell}{NAME} = $tempName; 263 263 if ($masks) { 264 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$ tangent_base.masks.XXXX",264 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 265 265 UNLINK => !$save_temps); 266 $tangents{$ tangent_base}{MFILE} = $maskFile;267 $tangents{$ tangent_base}{MNAME} = $maskName;266 $tangents{$projection_cell}{MFILE} = $maskFile; 267 $tangents{$projection_cell}{MNAME} = $maskName; 268 268 } 269 269 } 270 print "$skycell_id $ tangent_base\n";270 print "$skycell_id $projection_cell\n"; 271 271 my $file = $ipprc->filename("PPSTACK.OUTPUT", $path_base, $skycell_id); 272 272 print "$file $state $quality\n"; 273 my $f_fh = $tangents{$ tangent_base}{FILE};273 my $f_fh = $tangents{$projection_cell}{FILE}; 274 274 print $f_fh "$file\n"; 275 275 if ($masks) { 276 276 my $mask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base, $skycell_id); 277 277 print "$mask\n"; 278 my $m_fh = $tangents{$ tangent_base}{MFILE};278 my $m_fh = $tangents{$projection_cell}{MFILE}; 279 279 print $m_fh "$mask\n"; 280 280 } 281 281 } 282 foreach my $ tangent_base(keys %tangents) {283 $command = "$ppSkycell -images $tangents{$ tangent_base}{NAME}";284 if ($masks) { 285 $command .= " -masks $tangents{$ tangent_base}{MNAME} ";286 } 287 $command .= " ${outroot}.${ tangent_base} ";282 foreach my $projection_cell (keys %tangents) { 283 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 284 if ($masks) { 285 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 286 } 287 $command .= " ${outroot}.${projection_cell} "; 288 288 print "$command\n"; 289 289 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); … … 293 293 } 294 294 # Update database: 295 $command = "$stacktool -addsummary -stack_id $stage_id - tangent_base $tangent_base-outroot $outroot";295 $command = "$stacktool -addsummary -stack_id $stage_id -projection_cell $projection_cell -outroot $outroot"; 296 296 if (defined($dbname)) { 297 297 $command .= " -dbname $dbname"; -
branches/czw_branch/20100519/ippTools/share/Makefile.am
r28164 r28245 121 121 difftool_skyfile.sql \ 122 122 difftool_todiffskyfile.sql \ 123 difftool_tosummary.sql \ 124 difftool_addsummary.sql \ 123 125 disttool_definebyquery_camera.sql \ 124 126 disttool_definebyquery_chip.sql \ … … 289 291 stacktool_sumskyfile.sql \ 290 292 stacktool_tosum.sql \ 293 stacktool_tosummary.sql \ 294 stacktool_addsummary.sql \ 291 295 staticskytool_definebyquery_select.sql \ 292 296 staticskytool_definebyquery_inputs.sql \ … … 319 323 warptool_towarped.sql \ 320 324 warptool_updateskyfile.sql \ 321 warptool_warped.sql 325 warptool_warped.sql \ 326 warptool_tosummary.sql \ 327 warptool_addsummary.sql -
branches/czw_branch/20100519/ippTools/share/pxadmin_create_tables.sql
r28164 r28245 983 983 CREATE TABLE warpSummary ( 984 984 warp_id BIGINT, 985 tangent_planeVARCHAR(64) NOT NULL,985 projection_cell VARCHAR(64) NOT NULL, 986 986 path_base VARCHAR(255) NOT NULL, 987 987 PRIMARY KEY(warp_id), 988 KEY( tangent_plane),988 KEY(projection_cell), 989 989 FOREIGN KEY(warp_id) REFERENCES warpRun(warp_id) 990 990 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 1062 1062 CREATE TABLE stackSummary ( 1063 1063 stack_id BIGINT, 1064 tangent_planeVARCHAR(64) NOT NULL,1064 projection_cell VARCHAR(64) NOT NULL, 1065 1065 path_base VARCHAR(255) NOT NULL, 1066 1066 PRIMARY KEY(stack_id), 1067 KEY( tangent_plane),1067 KEY(projection_cell), 1068 1068 FOREIGN KEY(stack_id) REFERENCES stackRun(stack_id) 1069 1069 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 1072 1072 sass_id BIGINT AUTO_INCREMENT, 1073 1073 data_group VARCHAR(64) NOT NULL, 1074 tangent_planeVARCHAR(64) NOT NULL,1074 projection_cell VARCHAR(64) NOT NULL, 1075 1075 tess_id VARCHAR(64) NOT NULL, 1076 1076 filter VARCHAR(64) NOT NULL, 1077 1077 PRIMARY KEY(sass_id), 1078 1078 KEY(data_group), 1079 KEY( tangent_plane),1079 KEY(projection_cell), 1080 1080 KEY(tess_id) 1081 1081 ) ENGINE=innodb DEFAULT CHARSET=latin1; … … 1187 1187 CREATE TABLE diffSummary ( 1188 1188 diff_id BIGINT, 1189 tangent_planeVARCHAR(64) NOT NULL,1189 projection_cell VARCHAR(64) NOT NULL, 1190 1190 path_base VARCHAR(255) NOT NULL, 1191 1191 PRIMARY KEY(diff_id), 1192 KEY( tangent_plane),1192 KEY(projection_cell), 1193 1193 FOREIGN KEY(diff_id) REFERENCES diffRun(diff_id) 1194 1194 ) ENGINE=innodb DEFAULT CHARSET=latin1; -
branches/czw_branch/20100519/ippTools/src/difftool.c
r28164 r28245 2356 2356 2357 2357 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", true, false); 2358 PXOPT_LOOKUP_STR( tangent_plane, config->args, "-tangent_plane", true, false);2358 PXOPT_LOOKUP_STR(projection_cell, config->args, "-projection_cell", true, false); 2359 2359 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", true, false); 2360 2360 … … 2364 2364 return(false); 2365 2365 } 2366 if (!p_psDBRunQueryF(config->dbh, query, diff_id, tangent_plane, path_base)) {2366 if (!p_psDBRunQueryF(config->dbh, query, diff_id, projection_cell, path_base)) { 2367 2367 psError(PS_ERR_UNKNOWN, false, "database error"); 2368 2368 psFree(query); -
branches/czw_branch/20100519/ippTools/src/difftoolConfig.c
r28164 r28245 327 327 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff ID", 0); 328 328 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tessellation ID", NULL); 329 psMetadataAddStr(tosummaryArgs , PS_LIST_TAIL, "-warp_id", 0, "search by warp_id", NULL); 330 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-template", 0, "apply exposure args to template of bothways diff", false); 329 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL); 331 330 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exposure ID", 0); 332 331 psMetadataAddStr(tosummaryArgs , PS_LIST_TAIL, "-exp_name", 0, "search by exposure name", NULL); 332 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-warp_id", 0, "search by warp ID", 0); 333 333 334 psMetadataAddTime(tosummaryArgs, PS_LIST_TAIL, "-dateobs_begin", 0, "search for exposures by time (>=)", NULL); 334 335 psMetadataAddTime(tosummaryArgs, PS_LIST_TAIL, "-dateobs_end", 0, "search for exposures by time (<=)", NULL); 335 336 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-filter", 0, "search for filter", NULL); 337 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-magicked", 0, "search by magic id", 0); 336 338 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by diffRun label (LIKE comparison)", NULL); 337 339 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by diffRun data_group (LIKE comparison)", NULL); 338 340 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-dist_group", PS_META_DUPLICATE_OK, "search by diffRun dist_group (LIKE comparison)", NULL); 339 341 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-destreaked", 0, "search for runs that have been destreaked", false); 342 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-not_destreaked", 0, "search for runs that have not been destreaked", false); 343 340 344 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-all", 0, "search without arguments", false); 341 345 psMetadataAddU64(tosummaryArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 345 349 psMetadata *addsummaryArgs = psMetadataAlloc(); 346 350 psMetadataAddS64(addsummaryArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff ID", 0); 347 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "- tangent_plane", 0, "set tangent plane", NULL);351 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-projection_cell", 0, "set projection cell", NULL); 348 352 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-path_base", 0, "set summary path base", NULL); 349 353 -
branches/czw_branch/20100519/ippTools/src/stacktool.c
r28164 r28245 106 106 exit(exit_status); 107 107 } 108 //stackAssociationRow *association = pxStackAssociationDefine(data_group,tess_id,filter,skycell_id); 109 stackAssociationRow *pxStackAssociationDefine(pxConfig *config, psS64 stack_id) { 110 psString select = pxDataGet("stacktool_associationdefine_select.sql"); 111 if (!select) { 112 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 113 return false; 114 } 115 116 psString idString = NULL; 117 psStringAppend(&idString, "%" PRId64, stack_id); 118 psStringSubstitute(&select,idString, "@STACK_ID@"); 119 psFree(idString); 120 121 if (!p_psDBRunQuery(config->dbh, select)) { 122 psError(PS_ERR_UNKNOWN,false, "database error"); 123 psFree(select); 124 return(NULL); 125 } 126 psFree(select); 127 psArray *output = p_psDBFetchResult(config->dbh); 128 if (!output) { 129 psErrorCode err = psErrorCodeLast(); 130 switch (err) { 131 case PS_ERR_DB_CLIENT: 132 psError(PXTOOLS_ERR_SYS, false, "database error"); 133 case PS_ERR_DB_SERVER: 134 psError(PXTOOLS_ERR_PROG, false, "database error"); 135 default: 136 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 137 } 138 return(NULL); 139 } 140 if (psArrayLength(output) != 1) { 141 psWarning("stacktool: incorrect number of rows found"); 142 psFree(output); 143 return(NULL); 144 } 145 psMetadata *outrow = NULL; 146 for (long i = 0; i < output->n; i++) { 147 psMetadata *row = output->data[i]; 148 if (!psMetadataCopy(row,outrow)) { 149 psError(PS_ERR_UNKNOWN, false, "Failed to copy row to return"); 150 return(NULL); 151 } 152 } 153 psFree(output); 154 stackAssociationRow *sassRow = stackAssociationObjectFromMetadata(outrow); 155 psFree(outrow); 156 return(sassRow); 157 } 158 159 160 161 108 162 109 163 … … 399 453 psFree(run); 400 454 455 //CZW Add an association entry here. 456 // Define the requested association, and insert it if it doesn't already exist 457 stackAssociationRow *association = pxStackAssociationDefine(config,stack_id); 458 psS64 sass_id; 459 if (!association->sass_id) { 460 psTrace("stacktool.association",2,"No required Association found. Adding."); 461 462 if (!stackAssociationInsertObject(config->dbh,association)) { 463 if (!psDBRollback(config->dbh)) { 464 psError(PS_ERR_UNKNOWN, false, "database error"); 465 } 466 psError(PS_ERR_UNKNOWN, false, "database error"); 467 psFree(output); 468 psFree(run); 469 psFree(insert); 470 psFree(list); 471 psFree(association); 472 if (!psDBRollback(config->dbh)) { 473 psError(PS_ERR_UNKNOWN, false, "database error"); 474 } 475 return(false); 476 } 477 sass_id = psDBLastInsertID(config->dbh); 478 association->sass_id = sass_id; 479 } 480 // Insert the map entry for this row. 481 stackAssociationMapRow *maprow = stackAssociationMapRowAlloc(sass_id,stack_id); 482 if (!stackAssociationMapInsertObject(config->dbh,maprow)) { 483 if (!psDBRollback(config->dbh)) { 484 psError(PS_ERR_UNKNOWN, false, "database error"); 485 } 486 psError(PS_ERR_UNKNOWN, false, "database error"); 487 psFree(output); 488 psFree(run); 489 psFree(insert); 490 psFree(list); 491 psFree(association); 492 if (!psDBRollback(config->dbh)) { 493 psError(PS_ERR_UNKNOWN, false, "database error"); 494 } 495 return(false); 496 } 497 498 401 499 // Create a suitable insertion query for this run 402 500 psString thisInsert = psStringCopy(insert); … … 556 654 run->stack_id = psDBLastInsertID(config->dbh); 557 655 656 //CZW Add an association entry here. 657 558 658 // insert the stackInputSkyfile rows 559 659 psListIterator *iter = psListIteratorAlloc(warp_ids->data.list, 0, false); … … 607 707 #endif 608 708 psMetadata *where = psMetadataAlloc(); 609 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); 610 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 611 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 709 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackRun.stack_id", "=="); 710 PXOPT_COPY_STR(config->args, where, "-label", "stackRun.label", "=="); 711 PXOPT_COPY_STR(config->args, where, "-state", "stackRun.state", "=="); 712 PXOPT_COPY_STR(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 612 713 if (!psListLength(where->list)) { 613 714 psFree(where); … … 616 717 } 617 718 719 //CZW join against stackAssociationMap 618 720 psString query = psStringCopy("UPDATE stackRun"); 619 721 … … 961 1063 psMetadata *where = psMetadataAlloc(); 962 1064 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackSumSkyfile.stack_id", "=="); 1065 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 963 1066 PXOPT_COPY_STR(config->args, where, "-tess_id", "stackRun.tess_id", "=="); 964 1067 PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "=="); … … 1134 1237 psMetadata *where = psMetadataAlloc(); 1135 1238 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackSumSkyfile.warp_id", "=="); 1239 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 1136 1240 PXOPT_COPY_STR(config->args, where, "-tess_id", "stackSumSkyfile.tess_id", "=="); 1137 1241 PXOPT_COPY_STR(config->args, where, "-state", "stackRun.state", "=="); … … 1215 1319 1216 1320 PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", true, false); 1217 PXOPT_LOOKUP_STR( tangent_plane, config->args, "-tangent_plane", true, false);1321 PXOPT_LOOKUP_STR(projection_cell, config->args, "-projection_cell", true, false); 1218 1322 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", true, false); 1219 1323 … … 1223 1327 return(false); 1224 1328 } 1225 if (!p_psDBRunQueryF(config->dbh, query, stack_id, tangent_plane, path_base)) {1329 if (!p_psDBRunQueryF(config->dbh, query, stack_id, projection_cell, path_base)) { 1226 1330 psError(PS_ERR_UNKNOWN, false, "database error"); 1227 1331 psFree(query); … … 1251 1355 1252 1356 psMetadata *where = psMetadataAlloc(); 1357 PXOPT_COPY_S64(config->args, where, "-stack_id", "stackRun.stack_id", "=="); 1358 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 1359 1253 1360 pxAddLabelSearchArgs (config, where, "-label", "stackRun.label", "=="); 1254 1361 … … 1377 1484 psMetadata *where = psMetadataAlloc(); 1378 1485 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 1486 PXOPT_COPY_STR(config->args, where, "-sass_id", "sass_id", "=="); 1379 1487 1380 1488 psString query = pxDataGet("stacktool_donecleanup.sql"); … … 1446 1554 } 1447 1555 1556 //CZW I have not added sass information to the export/import run modes yet. 1448 1557 bool exportrunMode(pxConfig *config) 1449 1558 { -
branches/czw_branch/20100519/ippTools/src/stacktoolConfig.c
r28164 r28245 207 207 psMetadata *tosummaryArgs = psMetadataAlloc(); 208 208 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-stack_id", 0, "search by stack ID", 0); 209 psMetadataAddS64(tosummaryArgs, PS_LIST_TAIL, "-sass_id", 0, "search by stack association ID", 0); 209 210 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tessellation ID", NULL); 210 211 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL); … … 221 222 psMetadata *addsummaryArgs = psMetadataAlloc(); 222 223 psMetadataAddS64(addsummaryArgs, PS_LIST_TAIL, "-stack_id", 0, "set stack ID", 0); 223 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "- tangent_plane", 0, "set tangent plane", NULL);224 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-projection_cell", 0, "set projection cell", NULL); 224 225 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-path_base", 0, "set summary path base", NULL); 225 226 -
branches/czw_branch/20100519/ippTools/src/warptool.c
r28164 r28245 1653 1653 1654 1654 PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", true, false); 1655 PXOPT_LOOKUP_STR( tangent_plane, config->args, "-tangent_plane", true, false);1655 PXOPT_LOOKUP_STR(projection_cell, config->args, "-projection_cell", true, false); 1656 1656 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", true, false); 1657 1657 … … 1661 1661 return(false); 1662 1662 } 1663 if (!p_psDBRunQueryF(config->dbh, query, warp_id, tangent_plane, path_base)) {1663 if (!p_psDBRunQueryF(config->dbh, query, warp_id, projection_cell, path_base)) { 1664 1664 psError(PS_ERR_UNKNOWN, false, "database error"); 1665 1665 psFree(query); -
branches/czw_branch/20100519/ippTools/src/warptoolConfig.c
r28164 r28245 336 336 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by warpRun data_group", NULL); 337 337 psMetadataAddStr(tosummaryArgs, PS_LIST_TAIL, "-dist_group", PS_META_DUPLICATE_OK, "search by warpRun dist_group", NULL); 338 psMetadataAddBool( updaterunArgs, PS_LIST_TAIL, "-destreaked", 0, "search for runs that have been destreaked", false);339 psMetadataAddBool( updaterunArgs, PS_LIST_TAIL, "-not_destreaked", 0, "search for runs that have not been destreaked", false);338 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-destreaked", 0, "search for runs that have been destreaked", false); 339 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-not_destreaked", 0, "search for runs that have not been destreaked", false); 340 340 341 341 psMetadataAddBool(tosummaryArgs, PS_LIST_TAIL, "-all", 0, "search without arguments", false); … … 346 346 psMetadata *addsummaryArgs = psMetadataAlloc(); 347 347 psMetadataAddS64(addsummaryArgs, PS_LIST_TAIL, "-warp_id", 0, "set warp ID", 0); 348 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "- tangent_plane", 0, "set tangent plane", NULL);348 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-projection_cell", 0, "set projection cell", NULL); 349 349 psMetadataAddStr(addsummaryArgs, PS_LIST_TAIL, "-path_base", 0, "set summary path base", NULL); 350 350 -
branches/czw_branch/20100519/ppSkycell/src/ppSkycellLoop.c
r28164 r28245 315 315 pmCell *Fcell1 = pmFPAfileThisCell(data->config->files, view, "PPSKYCELL.BIN1"); // Rebinned cell 1 316 316 pmCell *Fcell2 = pmFPAfileThisCell(data->config->files, view, "PPSKYCELL.BIN2"); // Rebinned cell 2 317 317 318 // This is a hack to get a functioning header created so the fits images can be written out. 318 319 psMetadataAddS32(Fcell1->concepts,PS_LIST_TAIL,"CELL.XPARITY", PS_META_REPLACE,"",1); … … 327 328 psMetadataAddS32(Fcell2->parent->concepts,PS_LIST_TAIL,"CHIP.XPARITY", PS_META_REPLACE,"",1); 328 329 psMetadataAddS32(Fcell2->parent->concepts,PS_LIST_TAIL,"CHIP.YPARITY", PS_META_REPLACE,"",1); 329 330 330 331 pmReadout *Fro1 = pmReadoutAlloc(Fcell1), *Fro2 = pmReadoutAlloc(Fcell2); // Binned readouts 331 332
Note:
See TracChangeset
for help on using the changeset viewer.
