Changeset 33989
- Timestamp:
- Jun 7, 2012, 11:42:36 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
ippScripts/scripts/addstar_run.pl (modified) (4 diffs)
-
ippTasks/addstar.pro (modified) (1 diff)
-
ippTools/share/addtool_find_sky_id_multi.sql (modified) (1 diff)
-
ippTools/share/addtool_find_sky_id_multi_dvo.sql (modified) (1 diff)
-
ippTools/src/addtool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/addstar_run.pl
r33525 r33989 38 38 } 39 39 my $minidvodb_path; 40 my $stage_extra1 ; 41 my ( $add_id, $camera, $stage, $stage_id, $ multi_num, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,40 41 my ( $add_id, $camera, $stage, $stage_id, $stage_extra1, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update, 42 42 $no_op, $redirect, $save_temps); 43 43 GetOptions( … … 46 46 'stage|s=s' => \$stage, # Camera 47 47 'stage_id|w=s' => \$stage_id, 48 ' multi_num|w=s' => \$multi_num, # the number for a staticskymulti (for finding cmf)48 'stage_extra1|w=s' => \$stage_extra1, # the number for a staticskymulti (for finding cmf), or stack_id 49 49 'dbname|d=s' => \$dbname, # Database name 50 50 'outroot|w=s' => \$outroot, # output file base name … … 162 162 } 163 163 } 164 if (($stage =~/sta ticsky/) || ($stage =~/stack/)) {164 if (($stage =~/stack/)) { 165 165 $fpaObjects =~ s/smf$/cmf/; 166 166 $fpaObjectsAlt =~ s/smf$/cmf/; 167 } 167 168 } 169 my $fpaObjects1; 170 my $fpaObjects2; 168 171 my $checkalt = 0; 169 172 if ($stage =~/staticsky/) { 170 $fpaObjects =~ s/smf$/cmf/; #this should do nothing because it was already modded above 171 &my_die( "can't find the filter_num for staticsky_multi, giving up.", $add_id, $PS_EXIT_SYS_ERROR) unless (defined $multi_num); 172 my $nice_num = sprintf ("%03d", $multi_num); 173 $fpaObjects =~ s/cmf$/$nice_num.cmf/; #this make it look for .001.cmf, etc 174 if ($multi_num == 0) { 175 $checkalt =1 ; #if it's staticsky and multi_num = 0 there's an alternate file to try if this one doesn't work 176 } 173 $checkalt = 1; 174 my $sources = $ipprc->filename("PSPHOT.OUT.CMF.MEF", $stageroot); #this is mostly rigtht except the .cmf needs either 175 # .000.cmf or .stk.xxxxx.cmf 176 print "$sources\n\n\n"; 177 &my_die( "can't find the filter_num for staticsky_multi, giving up.", $add_id, $PS_EXIT_SYS_ERROR) unless (defined $stage_extra1); 178 179 180 $fpaObjects1 = $sources; 181 $fpaObjects2 = $sources; 182 $fpaObjects = $sources; 183 184 my $nice_num = sprintf ("%03d", $stage_extra1); 185 186 $fpaObjects1 =~ s/cmf$/stk.$stage_extra1.cmf/; 187 $fpaObjects2 =~ s/cmf$/$nice_num.cmf/; #this make it look for .001.cmf, etc 188 # we have 3 of them to try 189 my $realFile = $ipprc->file_resolve($fpaObjects); 190 my $realFile1 = $ipprc->file_resolve($fpaObjects1); 191 my $realFile2 = $ipprc->file_resolve($fpaObjects2); 192 if (!defined($realFile1)) { 193 if (!defined($realFile2)) { 194 print "using $fpaObjects\n"; 195 196 } else { 197 print "using $fpaObjects2\n"; 198 $fpaObjects = $fpaObjects2; 199 } 200 201 } else { 202 print "using $fpaObjects1\n"; 203 $fpaObjects = $fpaObjects1; 204 } 205 206 177 207 } 178 208 … … 230 260 my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar 231 261 232 my $realFile = $ipprc->file_resolve($fpaObjects); 233 if (!defined($realFile)) { 234 print "can't find $fpaObjects\n"; 235 if ($checkalt) { 236 $realFile = $ipprc->file_resolve($fpaObjectsAlt) or &my_die("Unable to resolve $fpaObjectsAlt", $add_id, $PS_EXIT_SYS_ERROR); 237 $fpaObjects = $fpaObjectsAlt; # want to make sure the correct value is used. 238 } else { 239 # try the 'good one' again and fail i 240 #$realFile = $ipprc->file_resolve($fpaObjects) or 241 &my_die("Unable to resolve $fpaObjects", $add_id, $PS_EXIT_SYS_ERROR); 242 } 243 244 } 262 my $realFile = $ipprc->file_resolve($fpaObjects) or &my_die("Unable to resolve $fpaObjects", $add_id, $PS_EXIT_SYS_ERROR); 263 264 265 245 266 246 267 # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default) -
trunk/ippTasks/addstar.pro
r33706 r33989 321 321 end 322 322 if ("$STAGE" == "staticsky") 323 $run = $run -- multi_num $STAGE_EXTRA1323 $run = $run --stage_extra1 $STAGE_EXTRA1 --stage_id $STAGE_ID 324 324 end 325 325 if ("$STAGE" == "cam") -
trunk/ippTools/share/addtool_find_sky_id_multi.sql
r33525 r33989 2 2 distinct(sky_id) as stage_id, 3 3 staticskyRun.*, 4 staticskyResult.num_inputs 4 staticskyResult.num_inputs, stack_id 5 5 FROM 6 6 staticskyRun -
trunk/ippTools/share/addtool_find_sky_id_multi_dvo.sql
r33525 r33989 1 SELECT distinct(sky_id) as stage_id, staticskyRun.*, staticskyResult.num_inputs FROM staticskyResult1 SELECT distinct(sky_id) as stage_id, staticskyRun.*, staticskyResult.num_inputs, stack_id FROM staticskyResult 2 2 JOIN staticskyRun USING(sky_id) 3 3 join staticskyInput using(sky_id) -
trunk/ippTools/src/addtool.c
r33779 r33989 292 292 // } 293 293 if (strcmp(stage,"staticsky") == 0) { 294 psStringAppend(&query, " GROUP BY sky_id "); //some reason it needs this294 psStringAppend(&query, " GROUP BY sky_id, stack_id"); //some reason it needs this 295 295 } 296 296 … … 525 525 psS64 stage_id =0; 526 526 bool status = false; 527 psS32 num_inputs = psMetadataLookupS32(&status, md, "num_inputs"); 527 //psS32 num_inputs = psMetadataLookupS32(&status, md, "num_inputs"); 528 psS32 stack_id = psMetadataLookupS32(&status, md, "stack_id"); 529 528 530 if (!status) { 529 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item num_inputs");531 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stack_id"); 530 532 return false; 531 533 } … … 540 542 541 543 // queue the exp 542 for (int filter_id = 0; filter_id < num_inputs; filter_id++) {543 if (!pxaddQueueByCamID(config,544 //for (int filter_id = 0; filter_id < num_inputs; filter_id++) { 545 if (!pxaddQueueByCamID(config, 544 546 stage, 545 stage_id,546 filter_id,547 stage_id, 548 stack_id, 547 549 workdir ? workdir : row->workdir, 548 550 reduction ? reduction : row->reduction, … … 555 557 minidvodb_group, 556 558 minidvodb_name 557 )) {559 )) { 558 560 if (!psDBRollback(config->dbh)) { 559 psError(PS_ERR_UNKNOWN, false, "database error sfg");561 psError(PS_ERR_UNKNOWN, false, "database error sfg"); 560 562 } 561 563 psError(PS_ERR_UNKNOWN, false, … … 564 566 psFree(output); 565 567 return false; 566 }567 }568 } 569 //} 568 570 psFree(row); 569 571 }
Note:
See TracChangeset
for help on using the changeset viewer.
