Changeset 37804 for branches/eam_branches/ipp-20140904
- Timestamp:
- Jan 11, 2015, 2:05:35 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904
- Files:
-
- 91 edited
- 22 copied
-
. (modified) (1 prop)
-
DataStoreServer/scripts/dsreg (modified) (1 prop)
-
Nebulous/bin/neb-rm (modified) (1 diff)
-
dvodist (modified) (1 prop)
-
extsrc/gpcsw/gpcsrc/fits/burntool (modified) (1 prop)
-
extsrc/gpcsw/gpcsrc/fits/burntool/persistio.c (modified) (3 diffs)
-
hardware/dotConsolerc (copied) (copied from trunk/hardware/dotConsolerc )
-
ippMonitor/czartool/czartool/Plotter.pm (modified) (1 prop)
-
ippScripts/scripts/addstar_run.pl (modified) (4 diffs)
-
ippScripts/scripts/ipp_cleanup.pl (modified) (1 diff)
-
ippScripts/scripts/lap_science.pl (modified) (2 diffs, 1 prop)
-
ippScripts/scripts/permcheck.pl (modified) (13 diffs)
-
ippScripts/scripts/publish_file.pl (modified) (6 diffs)
-
ippScripts/scripts/queuestaticsky.pl (modified) (1 prop)
-
ippScripts/scripts/rawcheck.pl (modified) (1 diff)
-
ippScripts/scripts/sc_remote_exec.pl (modified) (1 prop)
-
ippScripts/scripts/stack_bkg_mk_mdc.pl (modified) (3 diffs)
-
ippTasks/addstar.pro (modified) (6 diffs)
-
ippTasks/register.pro (modified) (5 diffs)
-
ippTasks/stack.pro (modified) (4 diffs)
-
ippTasks/survey.pro (modified) (6 diffs)
-
ippTools/share/Makefile.am (modified) (6 diffs)
-
ippTools/share/addtool_find_diff_id.sql (copied) (copied from trunk/ippTools/share/addtool_find_diff_id.sql )
-
ippTools/share/addtool_find_diff_id_dvo.sql (copied) (copied from trunk/ippTools/share/addtool_find_diff_id_dvo.sql )
-
ippTools/share/addtool_find_ff_id.sql (copied) (copied from trunk/ippTools/share/addtool_find_ff_id.sql )
-
ippTools/share/addtool_find_ff_id_dvo.sql (copied) (copied from trunk/ippTools/share/addtool_find_ff_id_dvo.sql )
-
ippTools/share/addtool_find_pendingexp_diff.sql (copied) (copied from trunk/ippTools/share/addtool_find_pendingexp_diff.sql )
-
ippTools/share/addtool_find_pendingexp_ff.sql (copied) (copied from trunk/ippTools/share/addtool_find_pendingexp_ff.sql )
-
ippTools/share/addtool_find_processedexp_diff.sql (copied) (copied from trunk/ippTools/share/addtool_find_processedexp_diff.sql )
-
ippTools/share/addtool_find_processedexp_ff.sql (copied) (copied from trunk/ippTools/share/addtool_find_processedexp_ff.sql )
-
ippTools/share/addtool_queue_diff_id.sql (copied) (copied from trunk/ippTools/share/addtool_queue_diff_id.sql )
-
ippTools/share/addtool_queue_ff_id.sql (copied) (copied from trunk/ippTools/share/addtool_queue_ff_id.sql )
-
ippTools/share/addtool_revertprocessedexp_diff.sql (copied) (copied from trunk/ippTools/share/addtool_revertprocessedexp_diff.sql )
-
ippTools/share/addtool_revertprocessedexp_ff.sql (copied) (copied from trunk/ippTools/share/addtool_revertprocessedexp_ff.sql )
-
ippTools/share/fftool_result.sql (modified) (1 diff)
-
ippTools/share/laptool_exposures.sql (modified) (4 diffs)
-
ippTools/share/laptool_revertsass.sql (copied) (copied from trunk/ippTools/share/laptool_revertsass.sql )
-
ippTools/share/pstamptool_pendingdependent.sql (modified) (1 diff)
-
ippTools/src/addtool.c (modified) (13 diffs)
-
ippTools/src/addtoolConfig.c (modified) (4 diffs)
-
ippTools/src/chiptool.c (modified) (1 diff)
-
ippTools/src/fftool.c (modified) (1 diff)
-
ippTools/src/laptool.c (modified) (3 diffs)
-
ippTools/src/laptool.h (modified) (1 diff)
-
ippTools/src/laptoolConfig.c (modified) (3 diffs)
-
ippTools/src/pxadd.c (modified) (1 diff)
-
ippTools/src/stacktool.c (modified) (6 diffs)
-
ippTools/src/stacktool.h (modified) (1 diff)
-
ippTools/src/stacktoolConfig.c (modified) (2 diffs)
-
mops (copied) (copied from trunk/mops )
-
mops/mops_ringsv3 (copied) (copied from trunk/mops/mops_ringsv3 )
-
mops/mops_ringsv3/populate_ringsv3_database.py (copied) (copied from trunk/mops/mops_ringsv3/populate_ringsv3_database.py )
-
ppImage/src/ppImageAddNoise.c (modified) (2 diffs)
-
ppImage/src/ppImageAuxiliaryMask.c (modified) (2 diffs)
-
ppImage/src/ppImageCheckCTE.c (modified) (2 diffs)
-
ppImage/src/ppImageCheckNoise.c (modified) (2 diffs)
-
ppImage/src/ppImageDetrendFringe.c (modified) (2 diffs)
-
ppImage/src/ppImageDetrendPattern.c (modified) (2 diffs)
-
ppImage/src/ppImageDetrendReadout.c (modified) (18 diffs)
-
ppImage/src/ppImageMosaic.c (modified) (2 diffs)
-
ppImage/src/ppImageParityFlip.c (modified) (2 diffs)
-
ppImage/src/ppImagePixelStats.c (modified) (2 diffs)
-
ppImage/src/ppImageRebinReadout.c (modified) (2 diffs)
-
ppImage/src/ppImageSetMaskBits.c (modified) (2 diffs)
-
ppTranslate/src/ppMops.h (modified) (3 diffs)
-
ppTranslate/src/ppMopsArguments.c (modified) (5 diffs)
-
ppTranslate/src/ppMopsDetections.c (modified) (2 diffs)
-
ppTranslate/src/ppMopsRead.c (modified) (2 diffs)
-
ppTranslate/src/ppMopsWrite.c (modified) (2 diffs)
-
psLib/src/imageops/psImageMapFit.c (modified) (8 diffs)
-
psLib/src/imageops/psImageMapFit.h (modified) (1 diff)
-
psLib/src/math/psMinimizePolyFit.c (modified) (5 diffs, 1 prop)
-
psLib/src/mathtypes/psImage.c (modified) (1 diff)
-
psModules/src/concepts/pmConcepts.c (modified) (1 diff)
-
psModules/src/imcombine/pmSubtraction.c (modified) (1 diff)
-
psModules/src/objects/pmSourceExtendedPars.c (modified) (1 diff)
-
psModules/src/objects/pmSourceExtendedPars.h (modified) (1 diff)
-
psModules/src/objects/pmSourceIO_CMF.c.in (modified) (7 diffs, 1 prop)
-
psastro/src/psastro.h (modified) (1 diff)
-
psastro/src/psastroChooseRefstars.c (modified) (2 diffs)
-
psastro/src/psastroZeroPoint.c (modified) (11 diffs)
-
psphot/src/Makefile.am (modified) (1 diff)
-
psphot/src/psphot.h (modified) (3 diffs)
-
psphot/src/psphotChooseAnalysisOptions.c (modified) (1 diff)
-
psphot/src/psphotChoosePSF.c (modified) (4 diffs)
-
psphot/src/psphotCleanup.c (modified) (1 diff)
-
psphot/src/psphotEfficiency.c (modified) (1 diff)
-
psphot/src/psphotExtendedSourceFits.c (modified) (1 diff)
-
psphot/src/psphotFitSourcesLinear.c (modified) (1 diff)
-
psphot/src/psphotFullForceReadout.c (modified) (1 diff)
-
psphot/src/psphotGalaxyParams.c (copied) (copied from trunk/psphot/src/psphotGalaxyParams.c )
-
psphot/src/psphotMagnitudes.c (modified) (3 diffs)
-
psphot/src/psphotOutput.c (modified) (2 diffs)
-
psphot/src/psphotPetrosianAnalysis.c (modified) (1 diff)
-
psphot/src/psphotReadout.c (modified) (1 diff)
-
psphot/src/psphotReadoutCleanup.c (modified) (1 diff)
-
psphot/src/psphotSetNFrames.c (modified) (1 diff)
-
psphot/src/psphotSetThreads.c (modified) (1 diff)
-
psphot/src/psphotSourceStats.c (modified) (3 diffs)
-
psphot/src/psphotStackParseCamera.c (modified) (2 diffs)
-
psphot/src/psphotStackReadout.c (modified) (5 diffs)
-
pstamp/scripts/pstamp_checkdependent.pl (modified) (35 diffs, 1 prop)
-
pstamp/scripts/pstamp_finish.pl (modified) (1 prop)
-
pstamp/scripts/pstamp_job_run.pl (modified) (1 prop)
-
pstamp/scripts/pstampparse.pl (modified) (1 prop)
-
pstamp/scripts/request_finish.pl (modified) (1 prop)
-
tools/heather/check_stsci0.pl (copied) (copied from trunk/tools/heather/check_stsci0.pl )
-
tools/heather/check_stsci1.pl (copied) (copied from trunk/tools/heather/check_stsci1.pl )
-
tools/heather/check_stsci2.pl (copied) (copied from trunk/tools/heather/check_stsci2.pl )
-
tools/heather/queuesliceslap2.pl (modified) (4 diffs)
-
tools/heather/queuesliceslap2skycal.pl (modified) (4 diffs)
-
tools/iasc/getit (modified) (1 diff)
-
tools/stask_chip.py (copied) (copied from trunk/tools/stask_chip.py )
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/DataStoreServer/scripts/dsreg
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/Nebulous/bin/neb-rm
r26333 r37804 44 44 foreach my $key (@ARGV) { 45 45 unless (defined $move) { 46 $neb->delete($key, $force,$invalid) or warn "failed to delete key: $key"; 46 eval { 47 $neb->delete($key, $force,$invalid) or warn "failed to delete key: $key"; 48 } 47 49 } else { 48 50 $neb->move($key, "${key}.rm") or warn "failed to move key: $key"; -
branches/eam_branches/ipp-20140904/dvodist
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20140904/extsrc/gpcsw/gpcsrc/fits/burntool
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20140904/extsrc/gpcsw/gpcsrc/fits/burntool/persistio.c
r34220 r37804 115 115 #define DIFFERENT_STREAK 20 /* Proximity for union versus intersection */ 116 116 117 # define myMAXSIZE 20000 118 119 117 120 /****************************************************************/ 118 121 /* persist_merge(): Disentangle overlapping persistence streaks */ … … 123 126 int lapmax; 124 127 OBJBOX *box; 125 int xusage[ MAXSIZE], yctr[MAXSIZE], boxid[MAXSIZE];128 int xusage[myMAXSIZE], yctr[myMAXSIZE], boxid[myMAXSIZE]; 126 129 double zk, zj; 127 130 … … 131 134 132 135 /* Assess the clustering of all the streaks */ 133 for(i=0; i< MAXSIZE; i++) xusage[i] = 0;134 for(i=0; i< MAXSIZE; i++) boxid[i] = -1;136 for(i=0; i<myMAXSIZE; i++) xusage[i] = 0; 137 for(i=0; i<myMAXSIZE; i++) boxid[i] = -1; 135 138 for(k=0; k<nbox; k++) { 136 if(box[k].exfit >= MAXSIZE-1) continue;139 if(box[k].exfit >= myMAXSIZE-1) continue; 137 140 for(i=box[k].sxfit; i<=box[k].exfit; i++) xusage[i] += 1; 138 141 } 139 142 140 143 /* Identify clusters */ 141 for(xs=0; xs< MAXSIZE-1; xs++) {144 for(xs=0; xs<myMAXSIZE-1; xs++) { 142 145 if(xusage[xs] == 0) continue; 143 for(xe=xs, lapmax=0; xe< MAXSIZE-1; xe++) {146 for(xe=xs, lapmax=0; xe<myMAXSIZE-1; xe++) { 144 147 if(xusage[xe+1] == 0) break; 145 148 lapmax = MAX(lapmax, xusage[xe]); -
branches/eam_branches/ipp-20140904/ippMonitor/czartool/czartool/Plotter.pm
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/ippScripts/scripts/addstar_run.pl
r34750 r37804 94 94 # Recipes to use based on reduction class 95 95 $reduction = 'DEFAULT' unless defined $reduction; 96 if ($stage =~/skycal/) { 97 $reduction = 'DEFAULT'; 98 } 96 #if ($stage =~/diff/) { 97 # $reduction = 'ADDSTAR'; 98 #} 99 #if ($stage =~/fullforce/) { 100 # $reduction = 'ADDSTAR'; 101 #} 102 103 if ($stage =~/fullforce/) { 104 $reduction='DEFAULT'; 105 #hardwired because why not 106 } 107 99 108 my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); 100 109 # XXX This is now not used: do we still need it? … … 132 141 print "using $fpaObjects for $stage\n"; 133 142 } 143 if ($stage =~/diff/) { 144 print "using $fpaObjects for $stage\n"; 145 } 146 if ($stage =~/fullforce/) { 147 print "using $fpaObjects for $stage\n"; 148 } 149 134 150 135 151 … … 177 193 } 178 194 179 if (($stage =~/stack/ || $stage =~ /skycal/ )) {195 if (($stage =~/stack/ || $stage =~ /skycal/ || $stage =~/diff/ || $stage=~/fullforce/)) { 180 196 $fpaObjects =~ s/smf$/cmf/; 181 197 $fpaObjectsAlt =~ s/smf$/cmf/; … … 305 321 $command .= " -quick-airmass"; 306 322 } #careful here - this matches staticsky and staticsky_multi 323 if ($stage =~ /diff/) { 324 $command .= " -accept-astrom"; 325 } 326 if ($stage =~ /fullforce/) { 327 $command .= " -accept-astrom -xrad"; 328 } 307 329 308 330 my $mjd_addstar_start = DateTime->now->mjd; # MJD of starting script -
branches/eam_branches/ipp-20140904/ippScripts/scripts/ipp_cleanup.pl
r35906 r37804 588 588 addFilename(\@files, "PSWARP.OUTPUT.SOURCES", $path_base, $skycell_id); 589 589 addFilename(\@files, "SKYCELL.TEMPLATE", $path_base, $skycell_id ); 590 addFilename(\@files, "PSPHOT.RESID",$path_base,"fpa"); 590 591 if ($mode eq "goto_purged") { 591 592 # additional files to remove for 'purge' mode -
branches/eam_branches/ipp-20140904/ippScripts/scripts/lap_science.pl
- Property svn:mergeinfo set to
r37319 r37804 622 622 $complete_fstacks++; 623 623 } 624 elsif (($stack->{final_state})&& 625 ($stack->{final_state} eq 'wait')) { 626 $complete_fstacks++; # Not the best either, but we've noted an issue, and tried to move on. LAP should respect this. 627 } 624 628 elsif (($stack->{final_state})&&($stack->{final_state} eq 'new')&& 625 629 ($stack->{final_fault} >= 4)&&($stack->{final_fault} != 32767)) { … … 757 761 } 758 762 elsif ((defined($exposure->{warpRun_state}))&&($exposure->{warpRun_state} eq 'full')&& 759 ($exposure->{warp_bad_quality} / $exposure->{warp_component_count} > 0. 2)) {763 ($exposure->{warp_bad_quality} / $exposure->{warp_component_count} > 0.3)) { 760 764 printf("QUALITY: $exposure->{exp_id} has bad warp quality: %d / %d\n", 761 765 $exposure->{warp_bad_quality} , $exposure->{warp_component_count}); -
branches/eam_branches/ipp-20140904/ippScripts/scripts/permcheck.pl
r37139 r37804 21 21 #my $regtool = can_run('regtool') or (warn "Can't find regtool" and $missing_tools = 1); 22 22 my $camtool = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1); 23 my $warptool = can_run('warptool') or (warn "Can't find warptool" and $missing_tools = 1); 23 24 my $stacktool = can_run('stacktool') or (warn "Can't find stacktool" and $missing_tools = 1); 24 25 my $staticskytool = can_run('staticskytool') or (warn "Can't find staticskytool" and $missing_tools = 1); … … 41 42 pod2usage( -msg => "Required options: --dbname", -exitval => 2 ) 42 43 unless $dbname; 43 pod2usage( -msg => "Required options: --stage [camera| stack|skycal]", -exitval => 2 )44 pod2usage( -msg => "Required options: --stage [camera|warp|stack|skycal]", -exitval => 2 ) 44 45 unless $stage; 45 46 pod2usage( -msg => "missing key", exitval => 2 ) … … 58 59 'ippb06' => 1 59 60 ); 61 62 if ($stage eq 'warp') { # These things are destined to have their only copy on the stsciXX nodes. 63 %backup_hosts = ('stsci00' => 1, 'stsci01' => 1, 'stsci02' => 1, 64 'stsci03' => 1, 'stsci04' => 1, 'stsci05' => 1, 'stsci06' => 1, 65 'stsci07' => 1, 'stsci08' => 1, 'stsci09' => 1, 66 'stsci10' => 1, 'stsci11' => 1, 'stsci12' => 1, 67 'stsci13' => 1, 'stsci14' => 1, 'stsci15' => 1, 'stsci16' => 1, 68 'stsci17' => 1, 'stsci18' => 1, 'stsci19' => 1); 69 %backup_destinations = %backup_hosts; 70 } 71 60 72 my $backup_Nvols = 3; 61 73 … … 113 125 &my_die("Unable to parse metadata from stagetool", $stage_id); 114 126 } 127 elsif ($stage eq 'warp') { 128 my $cmd = "$warptool -warped -warp_id $stage_id -dbname $dbname"; 129 my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 130 run(command => $cmd, verbose => 0); 131 unless ($success) { 132 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 133 &my_die("Unable to perform stagetool: $error_code", $stage_id); 134 } 135 $files = $mdcParser->parse_list(join "", @$stdout_buf) or 136 &my_die("Unable to parse metadata from stagetool", $stage_id); 137 } 115 138 116 139 my %components = ('camera' => ['PSASTRO.OUTPUT','PSASTRO.OUTPUT.MASK'], 140 'warp' => ['PSWARP.OUTPUT','PSWARP.OUTPUT.MASK','PSWARP.OUTPUT.VARIANCE'], 117 141 'stack' => ['PPSTACK.UNCONV.COMP','PPSTACK.UNCONV.MASK.COMP','PPSTACK.UNCONV.VARIANCE.COMP', 118 142 'PPSTACK.UNCONV.EXP','PPSTACK.UNCONV.EXPNUM','PPSTACK.UNCONV.EXPWT.COMP'], … … 124 148 my $data_state = $entry->{state}; 125 149 my $hostname = $entry->{hostname}; 150 my $quality = $entry->{quality}; 151 if ($quality != 0) { next; } 152 print "# $path_base $data_state $hostname $quality\n"; 126 153 foreach my $product (@{ $components{$stage} }) { 127 154 my @keys = (); … … 148 175 my $stat = $neb->stat($key); 149 176 die "nebulous key: $key not found" unless $stat; 150 my $instances = $neb->find_instances($key, 'any'); 177 my $instances; 178 eval { 179 $instances = $neb->find_instances($key, 'any'); 180 }; 181 unless (defined($instances)) { print "## skipping due to zero instances\n"; next; } 151 182 die "no instances found" unless $instances; 152 183 … … 256 287 $quality[0] = 1; 257 288 print "cp $good_file $diskfiles[0]\n"; 258 system("cp $good_file $diskfiles[0]");289 vsystem("cp $good_file $diskfiles[0]"); 259 290 } 260 291 # Begin my best validation thought … … 275 306 if ($md5sums[$i] eq $md5sum) { # Found it. 276 307 print "cp $diskfiles[$i] $diskfiles[0]\n"; 277 system("cp $diskfiles[$i] $diskfiles[0]");308 vsystem("cp $diskfiles[$i] $diskfiles[0]"); 278 309 # Begin my best validation thought 279 310 { … … 291 322 if ($Ngood == 1) { # We have only one version 292 323 if ($quality_mask & 1) { # ANd it's on a backup volume 293 print "neb-replicate $key\n"; 294 if ($do_ops) { 295 $neb->replicate($key) or die "failed to replicate the single valid copy"; 296 if ($@) { die $@; } 324 if ($user_copies > 1) { # And we want more than one copy. 325 print "neb-replicate $key\n"; 326 if ($do_ops) { 327 $neb->replicate($key) or die "failed to replicate the single valid copy"; 328 if ($@) { die $@; } 329 } 297 330 } 298 331 } … … 305 338 306 339 # Begin my best validation thought 307 system("sync") == 0 or die "Couldn't sync?";340 vsystem("sync") == 0 or die "Couldn't sync?"; 308 341 my $uris = $neb->find_instances($key,$rep_vol); 309 342 @$uris = map {URI->new($_)->file if $_} @$uris; … … 325 358 326 359 # Begin my best validation thought 327 system("sync") == 0 or die "Couldn't sync?";360 vsystem("sync") == 0 or die "Couldn't sync?"; 328 361 my $uris = $neb->find_instances($key,$rep_vol); 329 362 @$uris = map {URI->new($_)->file if $_} @$uris; … … 343 376 } 344 377 } 345 for (my $i = 0; $i <= $#diskfiles; $i++) { 378 } 379 #XXX NEW DEBUG THIS: This should iterate over diskfiles that are not marked with a quality = 2, and cull them. 380 # For the N>=2, we set that for the primary, and 381 # for both cases, we do not have a diskfile entry for the newly replicated copy. 382 # Therefore, this should cull down to the correct number. 383 for (my $i = 0; $i <= $#diskfiles; $i++) { 346 384 # print "$existance[$i] $quality[$i] $md5sums[$i] $md5sum $diskhosts[$i] $diskvols[$i]\n"; 347 if ($quality[$i] != 1) {348 if ($existance[$i] == 0) { # This disk file doesn't exist.349 system("touch $diskfiles[$i]");350 }351 my $cull_vol = $diskhosts[$i] . "." . $diskvols[$i];352 print "neb-cull --volume $cull_vol $key\n";353 if ($do_ops) {354 # The tilde here is to force hard volumes. Don't touch it.355 $neb->cull($key,"~${cull_vol}",2) or die "failed to cull a superfluous instance";356 if ($@) { die "$@"; }357 }358 }359 }360 }385 if ($quality[$i] != 1) { 386 if ($existance[$i] == 0) { # This disk file doesn't exist. 387 vsystem("touch $diskfiles[$i]"); 388 } 389 my $cull_vol = $diskhosts[$i] . "." . $diskvols[$i]; 390 print "neb-cull --volume $cull_vol $key\n"; 391 if ($do_ops) { 392 # The tilde here is to force hard volumes. Don't touch it. 393 $neb->cull($key,"~${cull_vol}",2) or die "failed to cull a superfluous instance"; 394 if ($@) { die "$@"; } 395 } 396 } 397 } 398 # } 361 399 } # end keys for this product 362 400 } # end product for this entry 363 401 } # end entry for this id 402 403 sub vsystem { 404 my $cmd = shift; 405 print "$cmd\n"; 406 if ($do_ops) { 407 system($cmd); 408 } 409 } 364 410 365 411 sub local_md5sum { … … 379 425 380 426 427 381 428 sub parse_volume { 382 429 my $filename = shift(@_); -
branches/eam_branches/ipp-20140904/ippScripts/scripts/publish_file.pl
r36839 r37804 252 252 warp_id => $comp->{warp1}, 253 253 diff_id => $comp->{diff_id}, 254 camera => $comp->{camera}, 254 255 output_format => $comp->{output_format}, 255 256 direction => 1, … … 291 292 warp_id => $comp->{warp2}, 292 293 diff_id => $comp->{diff_id}, 294 camera => $comp->{camera}, 295 # missing output_format? 293 296 direction => 0, 294 297 comment => $reg_comp->{comment}, … … 359 362 my $name = shift; # Name of component 360 363 361 $data->{zp} = $comp->{zp} unless defined $data->{zp}; 362 $data->{zp_err} = $comp->{zp_err} unless defined $data->{zp_err}; 363 $data->{astrom} = $comp->{astrom} unless defined $data->{astrom}; 364 $data->{exp_name} = $comp->{exp_name} unless defined $data->{exp_name}; 365 $data->{exp_id} = $comp->{exp_id} unless defined $data->{exp_id}; 366 $data->{chip_id} = $comp->{chip_id} unless defined $data->{chip_id}; 367 $data->{cam_id} = $comp->{cam_id} unless defined $data->{cam_id}; 368 $data->{fake_id} = $comp->{fake_id} unless defined $data->{fake_id}; 369 $data->{warp_id} = $comp->{warp_id} unless defined $data->{warp_id}; 370 $data->{diff_id} = $comp->{diff_id} unless defined $data->{diff_id}; 364 $data->{zp} = $comp->{zp} unless defined $data->{zp}; 365 $data->{zp_err} = $comp->{zp_err} unless defined $data->{zp_err}; 366 $data->{astrom} = $comp->{astrom} unless defined $data->{astrom}; 367 $data->{exp_name} = $comp->{exp_name} unless defined $data->{exp_name}; 368 $data->{exp_id} = $comp->{exp_id} unless defined $data->{exp_id}; 369 $data->{chip_id} = $comp->{chip_id} unless defined $data->{chip_id}; 370 $data->{cam_id} = $comp->{cam_id} unless defined $data->{cam_id}; 371 $data->{fake_id} = $comp->{fake_id} unless defined $data->{fake_id}; 372 $data->{warp_id} = $comp->{warp_id} unless defined $data->{warp_id}; 373 $data->{diff_id} = $comp->{diff_id} unless defined $data->{diff_id}; 374 $data->{camera} = $comp->{camera} unless defined $data->{camera}; 375 # missing output_format? 371 376 $data->{direction} = $comp->{direction} unless defined $data->{direction}; 372 $data->{comment} = $comp->{comment}unless defined $data->{comment};373 $data->{obsmode} = $comp->{obsmode}unless defined $data->{obsmode};374 $data->{difftype} = $comp->{difftype}unless defined $data->{difftype};375 $data->{sky} = $comp->{sky}unless defined $data->{sky};376 $data->{shutoutc} = $comp->{shutoutc}unless defined $data->{shutoutc};377 $data->{comment} = $comp->{comment} unless defined $data->{comment}; 378 $data->{obsmode} = $comp->{obsmode} unless defined $data->{obsmode}; 379 $data->{difftype} = $comp->{difftype} unless defined $data->{difftype}; 380 $data->{sky} = $comp->{sky} unless defined $data->{sky}; 381 $data->{shutoutc} = $comp->{shutoutc} unless defined $data->{shutoutc}; 377 382 378 383 &my_die("zp value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{zp} and $comp->{zp} != $data->{zp}; … … 386 391 &my_die("warp_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{warp_id} and $comp->{warp_id} != $data->{warp_id}; 387 392 &my_die("diff_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{diff_id} and $comp->{diff_id} != $data->{diff_id}; 393 &my_die("camera value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{camera} and $comp->{camera} ne $data->{camera}; 388 394 &my_die("direction value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{direction} and $comp->{direction} != $data->{direction}; 389 395 &my_die("comment value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{comment} and $comp->{comment} ne $data->{comment}; … … 414 420 $command .= " -warp_id " . $data->{warp_id} if defined $data->{warp_id}; 415 421 $command .= " -diff_id " . $data->{diff_id} if defined $data->{diff_id}; 422 $command .= " -camera " . $data->{camera} if defined $data->{camera}; 416 423 $command .= " -inverse" if defined $data->{direction} and $data->{direction} == 0; 417 424 $command .= " -zp " . $data->{zp} if defined $data->{zp}; … … 420 427 $command .= " -version " . $data->{output_format} if defined $data->{output_format}; 421 428 $command .= " -comment \"" . $data->{comment} . "\"" if defined $data->{comment}; 422 $command .= " -obsmode " . $data->{obsmode}if defined $data->{obsmode};429 $command .= " -obsmode \"" . $data->{obsmode} . "\"" if defined $data->{obsmode}; 423 430 $command .= " -difftype " . $data->{difftype} if defined $data->{difftype}; 424 431 $command .= " -sky " . $data->{sky} if defined $data->{sky}; -
branches/eam_branches/ipp-20140904/ippScripts/scripts/queuestaticsky.pl
- Property svn:mergeinfo changed
/branches/eam_branches/ps2-tc3-20130727/ippScripts/scripts/queuestaticsky.pl (added) merged: 36680,37403 /trunk/ippScripts/scripts/queuestaticsky.pl (added) merged: 37411,37772
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/ippScripts/scripts/rawcheck.pl
r36685 r37804 62 62 my %backup_hosts = ('ippb00' => 1, 'ippb01' => 1, 63 63 'ippb02' => 1, 'ippb03' => 1, 64 'ippb04' => 1, 'ippb05' => 1 64 'ippb04' => 1, 'ippb05' => 1, 65 'ippb06' => 1 65 66 ); 66 my %backup_destinations = ('ippb04' => 1, 67 'ippb05' => 1); 67 my %backup_destinations = (# 'ippb04' => 1, # full 68 # 'ippb05' => 1, # full 69 'ippb06' => 1 70 ); 68 71 my $backup_Nvols = 3; 69 72 -
branches/eam_branches/ipp-20140904/ippScripts/scripts/sc_remote_exec.pl
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/ippScripts/scripts/stack_bkg_mk_mdc.pl
r36810 r37804 13 13 14 14 my ($dbname,$stack_id,$label,$camera,$filter); 15 16 my $ipprc = PS::IPP::Config->new(); # IPP Configuration 17 my $siteConfig = $ipprc->{_siteConfig}; 18 15 19 #$dbname = 'gpc1'; 16 20 #$camera = 'GPC1'; … … 29 33 30 34 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock'; 31 my $dbserver = 'ippdb01'; 32 my $dbuser = 'ippuser'; 33 my $dbpass = 'ippuser'; 35 my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER'); 36 my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER"); 37 my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD"); 38 die "database configuration not set up" unless defined($dbserver); 39 die "database configuration not set up" unless defined($dbuser); 40 die "database configuration not set up" unless defined($dbpass); 34 41 my $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" . 35 42 "mysql_socket=" . DB_SOCKET(), … … 38 45 ) or die "Unable to connect to database $DBI::errstr\n"; 39 46 40 my$ipprc = PS::IPP::Config->new( $camera );47 $ipprc = PS::IPP::Config->new( $camera ); 41 48 my $mdcParser = PS::IPP::Metadata::Config->new; 42 49 -
branches/eam_branches/ipp-20140904/ippTasks/addstar.pro
r35305 r37804 52 52 active false 53 53 end 54 task addstar.revert.diff 55 active false 56 end 57 task addstar.revert.fullforce 58 active false 59 end 54 60 end 55 61 … … 65 71 end 66 72 task addstar.revert.skycal 73 active true 74 end 75 task addstar.revert.diff 76 active true 77 end 78 task addstar.revert.fullforce 67 79 active true 68 80 end … … 141 153 $addstar_revert_DB_SSM = 0 142 154 $addstar_revert_DB_SC = 0 155 $addstar_revert_DB_FF = 0 156 $addstar_revert_DB_DF = 0 143 157 144 158 #$LOADEXEC_ADD = 300 … … 275 289 sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID 276 290 end 291 if ("$STAGE" == "diff") 292 sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID 293 end 294 if ("$STAGE" == "fullforce") 295 sprintf outroot "%s.add.%s" $STAGEROOT $ADD_ID 296 end 277 297 278 298 … … 293 313 if ("$STAGE" == "skycal") 294 314 $run = $run --stage_id $STAGE_ID 315 end 316 if ("$STAGE" == "diff") 317 $run = $run --stage_id $STAGE_ID --stage_extra1 $STAGE_EXTRA1 318 end 319 if ("$STAGE" == "fullforce") 320 $run = $run --stage_id $STAGE_ID --stage_extra1 $STAGE_EXTRA1 295 321 end 296 322 … … 526 552 end 527 553 end 554 555 556 task addstar.revert.diff 557 host local 558 559 periods -poll 5.0 560 periods -exec 60.0 561 periods -timeout 1200 562 npending 1 563 active false 564 565 stdout NULL 566 stderr $LOGDIR/revert.log 567 568 task.exec 569 if ($LABEL:n == 0) break 570 $run = addtool -revertprocessedexp -stage diff 571 if ($DB:n == 0) 572 option DEFAULT 573 else 574 # save the DB name for the exit tasks 575 option $DB:$addstar_revert_DB_DF 576 $run = $run -dbname $DB:$addstar_revert_DB_DF 577 $addstar_revert_DB_DF ++ 578 if ($addstar_revert_DB_DF >= $DB:n) set addstar_revert_DB_DF = 0 579 end 580 add_poll_labels run 581 command $run 582 end 583 584 # success 585 task.exit 0 586 end 587 588 # locked list 589 task.exit default 590 showcommand failure 591 end 592 593 task.exit crash 594 showcommand crash 595 end 596 597 # operation times out? 598 task.exit timeout 599 showcommand timeout 600 end 601 end 602 603 604 task addstar.revert.fullforce 605 host local 606 607 periods -poll 5.0 608 periods -exec 60.0 609 periods -timeout 1200 610 npending 1 611 active false 612 613 stdout NULL 614 stderr $LOGDIR/revert.log 615 616 task.exec 617 if ($LABEL:n == 0) break 618 $run = addtool -revertprocessedexp -stage fullforce 619 if ($DB:n == 0) 620 option DEFAULT 621 else 622 # save the DB name for the exit tasks 623 option $DB:$addstar_revert_DB_FF 624 $run = $run -dbname $DB:$addstar_revert_DB_FF 625 $addstar_revert_DB_FF ++ 626 if ($addstar_revert_DB_FF >= $DB:n) set addstar_revert_DB_FF = 0 627 end 628 add_poll_labels run 629 command $run 630 end 631 632 # success 633 task.exit 0 634 end 635 636 # locked list 637 task.exit default 638 showcommand failure 639 end 640 641 task.exit crash 642 showcommand crash 643 end 644 645 # operation times out? 646 task.exit timeout 647 showcommand timeout 648 end 649 end -
branches/eam_branches/ipp-20140904/ippTasks/register.pro
r35830 r37804 36 36 active false 37 37 end 38 task register.exp.revert 39 active false 40 end 38 41 task register.exp.load 39 42 active true … … 60 63 active false 61 64 end 65 task register.exp.revert 66 active false 67 end 62 68 task register.exp.load 63 69 active false … … 78 84 active true 79 85 end 86 task register.exp.revert 87 active true 88 end 80 89 end 81 90 82 91 macro register.revert.off 83 92 task register.imfile.revert 93 active false 94 end 95 task register.exp.revert 84 96 active false 85 97 end … … 202 214 $regPendingBurntoolImfile_DB = 0 203 215 $regRevertImfile_DB = 0 216 $regRevertExp_DB = 0 204 217 $regPendingExp_DB = 0 205 218 $reg_datePAGE = 0 … … 371 384 $regRevertImfile_DB ++ 372 385 if ($regRevertImfile_DB >= $DB:n) set regRevertImfile_DB = 0 386 end 387 add_poll_args run 388 command $run 389 end 390 391 # success 392 task.exit 0 393 end 394 395 # locked list 396 task.exit default 397 showcommand failure 398 end 399 400 task.exit crash 401 showcommand crash 402 end 403 404 # operation times out 405 task.exit timeout 406 showcommand timeout 407 end 408 end 409 410 411 412 task register.exp.revert 413 host local 414 periods -poll 60.0 415 periods -exec 1800.0 416 periods -timeout 120.0 417 npending 1 418 419 stdout NULL 420 stderr $LOGDIR/register.exp.revert.log 421 422 task.exec 423 # Only revert fault 2, because other faults likely mean something horrible is happening. 424 $run = regtool -revertprocessedexp -fault 2 425 if ($DB:n == 0) 426 option DEFAULT 427 else 428 option $DB:$regRevertExp_DB 429 $run = $run -dbname $DB:$regRevertExp_DB 430 $regRevertExp_DB ++ 431 if ($regRevertExp_DB >= $DB:n) set regRevertExp_DB = 0 373 432 end 374 433 add_poll_args run -
branches/eam_branches/ipp-20140904/ippTasks/stack.pro
r37076 r37804 53 53 active false 54 54 end 55 task stack.summary.load56 active true57 end58 task stack.summary.run59 active true60 end61 55 end 62 56 … … 72 66 active false 73 67 end 74 task stack.summary.load 75 active false 76 end 77 task stack.summary.run 78 active false 79 end 80 end 81 68 end 69 70 # Same for summary stages. 82 71 macro stack.summary.on 83 72 task stack.summary.load … … 313 302 periods -exec $LOADEXEC 314 303 periods -timeout 1200 315 trange 07:00:00 08:00:00 -nmax 1 304 active false 305 # trange 07:00:00 08:00:00 -nmax 1 316 306 npending 1 317 307 … … 368 358 periods -exec $RUNEXEC 369 359 periods -timeout 60 360 active false 370 361 371 362 task.exec -
branches/eam_branches/ipp-20140904/ippTasks/survey.pro
r37076 r37804 178 178 # user functions to manipulate warp/stack diff labels 179 179 macro survey.add.WSdiff 180 if ($0 != 6)181 echo "USAGE: survey.add.WSdiff ( warp label) (stack label) (dist_group) (workdir base) (target label)"180 if ($0 != 7) 181 echo "USAGE: survey.add.WSdiff (key) (warp label) (stack label) (dist_group) (workdir base) (target label)" 182 182 break 183 183 end 184 184 book newpage SURVEY_DIFF_WARPSTACK $1 185 book setword SURVEY_DIFF_WARPSTACK $1 STACK_LABEL $2 186 book setword SURVEY_DIFF_WARPSTACK $1 DIST_GROUP $3 187 book setword SURVEY_DIFF_WARPSTACK $1 WORKDIR $4 188 book setword SURVEY_DIFF_WARPSTACK $1 TARGET_LABEL $5 185 book setword SURVEY_DIFF_WARPSTACK $1 WARP_LABEL $2 186 book setword SURVEY_DIFF_WARPSTACK $1 STACK_LABEL $3 187 book setword SURVEY_DIFF_WARPSTACK $1 DIST_GROUP $4 188 book setword SURVEY_DIFF_WARPSTACK $1 WORKDIR $5 189 book setword SURVEY_DIFF_WARPSTACK $1 TARGET_LABEL $6 189 190 book setword SURVEY_DIFF_WARPSTACK $1 STATE PENDING 190 191 end … … 697 698 periods -exec $SURVEY_EXEC 698 699 periods -timeout $SURVEY_TIMEOUT 700 ## time in UT -- want to start ~0900 HST and run until next night starts. 24h boundary so two trange needed? 701 trange 19:00:00 23:59:00 702 trange 00:00:00 05:00:00 699 703 npending 1 700 704 … … 710 714 endif 711 715 712 book getpage SURVEY_DIFF_WARPSTACK 0 -var label-key STATE NEW713 if ("$ label" == "NULL")716 book getpage SURVEY_DIFF_WARPSTACK 0 -var wsKey -key STATE NEW 717 if ("$wsKey" == "NULL") 714 718 # All labels have been done --- reset 715 719 # echo "Resetting labels" 716 720 for i 0 $N 717 book getpage SURVEY_DIFF_WARPSTACK $i -var label718 book setword SURVEY_DIFF_WARPSTACK $ labelSTATE NEW721 book getpage SURVEY_DIFF_WARPSTACK $i -var wsKey 722 book setword SURVEY_DIFF_WARPSTACK $wsKey STATE NEW 719 723 end 720 book getpage SURVEY_DIFF_WARPSTACK 0 -var label-key STATE NEW724 book getpage SURVEY_DIFF_WARPSTACK 0 -var wsKey -key STATE NEW 721 725 722 726 # Select different database … … 725 729 end 726 730 727 book setword SURVEY_DIFF_WARPSTACK $label STATE DONE 728 book getword SURVEY_DIFF_WARPSTACK $label STACK_LABEL -var stack_label 729 book getword SURVEY_DIFF_WARPSTACK $label WORKDIR -var workdir 730 book getword SURVEY_DIFF_WARPSTACK $label DIST_GROUP -var dist_group 731 book getword SURVEY_DIFF_WARPSTACK $label TARGET_LABEL -var target_label 731 book setword SURVEY_DIFF_WARPSTACK $wsKey STATE DONE 732 book getword SURVEY_DIFF_WARPSTACK $wsKey WARP_LABEL -var warp_label 733 book getword SURVEY_DIFF_WARPSTACK $wsKey STACK_LABEL -var stack_label 734 book getword SURVEY_DIFF_WARPSTACK $wsKey WORKDIR -var workdir 735 book getword SURVEY_DIFF_WARPSTACK $wsKey DIST_GROUP -var dist_group 736 book getword SURVEY_DIFF_WARPSTACK $wsKey TARGET_LABEL -var target_label 732 737 733 738 $year = `date +%Y` … … 737 742 # Do we need anything else here? 738 743 $run = difftool -definewarpstack -good_frac 0.2 739 $run = $run -warp_label $ label744 $run = $run -warp_label $warp_label 740 745 $run = $run -stack_label $stack_label 741 746 $run = $run -set_dist_group $dist_group … … 1012 1017 $run = $run -uncensored 1013 1018 end 1014 1019 if ("$stage" == "fullforce") 1020 $run = $run -uncensored 1021 end 1022 if ("$stage" == "diff") 1023 $run = $run -uncensored) 1024 end 1015 1025 # we need to handle isp/gpc1: gpc1 wants destreaked, isp wants uncensored. Perhaps the best way is by default do destreaked (the most paranoid), and if db = isp (is this the best way?) then do uncensored 1016 1026 -
branches/eam_branches/ipp-20140904/ippTools/share/Makefile.am
r37251 r37804 8 8 addtool_find_cam_id_dvo.sql \ 9 9 addtool_find_cam_id.sql \ 10 addtool_find_diff_id.sql \ 11 addtool_find_diff_id_dvo.sql \ 12 addtool_find_ff_id.sql \ 13 addtool_find_ff_id_dvo.sql \ 10 14 addtool_find_skycal_id_dvo.sql \ 11 15 addtool_find_skycal_id.sql \ … … 16 20 addtool_find_pendingexp.sql \ 17 21 addtool_find_pendingexp_cam.sql \ 22 addtool_find_pendingexp_diff.sql \ 23 addtool_find_pendingexp_ff.sql \ 18 24 addtool_find_pendingexp_skycal.sql \ 19 25 addtool_find_pendingexp_stack.sql \ … … 21 27 addtool_find_pendingmergeprocess.sql \ 22 28 addtool_find_processedexp_cam.sql \ 29 addtool_find_processedexp_diff.sql \ 30 addtool_find_processedexp_ff.sql \ 23 31 addtool_find_processedexp_skycal.sql \ 24 32 addtool_find_processedexp_stack.sql \ … … 29 37 addtool_pendingcleanuprun.sql \ 30 38 addtool_queue_cam_id.sql \ 39 addtool_queue_diff_id.sql \ 40 addtool_queue_ff_id.sql \ 31 41 addtool_queue_stack_id.sql \ 32 42 addtool_queue_sky_id_multi.sql \ … … 35 45 addtool_revertminidvodbprocessed.sql \ 36 46 addtool_revertprocessedexp_cam.sql \ 47 addtool_revertprocessedexp_diff.sql \ 48 addtool_revertprocessedexp_ff.sql \ 37 49 addtool_revertprocessedexp_skycal.sql \ 38 50 addtool_revertprocessedexp_stack.sql \ … … 471 483 laptool_revertgroup.sql \ 472 484 laptool_filtersforgroup.sql \ 485 laptool_revertsass.sql \ 473 486 vptool_find_rawexp.sql \ 474 487 vptool_pendingimfile.sql \ -
branches/eam_branches/ipp-20140904/ippTools/share/fftool_result.sql
r36633 r37804 11 11 stackRun.skycell_id, 12 12 stackRun.filter, 13 rawExp.exp_id, 14 rawExp.exp_name, 13 15 rawExp.camera 14 16 FROM fullForceRun -
branches/eam_branches/ipp-20140904/ippTools/share/laptool_exposures.sql
r31511 r37804 1 select DISTINCT V3.*, 2 diffRun.diff_id,diffRun.state as diffRun_state, 3 coalesce(CONVERT(sum(diffSkyfile.quality != 0),SIGNED),0) AS diff_bad_quality, 4 coalesce(CONVERT(count(diffSkyfile.diff_id),SIGNED),0) AS diff_component_count 5 FROM 1 -- Join the diff information 2 -- select DISTINCT V3.*, 3 -- diffRun.diff_id,diffRun.state as diffRun_state, 4 -- coalesce(CONVERT(sum(diffSkyfile.quality != 0),SIGNED),0) AS diff_bad_quality, 5 -- coalesce(CONVERT(count(diffSkyfile.diff_id),SIGNED),0) AS diff_component_count 6 -- FROM 7 select V3.*,-1 as diff_id ,"full" as diffRun_state,0 as diff_bad_quality,0 AS diff_component_count FROM 8 -- Join the warp information 6 9 ( select V2.*, 7 10 warpRun.warp_id,warpRun.state as warpRun_state, … … 10 13 warpRun.magicked 11 14 FROM 15 -- Join the camera and fake information 12 16 ( select V1.*, 13 17 camRun.cam_id,camRun.state as camRun_state, … … 15 19 coalesce(CONVERT(count(camProcessedExp.cam_id),SIGNED),0) AS cam_component_count, 16 20 fakeRun.fake_id,fakeRun.state as fakeRun_state FROM 21 -- Get all the lap, exposure, chip stage information 17 22 ( SELECT DISTINCT 18 23 lap_id,lapRun.tess_id,projection_cell,filter,lapRun.state as lapRun_state, lapRun.registered, lapRun.fault, lapRun.label, lapRun.dist_group, … … 26 31 GROUP BY lap_id,exp_id 27 32 ) AS V1 33 -- End lap/exposure/chip 28 34 LEFT JOIN camRun USING(chip_id) LEFT JOIN camProcessedExp USING(cam_id) 29 35 LEFT JOIN fakeRun USING(cam_id) 30 36 GROUP BY lap_id,exp_id 31 37 ) AS V2 38 -- End camera/fake 32 39 LEFT JOIN warpRun USING(fake_id) LEFT JOIN warpSkyfile USING(warp_id) 33 40 GROUP BY lap_id,exp_id 34 41 ) AS V3 35 LEFT JOIN 36 (SELECT DISTINCT diff_id,warp1,warp2 FROM diffInputSkyfile) AS DI ON 37 (DI.warp1 = warp_id OR DI.warp2 = warp_id) 38 LEFT JOIN diffRun USING(diff_id) 39 LEFT JOIN diffSkyfile USING(diff_id) 42 -- End warp 43 -- LEFT JOIN 44 -- (SELECT DISTINCT diff_id,warp1,warp2 FROM diffInputSkyfile) AS DI ON 45 -- (DI.warp1 = warp_id OR DI.warp2 = warp_id) 46 -- LEFT JOIN diffRun USING(diff_id) 47 -- LEFT JOIN diffSkyfile USING(diff_id) 40 48 GROUP BY lap_id,exp_id 41 49 -
branches/eam_branches/ipp-20140904/ippTools/share/pstamptool_pendingdependent.sql
r36167 r37804 2 2 pstampDependent.*, 3 3 pstampRequest.label, 4 MIN(req_id) as first_req_id, 4 5 concat( pstampDependent.outdir, '/checkdep.', dep_id, '.log') as logfile, 5 6 IFNULL(Label.priority, 10000) AS priority -
branches/eam_branches/ipp-20140904/ippTools/src/addtool.c
r35304 r37804 122 122 PXOPT_COPY_S64(config->args, where, "-sky_id", "staticskyRun.sky_id", "=="); 123 123 PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycalRun.skycal_id", "=="); 124 PXOPT_COPY_S64(config->args, where, "-diff_id", "diffRun.diff_id", "=="); 125 PXOPT_COPY_S64(config->args, where, "-ff_id", "fullForceRun.ff_id", "=="); 126 124 127 PXOPT_LOOKUP_STR(stage, config->args, "-stage", false, false); 125 128 if (strcmp(stage, "cam")== 0) { … … 146 149 PXOPT_COPY_STR(config->args, where, "-reduction", "skycalRun.reduction", "=="); 147 150 } 148 151 if (strcmp(stage, "diff")==0) { 152 pxAddLabelSearchArgs (config, where, "-label", "diffRun.label", "=="); //define using skycalRun label 153 pxAddLabelSearchArgs (config, where, "-data_group","diffRun.data_group", "=="); 154 PXOPT_COPY_STR(config->args, where, "-reduction", "diffRun.reduction", "=="); 155 } 156 if (strcmp(stage, "fullforce")==0) { 157 pxAddLabelSearchArgs (config, where, "-label", "fullForceRun.label", "=="); //define using skycalRun label 158 pxAddLabelSearchArgs (config, where, "-data_group","fullForceRun.data_group", "=="); 159 PXOPT_COPY_STR(config->args, where, "-reduction", "fullForceRun.reduction", "=="); 160 } 161 162 163 149 164 if (!psListLength(where->list)) { 150 165 psFree(where); … … 258 273 } 259 274 260 275 if (strcmp(stage,"diff") == 0) { 276 if (dvodb ) { 277 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_diff_id_dvo.sql\n%s\n", dvodb,stage); 278 // find the skycal_id of all the exposures that we want to queue up. 279 bare_query = pxDataGet("addtool_find_diff_id_dvo.sql"); 280 // user supplied dvodb 281 psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb); 282 } else { 283 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_find_diff_id.sql\n%s\n",stage); 284 // find the skycal_id of all the exposures that we want to queue up. 285 bare_query = pxDataGet("addtool_find_diff_id.sql"); 286 // inherit dvodb from skycalRun, avoid matching NULL 287 psStringAppend(&dvodb_string, "(diffRun.dvodb IS NOT NULL AND previous_dvodb = diffRun.dvodb)"); 288 // this is silly, there is no dvodb in skycalRun...? 289 } 290 } 291 292 if (strcmp(stage,"fullforce") == 0) { 293 if (dvodb ) { 294 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument found (%s) using addtool_find_ff_id_dvo.sql\n%s\n", dvodb,stage); 295 // find the skycal_id of all the exposures that we want to queue up. 296 bare_query = pxDataGet("addtool_find_ff_id_dvo.sql"); 297 // user supplied dvodb 298 psStringAppend(&dvodb_string, "addRun.dvodb = '%s'", dvodb); 299 } else { 300 psTrace("addtool.c", PS_LOG_INFO, "dvodb argument not found using addtool_ff_id.sql\n%s\n",stage); 301 // find the skycal_id of all the exposures that we want to queue up. 302 bare_query = pxDataGet("addtool_find_ff_id.sql"); 303 // inherit dvodb from skycalRun, avoid matching NULL 304 psStringAppend(&dvodb_string, "(fullForceRun.dvodb IS NOT NULL AND previous_dvodb = fullForceRun.dvodb)"); 305 // this is silly, there is no dvodb in skycalRun...? 306 } 307 } 261 308 262 309 … … 324 371 psStringAppend(&query, " GROUP BY skycal_id, sky_id, stack_id "); //this needs checking, but I think it shoul be fine? it groups by lots of stuff (including stack - we only want one of each stack in there 325 372 } 373 //needs to be checked HAF xxx 374 if (strcmp(stage,"diff") == 0) { 375 psStringAppend(&query, " GROUP BY diff_id, diff_skyfile_id "); //this needs checking, but I think it shoul be fine? it groups by lots of stuff (including stack - we only want one of each stack in there 376 } 377 //needs to be checked HAF xxx 378 if (strcmp(stage,"fullforce") == 0) { 379 psStringAppend(&query, " GROUP BY ff_id, warp_id "); //this needs checking, but I think it shoul be fine? it groups by lots of stuff (including stack - we only want one of each stack in there 380 } 381 382 383 326 384 327 385 psTrace("addtool.c", PS_LOG_INFO,"query: \n\n%s\n\n",query); … … 476 534 } 477 535 536 if (strcmp(stage,"diff") == 0) { 537 538 for (long i = 0; i < psArrayLength(output); i++) { 539 psMetadata *md = output->data[i]; 540 541 diffRunRow *row = diffRunObjectFromMetadata(md); 542 543 if (!row) { 544 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into diffRun"); 545 psFree(output); 546 return false; 547 } 548 549 if (!dvodb) { // there's no skycalRun.dvodb 550 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined dvodb: label: %s, diff_id %" PRId64, row->label, row->diff_id); 551 psFree(output); 552 return false; 553 } 554 if (!workdir && !row->workdir) { 555 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined workdir: label: %s, diff_id %" PRId64, row->label, row->diff_id); 556 psFree(output); 557 return false; 558 } 559 560 psFree(row); 561 } 562 } 563 564 if (strcmp(stage,"fullforce") == 0) { 565 for (long i = 0; i < psArrayLength(output); i++) { 566 psMetadata *md = output->data[i]; 567 568 fullForceRunRow *row = fullForceRunObjectFromMetadata(md); 569 570 if (!row) { 571 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into fullforceRun"); 572 psFree(output); 573 return false; 574 } 575 576 if (!dvodb) { // there's no skycalRun.dvodb 577 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined dvodb: label: %s, ff_id %" PRId64, row->label, row->ff_id); 578 psFree(output); 579 return false; 580 } 581 if (!workdir && !row->workdir) { 582 psError(PS_ERR_UNKNOWN, false, "cannot queue addstar run without a defined workdir: label: %s, ff_id %" PRId64, row->label, row->ff_id); 583 psFree(output); 584 return false; 585 } 586 587 psFree(row); 588 } 589 } 478 590 479 591 … … 672 784 } 673 785 786 if (strcmp(stage,"diff") == 0) { 787 788 for (long i = 0; i < psArrayLength(output); i++) { 789 psMetadata *md = output->data[i]; 790 psS64 stage_id =0; 791 // psS64 stage_extra1 = 0; 792 diffRunRow *row = diffRunObjectFromMetadata(md); 793 stage_id = row->diff_id; 794 bool status = false; 795 psS32 stage_extra1 = psMetadataLookupS32(&status, md, "diff_skyfile_id"); 796 if (!status) { 797 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item diff_skyfile_id"); 798 return false; 799 } 800 801 802 if (!row) { 803 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into skycalRun"); 804 psFree(output); 805 return false; 806 } 807 808 // queue the exp 809 if (!pxaddQueueByCamID(config, 810 stage, 811 stage_id, 812 stage_extra1, 813 workdir ? workdir : row->workdir, 814 reduction ? reduction : row->reduction, 815 label ? label : row->label, 816 data_group ? data_group : (row->data_group ? row->data_group : (label ? label : row->label)), 817 dvodb ? dvodb : NULL, 818 note ? note : NULL, 819 image_only, 820 minidvodb, 821 minidvodb_group, 822 minidvodb_name 823 )) { 824 if (!psDBRollback(config->dbh)) { 825 psError(PS_ERR_UNKNOWN, false, "database error sfg"); 826 } 827 psError(PS_ERR_UNKNOWN, false, 828 "failed to trying to queue stage %s %" PRId64,stage, stage_id); 829 psFree(row); 830 psFree(output); 831 return false; 832 } 833 psFree(row); 834 } 835 } 836 837 if (strcmp(stage,"fullforce") == 0) { 838 for (long i = 0; i < psArrayLength(output); i++) { 839 psMetadata *md = output->data[i]; 840 psS64 stage_id =0; 841 842 fullForceRunRow *row = fullForceRunObjectFromMetadata(md); 843 stage_id = row->ff_id; 844 bool status = false; 845 psS32 stage_extra1 = psMetadataLookupS32(&status, md, "warp_id"); 846 if (!status) { 847 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item warp_id"); 848 return false; 849 } 850 851 if (!row) { 852 psError(PS_ERR_UNKNOWN, false, "failed to convert metadata into skycalRun"); 853 psFree(output); 854 return false; 855 } 856 857 // queue the exp 858 if (!pxaddQueueByCamID(config, 859 stage, 860 stage_id, 861 stage_extra1, 862 workdir ? workdir : row->workdir, 863 reduction ? reduction : row->reduction, 864 label ? label : row->label, 865 data_group ? data_group : (row->data_group ? row->data_group : (label ? label : row->label)), 866 dvodb ? dvodb : NULL, 867 note ? note : NULL, 868 image_only, 869 minidvodb, 870 minidvodb_group, 871 minidvodb_name 872 )) { 873 if (!psDBRollback(config->dbh)) { 874 psError(PS_ERR_UNKNOWN, false, "database error sfg"); 875 } 876 psError(PS_ERR_UNKNOWN, false, 877 "failed to trying to queue stage %s %" PRId64,stage, stage_id); 878 psFree(row); 879 psFree(output); 880 return false; 881 } 882 psFree(row); 883 } 884 } 885 886 887 674 888 675 889 … … 695 909 PXOPT_COPY_S64(config->args, where, "-sky_id", "staticskyRun.sky_id", "=="); 696 910 PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycalRun.skycal_id", "=="); 911 PXOPT_COPY_S64(config->args, where, "-diff_id", "diffRun.diff_id", "=="); 912 PXOPT_COPY_S64(config->args, where, "-ff_id", "fullForceRun.ff_id", "=="); 913 697 914 PXOPT_LOOKUP_STR(stage, config->args, "-stage", false, false); 698 915 pxcamGetSearchArgs (config, where); // most search arguments based on camera … … 709 926 psString query = NULL; 710 927 if (strcmp(stage, "cam")==0) { 711 query = psStringCopy("UPDATE addRun JOIN camRun on cam_id = stage_idJOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)");928 query = psStringCopy("UPDATE addRun JOIN camRun on (cam_id = stage_id and stage = 'cam') JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id)"); 712 929 } 713 930 if (strcmp(stage, "stack")==0) { 714 query = psStringCopy("UPDATE addRun JOIN stackRun on stack_id = stage_id");931 query = psStringCopy("UPDATE addRun JOIN stackRun on (stack_id = stage_id and stage = 'stack')"); 715 932 } 716 933 if (strcmp(stage, "staticsky")==0) { 717 query = psStringCopy("UPDATE addRun JOIN staticskyRun on sky_id = stage_id");934 query = psStringCopy("UPDATE addRun JOIN staticskyRun on (sky_id = stage_id and stage = 'staticsky')"); 718 935 } 719 936 if (strcmp(stage, "skycal")==0) { 720 query = psStringCopy("UPDATE addRun JOIN skycalRun on skycal_id = stage_id"); 937 query = psStringCopy("UPDATE addRun JOIN skycalRun on (skycal_id = stage_id and stage = 'skycal')"); 938 } 939 if (strcmp(stage, "diff")==0) { 940 query = psStringCopy("UPDATE addRun JOIN diffInputSkyfile on (diff_id = stage_id and diff_skyfile_id = stage_extra1 and stage = 'diff') JOIN diffSkyfile on (diff_id, skycell_id) JOIN diffRun using (diff_id)"); 941 } 942 if (strcmp(stage, "fullforce")==0) { 943 query = psStringCopy("UPDATE addRun JOIN fullForceResult on (ff_id = stage_id and warp_id = stage_extra1 and stage = 'fullforce') JOIN fullForceRun on (ff_id)"); 721 944 } 722 945 … … 743 966 PXOPT_COPY_S64(config->args, where, "-sky_id", "staticskyRun.sky_id", "=="); 744 967 PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycalRun.skycal_id", "=="); 968 PXOPT_COPY_S64(config->args, where, "-ff_id", "fullForceRun.ff_id", "=="); 969 PXOPT_COPY_S64(config->args, where, "-diff_id", "diffRun.diff_id", "=="); 745 970 PXOPT_LOOKUP_STR(stage, config->args, "-stage", false, false); 746 971 pxcamGetSearchArgs (config, where); … … 764 989 query = pxDataGet("addtool_find_pendingexp_skycal.sql"); 765 990 } 991 if (strcmp(stage, "diff")==0) { 992 query = pxDataGet("addtool_find_pendingexp_diff.sql"); 993 } 994 if (strcmp(stage, "fullforce")==0) { 995 query = pxDataGet("addtool_find_pendingexp_ff.sql"); 996 } 766 997 767 998 … … 790 1021 psStringAppend(&query, " GROUP BY %s", "sky_id, stage_extra1"); 791 1022 } 1023 if (strcmp(stage, "diff") == 0) { 1024 //this group by is needed to join against all the warps (to get camera) 1025 psStringAppend(&query, " GROUP BY %s", "diff_id, stage_extra1"); 1026 } 1027 if (strcmp(stage, "fullforce") == 0) { 1028 //this group by is needed to join against all the warps (to get camera) 1029 psStringAppend(&query, " GROUP BY %s", "ff_id, stage_extra1"); 1030 } 1031 1032 1033 792 1034 // treat limit == 0 as "no limit" 793 1035 if (limit) { … … 994 1236 } else if (strcmp (stage,"skycal") == 0) { 995 1237 query = pxDataGet("addtool_find_processedexp_skycal.sql"); 1238 } else if (strcmp (stage,"diff") == 0) { 1239 query = pxDataGet("addtool_find_processedexp_diff.sql"); 1240 } else if (strcmp (stage,"fullforce") == 0) { 1241 query = pxDataGet("addtool_find_processedexp_ff.sql"); 1242 996 1243 } else { 997 1244 psFree(where); … … 1112 1359 if (strcmp(stage, "skycal") == 0) { 1113 1360 query = pxDataGet("addtool_revertprocessedexp_skycal.sql"); 1361 } 1362 if (strcmp(stage, "diff") == 0) { 1363 query = pxDataGet("addtool_revertprocessedexp_diff.sql"); 1364 } 1365 if (strcmp(stage, "fullforce") == 0) { 1366 query = pxDataGet("addtool_revertprocessedexp_ff.sql"); 1114 1367 } 1115 1368 -
branches/eam_branches/ipp-20140904/ippTools/src/addtoolConfig.c
r35228 r37804 55 55 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-skycal_id", 0, "search by skycal_id", 0); 56 56 pxcamSetSearchArgs(definebyqueryArgs); 57 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff_id", 0); 58 psMetadataAddS64(definebyqueryArgs, PS_LIST_TAIL, "-ff_id", 0, "search by ff_id", 0); 57 59 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by camRun label", NULL); 58 60 psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by camRun data_group", NULL); … … 83 85 psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-sky_id", 0, "search by sky_id", 0); 84 86 psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-skycal_id", 0, "search by skycal_id", 0); 87 psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff_id",0); 88 psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-ff_id", 0, "search by _ff_id",0); 85 89 pxcamSetSearchArgs(updaterunArgs); 86 90 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label", 0, "search by addRun label", NULL); … … 101 105 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-add_id", 0, "search by add_id", 0); 102 106 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-cam_id", 0, "search by cam_id", 0); 103 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-stack_id", 0, "search by stack_id", 0); 104 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-sky_id", 0, "search by sky_id", 0); 105 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-skycal_id", 0, "search by skycal_id", 0); 107 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-stack_id", 0, "search by stack_id", 0); 108 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-sky_id", 0, "search by sky_id", 0); 109 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-skycal_id", 0, "search by skycal_id", 0); 110 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff_id",0); 111 psMetadataAddS64(pendingexpArgs, PS_LIST_TAIL, "-ff_id", 0, "search by ff_id",0); 106 112 pxcamSetSearchArgs(pendingexpArgs); 107 113 psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by addRun label", NULL); … … 236 242 psMetadata *modes = psMetadataAlloc(); 237 243 238 PXOPT_ADD_MODE("-definebyquery", "create runs from cam stage", ADDTOOL_MODE_DEFINEBYQUERY, definebyqueryArgs);244 PXOPT_ADD_MODE("-definebyquery", "create runs from cam/skycal/forcedwarp/diff stage", ADDTOOL_MODE_DEFINEBYQUERY, definebyqueryArgs); 239 245 PXOPT_ADD_MODE("-updaterun", "change add run properties", ADDTOOL_MODE_UPDATERUN, updaterunArgs); 240 246 PXOPT_ADD_MODE("-pendingexp", "show pending exps", ADDTOOL_MODE_PENDINGEXP, pendingexpArgs); -
branches/eam_branches/ipp-20140904/ippTools/src/chiptool.c
r36431 r37804 1454 1454 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipRun.chip_id", "=="); 1455 1455 PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "=="); 1456 pxAddLabelSearchArgs (config, where, "-label", " label", "==");1457 PXOPT_COPY_STR(config->args, where, "-state", " state", "==");1456 pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "=="); 1457 PXOPT_COPY_STR(config->args, where, "-state", "chipRun.state", "=="); 1458 1458 1459 1459 psString query = pxDataGet("chiptool_run.sql"); -
branches/eam_branches/ipp-20140904/ippTools/src/fftool.c
r36665 r37804 859 859 PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "LIKE"); 860 860 PXOPT_COPY_STR(config->args, where, "-filter", "stackRun.filter", "LIKE"); 861 PXOPT_COPY_S16(config->args, where, "-fault", " staticskyResult.fault", "==");861 PXOPT_COPY_S16(config->args, where, "-fault", "fullForceSummary.fault", "=="); 862 862 pxskycellAddWhere(config, where); 863 863 -
branches/eam_branches/ipp-20140904/ippTools/src/laptool.c
r36555 r37804 25 25 static bool pendingrunMode(pxConfig *config); 26 26 static bool updaterunMode(pxConfig *config); 27 static bool revertsassMode(pxConfig *config); 27 28 28 29 // Exposure level … … 69 70 MODECASE(LAPTOOL_MODE_PENDINGRUN, pendingrunMode); 70 71 MODECASE(LAPTOOL_MODE_UPDATERUN, updaterunMode); 71 72 MODECASE(LAPTOOL_MODE_REVERTSASS, revertsassMode); 73 72 74 MODECASE(LAPTOOL_MODE_PENDINGEXP, pendingexpMode); 73 75 MODECASE(LAPTOOL_MODE_EXPOSURES, exposuresMode); … … 695 697 } 696 698 699 static bool revertsassMode(pxConfig *config) 700 { 701 PS_ASSERT_PTR_NON_NULL(config, false); 702 703 psMetadata *where = psMetadataAlloc(); 704 PXOPT_COPY_S64(config->args, where, "-lap_id", "lap_id", "=="); 705 PXOPT_COPY_S64(config->args, where, "-sass_id", "final_sass_id", "=="); 706 if (!psListLength(where->list)) { 707 psFree(where); 708 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required"); 709 return false; 710 } 711 712 psString query = pxDataGet("laptool_revertsass.sql"); 713 if (!query) { 714 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 715 return(false); 716 } 717 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 718 psStringAppend(&query, "\n WHERE %s", whereClause); 719 psFree(whereClause); 720 721 if (!psDBTransaction(config->dbh)) { 722 psError(PS_ERR_UNKNOWN, false, "database error"); 723 return false; 724 } 725 726 if (!p_psDBRunQuery(config->dbh, query)) { 727 psError(PS_ERR_UNKNOWN, false, "database error"); 728 psFree(query); 729 return false; 730 } 731 psFree(query); 732 733 long numUpdated = psDBAffectedRows(config->dbh); 734 if (numUpdated != 1) { 735 psError(PS_ERR_UNKNOWN, false, "should have updated only one row. updated %ld", numUpdated); 736 return false; 737 } 738 739 if (!psDBCommit(config->dbh)) { 740 psError(PS_ERR_UNKNOWN, false, "database error"); 741 return false; 742 } 743 744 return true; 745 } 697 746 // Exposure level 698 747 -
branches/eam_branches/ipp-20140904/ippTools/src/laptool.h
r35566 r37804 19 19 LAPTOOL_MODE_EXPOSURES, 20 20 LAPTOOL_MODE_STACKS, 21 LAPTOOL_MODE_REVERTSASS, 21 22 LAPTOOL_MODE_UPDATEEXP, 22 23 LAPTOOL_MODE_DIFFCHECK, -
branches/eam_branches/ipp-20140904/ippTools/src/laptoolConfig.c
r35568 r37804 117 117 ADD_OPT(S64, updaterunArgs, "-set_final_sass_id", "set final stack sass_id", 0); 118 118 119 // -revertsass 120 psMetadata *revertsassArgs = psMetadataAlloc(); 121 ADD_OPT(S64, revertsassArgs, "-lap_id", "search by lap run id", 0); 122 ADD_OPT(S64, revertsassArgs, "-sass_id", "sass id that is being removed", 0); 123 119 124 // -pendingexp 120 125 psMetadata *pendingexpArgs = psMetadataAlloc(); … … 136 141 ADD_OPT(Bool,stacksArgs, "-simple", "use the simple output format", false); 137 142 ADD_OPT(U64, stacksArgs, "-limit", "limit result set to N items", 0); 138 143 139 144 // -updateexp 140 145 psMetadata *updateexpArgs = psMetadataAlloc(); … … 227 232 PXOPT_ADD_MODE("-listrun", "", LAPTOOL_MODE_PENDINGRUN, listrunArgs); 228 233 PXOPT_ADD_MODE("-updaterun", "", LAPTOOL_MODE_UPDATERUN, updaterunArgs); 234 PXOPT_ADD_MODE("-revertsass", "mode to remove the sass_id", LAPTOOL_MODE_REVERTSASS, revertsassArgs); 229 235 PXOPT_ADD_MODE("-pendingexp", "", LAPTOOL_MODE_PENDINGEXP, pendingexpArgs); 230 236 PXOPT_ADD_MODE("-exposures", "", LAPTOOL_MODE_EXPOSURES, exposuresArgs); -
branches/eam_branches/ipp-20140904/ippTools/src/pxadd.c
r34265 r37804 164 164 psMemSetPersistent(query, true); 165 165 } 166 else if (strcmp(stage,"diff") == 0) { 167 query = pxDataGet("addtool_queue_diff_id.sql"); 168 psMemSetPersistent(query, true); 169 } 170 else if (strcmp(stage,"fullforce") == 0) { 171 query = pxDataGet("addtool_queue_ff_id.sql"); 172 psMemSetPersistent(query, true); 173 } 174 175 166 176 else 167 177 { -
branches/eam_branches/ipp-20140904/ippTools/src/stacktool.c
r37104 r37804 41 41 static bool sumskyfileMode(pxConfig *config); 42 42 static bool sassskyfileMode(pxConfig *config); 43 static bool updatesassMode(pxConfig *config); 43 44 static bool revertsumskyfileMode(pxConfig *config); 44 45 static bool tosummaryMode(pxConfig *config); … … 82 83 MODECASE(STACKTOOL_MODE_ADDSUMSKYFILE, addsumskyfileMode); 83 84 MODECASE(STACKTOOL_MODE_SUMSKYFILE, sumskyfileMode); 84 MODECASE(STACKTOOL_MODE_SASSSKYFILE, sassskyfileMode); 85 MODECASE(STACKTOOL_MODE_SASSSKYFILE, sassskyfileMode); 86 MODECASE(STACKTOOL_MODE_UPDATESASS, updatesassMode); 85 87 MODECASE(STACKTOOL_MODE_REVERTSUMSKYFILE, revertsumskyfileMode); 86 88 MODECASE(STACKTOOL_MODE_TOSUMMARY, tosummaryMode); … … 756 758 PXOPT_COPY_STR(config->args, where, "-data_group", "stackRun.data_group", "=="); 757 759 PXOPT_COPY_STR(config->args, where, "-state", "stackRun.state", "=="); 758 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 760 759 761 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 762 PXOPT_LOOKUP_S64(sass_id, config->args, "-sass_id", false, false); 763 764 if (sass_id) { 765 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 766 } 767 760 768 if (!psListLength(where->list)) { 761 769 psFree(where); … … 771 779 PXOPT_COPY_S16(config->args, where, "-fault", "stackSumSkyfile.fault", "=="); 772 780 } 773 781 if (sass_id) { 782 psStringAppend(&query, " JOIN stackAssociationMap USING(stack_id)"); 783 } 784 774 785 // pxUpdateRun gets parameters from config->args and updates 775 786 bool result = pxUpdateRun(config, where, &query, "stackRun", "stack_id", "stackSumSkyfile", true, false); … … 1295 1306 PXOPT_COPY_STR(config->args, where, "-data_group", "stackAssociation.data_group", "LIKE"); 1296 1307 1297 // The following three selectors are incompatible with the sql so omit them1298 // PXOPT_COPY_S64(config->args, where, "-warp_id", "warpRun.warp_id", "==");1299 // PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "==");1300 // PXOPT_COPY_STR(config->args, where, "-exp_name", "rawExp.exp_name", "==");1301 1302 1308 PXOPT_LOOKUP_BOOL(all, config->args, "-all", false); 1303 1309 … … 1369 1375 } 1370 1376 1377 static bool updatesassMode(pxConfig *config) 1378 { 1379 PS_ASSERT_PTR_NON_NULL(config, false); 1380 1381 psMetadata *where = psMetadataAlloc(); 1382 PXOPT_COPY_S64(config->args, where, "-sass_id", "sass_id", "=="); 1383 PXOPT_COPY_STR(config->args, where, "-data_group", "data_group", "=="); 1384 PXOPT_COPY_STR(config->args, where, "-projection_cell", "projection_cell", "=="); 1385 PXOPT_COPY_STR(config->args, where, "-tess_id", "tess_id", "=="); 1386 PXOPT_COPY_STR(config->args, where, "-filter", "filter", "=="); 1387 if (!psListLength(where->list)) { 1388 psFree(where); 1389 psError(PXTOOLS_ERR_CONFIG, false, "search parameters are required"); 1390 return false; 1391 } 1392 1393 psMetadata *values = psMetadataAlloc(); 1394 PXOPT_COPY_STR(config->args, values, "-set_data_group", "data_group", "=="); 1395 if (!psListLength(values->list)) { 1396 psFree(values); 1397 psError(PXTOOLS_ERR_CONFIG, false, "data_group to assign not found"); 1398 return false; 1399 } 1400 1401 if (!psDBTransaction(config->dbh)) { 1402 psError(PS_ERR_UNKNOWN, false, "database error"); 1403 return false; 1404 } 1405 1406 long rows = psDBUpdateRows(config->dbh, "stackAssociation", where, values); 1407 psFree(values); 1408 psFree(where); 1409 1410 if (rows != 1) { 1411 psError(PS_ERR_UNKNOWN, false, "should have updated only one row. updated %ld", rows); 1412 return false; 1413 } 1414 1415 if (!psDBCommit(config->dbh)) { 1416 psError(PS_ERR_UNKNOWN, false, "database error"); 1417 return false; 1418 } 1419 1420 return true; 1421 } 1371 1422 1372 1423 static bool revertsumskyfileMode(pxConfig *config) -
branches/eam_branches/ipp-20140904/ippTools/src/stacktool.h
r36361 r37804 35 35 STACKTOOL_MODE_SUMSKYFILE, 36 36 STACKTOOL_MODE_SASSSKYFILE, 37 STACKTOOL_MODE_UPDATESASS, 37 38 STACKTOOL_MODE_REVERTSUMSKYFILE, 38 39 STACKTOOL_MODE_TOSUMMARY, -
branches/eam_branches/ipp-20140904/ippTools/src/stacktoolConfig.c
r37104 r37804 238 238 psMetadataAddBool(sassskyfileArgs, PS_LIST_TAIL, "-all", 0, "enable search without arguments", false); 239 239 240 // -updatesass 241 psMetadata *updatesassArgs = psMetadataAlloc(); 242 psMetadataAddS64(updatesassArgs, PS_LIST_TAIL, "-sass_id", 0, "search by stack association id", 0); 243 psMetadataAddStr(updatesassArgs, PS_LIST_TAIL, "-data_group", 0, "search by data group", 0); 244 psMetadataAddStr(updatesassArgs, PS_LIST_TAIL, "-projection_cell", 0, "search by projection cell", 0); 245 psMetadataAddStr(updatesassArgs, PS_LIST_TAIL, "-tess_id", 0, "search by tess_id", 0); 246 psMetadataAddStr(updatesassArgs, PS_LIST_TAIL, "-filter", 0, "search by filter", 0); 247 248 psMetadataAddStr(updatesassArgs, PS_LIST_TAIL, "-set_data_group", 0, "data_group to assign", 0); 249 240 250 // -revertsumskyfile 241 251 psMetadata *revertsumskyfileArgs= psMetadataAlloc(); … … 348 358 PXOPT_ADD_MODE("-donecleanup", "show runs that have been cleaned", STACKTOOL_MODE_DONECLEANUP, donecleanupArgs); 349 359 350 PXOPT_ADD_MODE("-sassskyfile", "list results of stackAssociation", STACKTOOL_MODE_SASSSKYFILE, sassskyfileArgs); 360 PXOPT_ADD_MODE("-sassskyfile", "list results of stackAssociation", STACKTOOL_MODE_SASSSKYFILE, sassskyfileArgs); 361 PXOPT_ADD_MODE("-updatesass", "update data_group of stackAssociation", STACKTOOL_MODE_UPDATESASS, updatesassArgs); 351 362 PXOPT_ADD_MODE("-tosummary", "show runs that can be summarized", STACKTOOL_MODE_TOSUMMARY, tosummaryArgs); 352 363 PXOPT_ADD_MODE("-summary", "show runs that have been summarized", STACKTOOL_MODE_SUMMARY, summaryArgs); -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageAddNoise.c
r31155 r37804 18 18 return true; 19 19 } 20 21 // psTimerStart("add.noise"); 20 22 21 23 // grizy variances to add to turn MD exposure -> 3pi, calculated from the DRM … … 96 98 psFree(stats); 97 99 100 // psLogMsg ("ppImage", 5, "add noise: %f sec\n", psTimerMark ("add.noise")); 101 98 102 return true; 99 103 } -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageAuxiliaryMask.c
r36169 r37804 67 67 return true; 68 68 } 69 70 // psTimerStart("aux.mask"); 69 71 70 72 bool status; … … 208 210 } 209 211 212 // psLogMsg ("ppImage", 5, "auxiliary mask: %f sec\n", psTimerMark ("aux.mask")); 213 210 214 return true; 211 215 } -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageCheckCTE.c
r24117 r37804 17 17 return true; 18 18 } 19 20 // psTimerStart("check.cte"); 19 21 20 22 // add recipe options supplied on command line … … 106 108 psFree (statsDefaults); 107 109 110 // psLogMsg ("ppImage", 5, "check CTE: %f sec\n", psTimerMark ("check.cte")); 111 108 112 return true; 109 113 } -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageCheckNoise.c
r33667 r37804 17 17 return true; 18 18 } 19 20 // psTimerStart("check.noise"); 19 21 20 22 // add recipe options supplied on command line … … 124 126 psFree (statsDefaults); 125 127 128 // psLogMsg ("ppImage", 5, "check noise: %f sec\n", psTimerMark ("check.noise")); 129 126 130 return true; 127 131 } -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageDetrendFringe.c
r26895 r37804 327 327 pmCell *cell = NULL; 328 328 329 // psTimerStart("apply.fringe"); 330 329 331 assert (options->doFringe); // do not call if not needed 330 332 assert (inputView->chip != -1); … … 386 388 } 387 389 390 // psLogMsg ("ppImage", 5, "apply fringe: %f sec\n", psTimerMark ("apply.fringe")); 391 388 392 psFree (view); 389 393 return true; -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageDetrendPattern.c
r33243 r37804 35 35 // chip. 36 36 37 // psTimerStart("apply.pattern"); 37 38 if (options->doPatternRow) { 39 38 40 bool status; 39 41 pmHDU *hdu = pmHDUFromChip(chip); … … 193 195 194 196 pattern_done: 197 198 // psLogMsg ("ppImage", 5, "apply pattern: %f sec\n", psTimerMark ("apply.pattern")); 199 195 200 return(true); 196 201 } -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageDetrendReadout.c
r35917 r37804 7 7 bool ppImageDetrendReadout(pmConfig *config, ppImageOptions *options, pmFPAview *view) 8 8 { 9 // psTimerStart("detrend.readout"); 10 9 11 // construct a view for the detrend images (which have only one readout) 10 12 pmFPAview *detview = pmFPAviewAlloc(0); … … 35 37 } 36 38 } 39 // psLogMsg ("ppImage", 6, "check gain: %f sec\n", psTimerMark ("detrend.readout")); 37 40 38 41 // Check to see if we're in a chip that contains video … … 56 59 } 57 60 done_video_check: 61 // psLogMsg ("ppImage", 6, "check video: %f sec\n", psTimerMark ("detrend.readout")); 58 62 59 63 // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine. … … 66 70 return false; 67 71 } 72 // psLogMsg ("ppImage", 6, "generate mask: %f sec\n", psTimerMark ("detrend.readout")); 68 73 } 69 74 // apply the externally supplied mask to the input->mask pixels … … 77 82 } 78 83 pmMaskBadPixels(input, mask, options->maskValue); 84 // psLogMsg ("ppImage", 6, "apply mask: %f sec\n", psTimerMark ("detrend.readout")); 79 85 } 80 86 … … 83 89 // extern bool ppImageBurntoolApply(pmConfig *, ppImageOptions *, pmFPAview *, pmReadout *); 84 90 ppImageBurntoolApply(config, options, view, input); 91 // psLogMsg ("ppImage", 6, "apply burntool: %f sec\n", psTimerMark ("detrend.readout")); 85 92 } 86 93 … … 93 100 ppImageBurntoolMask(config,options,view,input); 94 101 } 102 // psLogMsg ("ppImage", 6, "apply burntool mask: %f sec\n", psTimerMark ("detrend.readout")); 95 103 } 96 104 … … 102 110 return false; 103 111 } 112 // psLogMsg ("ppImage", 6, "subtract overscan: %f sec\n", psTimerMark ("detrend.readout")); 104 113 } 105 114 … … 111 120 return(false); 112 121 } 122 // psLogMsg ("ppImage", 6, "nonlinear correction: %f sec\n", psTimerMark ("detrend.readout")); 113 123 } 114 124 … … 148 158 return false; 149 159 } 160 // psLogMsg ("ppImage", 6, "apply bias: %f sec\n", psTimerMark ("detrend.readout")); 150 161 } 151 162 … … 218 229 } 219 230 psFree (noiseImage); 231 // psLogMsg ("ppImage", 6, "generate variance: %f sec\n", psTimerMark ("detrend.readout")); 220 232 } 221 233 … … 226 238 return false; 227 239 } 240 // psLogMsg ("ppImage", 6, "apply dark: %f sec\n", psTimerMark ("detrend.readout")); 228 241 } 229 242 … … 235 248 return false; 236 249 } 250 // psLogMsg ("ppImage", 6, "mask remnance: %f sec\n", psTimerMark ("detrend.readout")); 237 251 } 238 252 … … 244 258 return false; 245 259 } 260 // psLogMsg ("ppImage", 6, "shutter correction: %f sec\n", psTimerMark ("detrend.readout")); 246 261 } 247 262 … … 253 268 return false; 254 269 } 270 // psLogMsg ("ppImage", 6, "apply flat: %f sec\n", psTimerMark ("detrend.readout")); 255 271 } 256 272 … … 276 292 277 293 psBinaryOp(input->image, input->image, "*", psScalarAlloc(norm, PS_TYPE_F32)); 294 // psLogMsg ("ppImage", 6, "renormalize: %f sec\n", psTimerMark ("detrend.readout")); 278 295 } 279 296 … … 324 341 325 342 psFree (classID); 343 344 // psLogMsg ("ppImage", 6, "renormalize by class: %f sec\n", psTimerMark ("detrend.readout")); 326 345 } 327 346 # endif … … 333 352 return false; 334 353 } 354 // psLogMsg ("ppImage", 6, "measure fringe: %f sec\n", psTimerMark ("detrend.readout")); 335 355 } 336 356 337 357 ppImageMemoryDump("detrend"); 338 358 359 // psLogMsg ("ppImage", 5, "detrend readout: %f sec\n", psTimerMark ("detrend.readout")); 339 360 psFree(detview); 340 361 return true; -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageMosaic.c
r28292 r37804 9 9 { 10 10 bool status; // Status of MD lookup 11 12 // psTimerStart("mosaic.chip"); 11 13 12 14 pmFPAfile *in = psMetadataLookupPtr(&status, config->files, inFile); // Input file … … 63 65 } 64 66 67 // psLogMsg ("ppImage", 5, "mosaic chip: %f sec\n", psTimerMark ("mosaic.chip")); 68 65 69 return status; 66 70 } -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageParityFlip.c
r25875 r37804 19 19 20 20 if (!options->applyParity) return true; 21 22 // psTimerStart("parity.flip"); 21 23 22 24 // find the currently selected readout … … 152 154 } 153 155 } 156 // psLogMsg ("ppImage", 5, "parity flip: %f sec\n", psTimerMark ("parity.flip")); 154 157 155 158 FIX_CONCEPT(cell->concepts, "CELL.XPARITY", S32, xParityTarget); -
branches/eam_branches/ipp-20140904/ppImage/src/ppImagePixelStats.c
r19928 r37804 10 10 { 11 11 bool mdok; // Status of MD lookup 12 13 // psTimerStart("pixel.stats"); 12 14 13 15 // loop over the cells/readouts for this chip … … 81 83 } 82 84 85 // psLogMsg ("ppImage", 5, "measure pixel stats: %f sec\n", psTimerMark ("pixel.stats")); 86 83 87 psFree (view); 84 88 return true; -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageRebinReadout.c
r20439 r37804 12 12 pmFPAfile *outFile = psMetadataLookupPtr(NULL, config->files, outName); 13 13 if (outFile == NULL) return false; 14 15 // psTimerStart("rebin.chip"); 14 16 15 17 // XXX double check that chip != -1? … … 40 42 } 41 43 44 // psLogMsg ("ppImage", 5, "rebin chip for %s: %f sec\n", outName, psTimerMark ("rebin.chip")); 45 42 46 return true; 43 47 } -
branches/eam_branches/ipp-20140904/ppImage/src/ppImageSetMaskBits.c
r25829 r37804 11 11 return false; 12 12 } 13 14 // psTimerStart("set.mask.bits"); 13 15 14 16 // at this point we know we have valid values for required entries SAT, BAD, FLAT, BLANK: … … 57 59 options->markValue); 58 60 61 // psLogMsg ("ppImage", 5, "set mask bits: %f sec\n", psTimerMark ("set.mask.bits")); 62 59 63 return true; 60 64 } -
branches/eam_branches/ipp-20140904/ppTranslate/src/ppMops.h
r34824 r37804 6 6 7 7 #define IN_EXTNAME "SkyChip.psf" // Extension name for data in input 8 #define OBSERVATORY_CODE "F51" // IAU Observatory Code8 // #define OBSERVATORY_CODE "F51" // IAU Observatory Code 9 9 #define OUT_EXTNAME "MOPS_TRANSIENT_DETECTIONS" // Extension name for data in output 10 10 #define SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_BADPSF | PM_SOURCE_MODE_SATURATED | \ … … 23 23 psS64 warp_id; // Warp stage identifier 24 24 psS64 diff_id; // Diff stage identifier 25 psString camera; // Camera name 26 psString obscode; // observatory code (derived from camera) 25 27 bool positive; // Sense of subtraction, T=positive, F=negative 26 28 float zp, zpErr; // Magnitude zero point and error … … 59 61 psVector *raExtErr, *decExtErr; // Error in sky coordinates for RA_EXT and DEC_EXT 60 62 psVector *mask; // Mask for detections 61 float platescale; //Plate scale at centroid 63 float platescale; // Plate scale at centroid 64 psString fpashutoutc; // FPA shutoutc 62 65 } ppMopsDetections; 63 66 -
branches/eam_branches/ipp-20140904/ppTranslate/src/ppMopsArguments.c
r34474 r37804 42 42 static void mopsArgumentsFree(ppMopsArguments *args) 43 43 { 44 psFree(args->camera); 45 psFree(args->obscode); 44 46 psFree(args->input); 45 47 psFree(args->exp_name); … … 63 65 args->warp_id = 0; 64 66 args->diff_id = 0; 67 args->camera = NULL; 68 args->obscode = NULL; 65 69 args->zp = NAN; 66 70 args->positive = true; … … 94 98 psMetadataAddS64(arguments, PS_LIST_TAIL, "-warp_id", 0, "Warp stage identifier", 0); 95 99 psMetadataAddS64(arguments, PS_LIST_TAIL, "-diff_id", 0, "Diff stage identifier", 0); 100 psMetadataAddStr(arguments, PS_LIST_TAIL, "-camera", 0, "Camera name", "No comment provided"); 96 101 psMetadataAddBool(arguments, PS_LIST_TAIL, "-inverse", 0, "Inverse subtraction?", false); 97 102 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp", 0, "Magnitude zero point", NAN); … … 126 131 args->warp_id = psMetadataLookupS64(NULL, arguments, "-warp_id"); 127 132 args->diff_id = psMetadataLookupS64(NULL, arguments, "-diff_id"); 133 args->camera = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-camera")); 128 134 args->positive = !psMetadataLookupBool(NULL, arguments, "-inverse"); // NOTE: negated 129 135 args->zp = psMetadataLookupF32(NULL, arguments, "-zp"); … … 137 143 args->shutoutc = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-shutoutc")); 138 144 145 if (!args->camera) { 146 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "camera name not provided."); 147 return NULL; 148 } 149 if (!strcasecmp(args->camera, "GPC1")) { 150 args->obscode = psStringCopy("F51"); 151 } 152 if (!strcasecmp(args->camera, "GPC2")) { 153 args->obscode = psStringCopy("F52"); 154 } 155 if (!args->obscode) { 156 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "unknown camera name."); 157 return NULL; 158 } 159 139 160 psTrace("ppMops.args", 1, "Done parsing command-line arguments\n"); 140 161 -
branches/eam_branches/ipp-20140904/ppTranslate/src/ppMopsDetections.c
r34824 r37804 20 20 psFree(det->decErr); 21 21 psFree(det->mask); 22 psFree(det->fpashutoutc); 22 23 return; 23 24 } … … 48 49 det->mask = NULL; 49 50 det->diffSkyfileId = 0; 51 det->fpashutoutc = NULL; 50 52 return det; 51 53 } -
branches/eam_branches/ipp-20140904/ppTranslate/src/ppMopsRead.c
r34824 r37804 105 105 det->naxis1 = psMetadataLookupS32(NULL, header, "IMNAXIS1"); // Number of columns 106 106 det->naxis2 = psMetadataLookupS32(NULL, header, "IMNAXIS2"); // Number of rows 107 det->fpashutoutc = psMemIncrRefCounter(psMetadataLookupStr(NULL, header, "FPA.SHUTOUTC")); 107 108 psFree(header); 108 109 … … 241 242 long numGood = 0; // Number of good rows 242 243 for (long row = 0; row < size; row++) { 243 psU32 flags = flagsV->data.U32[row]; // psFitsTableGetU32(NULL, table, row, "FLAGS"); 244 //psU32 flags = flagsV->data.U32[row]; // psFitsTableGetU32(NULL, table, row, "FLAGS"); 245 psU64 flags = flagsV->data.U64[row]; // table reads in as U64 244 246 if (flags & SOURCE_MASK) { 245 psTrace("ppMops.read", 10, "Discarding row %ld from input %d because of flags: % ud", row, i, flags);247 psTrace("ppMops.read", 10, "Discarding row %ld from input %d because of flags: %lud", row, i, flags); 246 248 det->mask->data.U8[row] = 0xFF; 247 249 continue; -
branches/eam_branches/ipp-20140904/ppTranslate/src/ppMopsWrite.c
r34779 r37804 89 89 psWarning("no inputs with surviving detections. output header will be incomplete"); 90 90 } 91 psMetadataAddStr(header, PS_LIST_TAIL, "OBSCODE", 0, "IAU Observatory code", OBSERVATORY_CODE);91 psMetadataAddStr(header, PS_LIST_TAIL, "OBSCODE", 0, "IAU Observatory code", args->obscode); 92 92 psMetadataAddF32(header, PS_LIST_TAIL, "MAGZP", 0, "Magnitude zero point", args->zp); 93 93 //MOPS want the name ZEROPOINT for MAGZP … … 102 102 psMetadataAddF32(header, PS_LIST_TAIL, "PLTSCALE_EXT", 0, "Plate scale at centroid", det->platescale); 103 103 psMetadataAddF32(header, PS_LIST_TAIL, "PLTSCALE", 0, "Plate scale at centroid", det->platescale); 104 psMetadataAddStr(header, PS_LIST_TAIL, "FPA.SHUTOUTC", 0, "Time of exposure", det->fpashutoutc); 104 105 105 106 //field in header that tells about the CMF version -
branches/eam_branches/ipp-20140904/psLib/src/imageops/psImageMapFit.c
r34153 r37804 18 18 19 19 #include <stdio.h> 20 #include <stdlib.h> 20 21 #include "psError.h" 21 22 #include "psAbort.h" … … 35 36 #include "psImageStructManip.h" 36 37 #include "psImageMap.h" 38 #include "psSparse.h" 37 39 // #include "psImagePixelInterpolate.h" 38 40 // #include "psImageUnbin.h" … … 118 120 psImageInit (A, 0.0); 119 121 psVectorInit (B, 0.0); 120 122 121 123 // we are looping over the Nx,Ny image map elements; 122 124 // the matrix equation contains Nx*Ny rows and columns … … 262 264 int I = n + Nx * m; 263 265 B->data.F32[I] = fi_rx_ry + fi_rx_py + fi_px_ry + fi_px_py; 264 266 265 267 // insert these values into their corresponding locations in A, B 266 268 // float Sum = 0.0; … … 273 275 int J = (n + jn) + Nx * (m + jm); 274 276 A->data.F32[J][I] = sA[jn][jm]; 277 275 278 // fprintf (stderr, "A %d %d (%d %d : %d %d): %f\n", I, J, n, m, n + jn, m + jm, sA[jn][jm]); 276 279 // Sum += sA[jn][jm]; … … 320 323 return true; 321 324 } 322 325 323 326 // set bad values to NaN 324 327 for (int i = 0; i < Nx*Ny; i++) { … … 341 344 psFree (B); 342 345 psFree (Empty); 343 344 346 *pGoodFit = true; 345 347 return true; … … 402 404 psS32 Nkeep = 0; 403 405 if (!psImageMapFit(pGoodFit, map, mask, maskValue, x, y, f, df)) { 406 psError(PS_ERR_UNKNOWN, false, "Could not fit image map.\n"); 407 psFree(resid); 408 if (!inMask) psFree (mask); 409 return false; 410 } 411 if (!*pGoodFit) { 412 psWarning ("bad fit to image map, try something else"); 413 psFree(resid); 414 if (!inMask) psFree (mask); 415 return true; 416 } 417 418 psVector *fit = psImageMapEvalVector(map, mask, maskValue, x, y); 419 if (fit == NULL) { 420 psError(PS_ERR_UNKNOWN, false, "Failure in psImageMapEvalVector().\n"); 421 psFree(resid); 422 if (!inMask) psFree (mask); 423 return false; 424 } 425 for (int i = 0 ; i < f->n ; i++) { 426 resid->data.F32[i] = (f->data.F32[i] - fit->data.F32[i]); 427 } 428 429 if (!psVectorStats(stats, resid, NULL, mask, maskValue)) { 430 psError(PS_ERR_UNKNOWN, false, "Failure to compute statistics on the resid vector.\n"); 431 psFree(resid); 432 psFree(fit); 433 if (!inMask) psFree (mask); 434 return false; 435 } 436 437 double meanValue = psStatsGetValue (stats, meanOption); 438 double stdevValue = psStatsGetValue (stats, stdevOption); 439 440 psTrace("psLib.imageops", 5, "Mean is %f\n", meanValue); 441 psTrace("psLib.imageops", 5, "Stdev is %f\n", stdevValue); 442 psF32 minClipValue = -minClipSigma*stdevValue; 443 psF32 maxClipValue = +maxClipSigma*stdevValue; 444 445 // set mask if pts are not valid 446 // we are masking out any point which is out of range 447 // recovery is not allowed with this scheme 448 for (psS32 i = 0; i < resid->n; i++) { 449 // XXX this prevents recovery of previously masked values 450 if (mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & maskValue) { 451 continue; 452 } 453 454 if ((resid->data.F32[i] - meanValue > maxClipValue) || (resid->data.F32[i] - meanValue < minClipValue)) { 455 psTrace("psLib.imageops", 6, "Masking element %d : %f vs %f : resid is %f\n", i, f->data.F32[i], fit->data.F32[i], resid->data.F32[i]); 456 mask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= 0x01; 457 continue; 458 } 459 Nkeep++; 460 } 461 462 // We should probably exit this loop if no new elements were masked since the fit won't 463 // change. 464 psTrace("psLib.imageops", 6, "keeping %d of %ld pts for fit\n", Nkeep, x->n); 465 stats->clippedNvalues = Nkeep; 466 psFree(fit); 467 } 468 469 // Free local temporary variables 470 psFree(resid); 471 if (!inMask) psFree (mask); 472 *pGoodFit = true; // XXX probably don't need to set this (set by psImageMapFit) 473 return true; 474 } 475 476 // CZW: 2014-10-09 477 // Sparse versions of MapFit and MapFitClip that assume the matrices are not filled. 478 bool psImageMapFitSparse(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue, 479 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 480 { 481 // XXX Add Asserts 482 483 *pGoodFit = false; 484 485 // dimensions of the output map image 486 int Nx = map->binning->nXruff; 487 int Ny = map->binning->nYruff; 488 489 490 // no spatial information, just calculate mean & stdev 491 if ((Nx == 1) && (Ny == 1)) { 492 psStatsInit(map->stats); 493 494 // the user has supplied one of various stats option pairs, 495 psStatsOptions mean = psStatsMeanOption(map->stats->options); 496 psStatsOptions stdev = psStatsStdevOption(map->stats->options); 497 if (!psStatsSingleOption(mean)) { 498 psError(PS_ERR_UNKNOWN, true, "no valid mean stats option selected"); 499 return false; 500 } 501 if (!psStatsSingleOption(stdev)) { 502 psError(PS_ERR_UNKNOWN, true, "no valid stdev stats option selected"); 503 return false; 504 } 505 506 // XXX does ROBUST_MEDIAN work with weight? 507 if (!psVectorStats(map->stats, f, NULL, mask, maskValue)) { 508 psError(PS_ERR_UNKNOWN, false, "failure to measure stats"); 509 return false; 510 } 511 512 map->map->data.F32[0][0] = psStatsGetValue(map->stats, mean); 513 map->error->data.F32[0][0] = psStatsGetValue(map->stats, stdev); 514 if (isfinite(map->map->data.F32[0][0]) && isfinite( map->error->data.F32[0][0])) { 515 *pGoodFit = true; 516 } 517 return true; 518 } 519 520 if (Nx == 1) { 521 bool status; 522 status = psImageMapFit1DinY (pGoodFit, map, mask, maskValue, x, y, f, df); 523 return status; 524 } 525 if (Ny == 1) { 526 bool status; 527 status = psImageMapFit1DinX (pGoodFit, map, mask, maskValue, x, y, f, df); 528 return status; 529 } 530 531 // set up the redirection table so we can use sA[-1][-1], etc 532 // XXX psKernel does this for you --- PAP. 533 float SAm[3][3], *SAv[3], **sA; 534 535 for (int i = 0; i < 3; i++) { 536 SAv[i] = SAm[i] + 1; 537 } 538 sA = SAv + 1; 539 540 // elements of the matrix equation Ax = B; we are solving for the vector x 541 // psImage *A = psImageAlloc (Nx*Ny, Nx*Ny, PS_TYPE_F32); 542 // psVector *B = psVectorAlloc (Nx*Ny, PS_TYPE_F32); 543 544 // psImageInit (A, 0.0); 545 // psVectorInit (B, 0.0); 546 547 // CZW: call to psSparseAlloc 548 // It should match old A, and each element of that should only touch four others. 549 psSparse *Asparse = psSparseAlloc(Nx * Ny, 4 * Nx * Ny); 550 551 // we are looping over the Nx,Ny image map elements; 552 // the matrix equation contains Nx*Ny rows and columns 553 554 for (int n = 0; n < Nx; n++) { 555 for (int m = 0; m < Ny; m++) { 556 // define & init summing variables 557 float rx_rx_ry_ry = 0; 558 float rx_rx_dy_ry = 0; 559 float dx_rx_ry_ry = 0; 560 float dx_rx_dy_ry = 0; 561 float fi_rx_ry = 0; 562 float rx_rx_py_py = 0; 563 float rx_rx_qy_py = 0; 564 float dx_rx_py_py = 0; 565 float dx_rx_qy_py = 0; 566 float fi_rx_py = 0; 567 float px_px_ry_ry = 0; 568 float px_px_dy_ry = 0; 569 float qx_px_ry_ry = 0; 570 float qx_px_dy_ry = 0; 571 float fi_px_ry = 0; 572 float px_px_py_py = 0; 573 float px_px_qy_py = 0; 574 float qx_px_py_py = 0; 575 float qx_px_qy_py = 0; 576 float fi_px_py = 0; 577 578 // generate the sums for the fitting matrix element I,J 579 // I = n + nX*m 580 // J = (n + jn) + nX*(m + jm) 581 for (int i = 0; i < x->n; i++) { 582 583 if (mask && (mask->data.PS_TYPE_VECTOR_MASK_DATA[i] & maskValue)) continue; 584 585 // base coordinate offset for this point (x,y) relative to this map element (n,m) 586 float dx = psImageBinningGetRuffX (map->binning, x->data.F32[i]) - (n + 0.5); 587 float dy = psImageBinningGetRuffY (map->binning, y->data.F32[i]) - (m + 0.5); 588 589 // edge cases to include: 590 bool edgeX = false; 591 edgeX |= ((n == 1) && (dx < -1.0)); 592 edgeX |= ((n == Nx - 2) && (dx > +1.0)); 593 594 bool edgeY = false; 595 edgeY |= ((m == 1) && (dy < -1.0)); 596 edgeY |= ((m == Ny - 2) && (dy > +1.0)); 597 598 // skip points outside of 2x2 grid centered on n,m: 599 if (!edgeX && (fabs(dx) > 1.0)) continue; 600 if (!edgeY && (fabs(dy) > 1.0)) continue; 601 602 // related offset values 603 float rx = 1.0 - dx; 604 float ry = 1.0 - dy; 605 float px = 1.0 + dx; 606 float py = 1.0 + dy; 607 float qx = -dx; 608 float qy = -dy; 609 610 // data value & weight for this point 611 float fi = f->data.F32[i]; 612 if (!isfinite(fi)) continue; 613 614 float wt = 1.0; 615 if (df != NULL) { 616 if (df->data.F32[i] == 0.0) { 617 wt = 0.0; 618 } else { 619 if (!isfinite(df->data.F32[i])) continue; 620 wt = 1.0 / PS_SQR(df->data.F32[i]); // XXX test for dz == NULL or dz_i = 0 621 } 622 } 623 624 // sum the appropriate elements for the different quadrants 625 626 int Qx = (dx >= 0) ? 1 : 0; 627 if (n == 0) Qx = 1; 628 if (n == Nx - 1) Qx = 0; 629 630 int Qy = (dy >= 0) ? 1 : 0; 631 if (m == 0) Qy = 1; 632 if (m == Ny - 1) Qy = 0; 633 634 assert (isfinite(fi)); 635 assert (isfinite(wt)); 636 assert (isfinite(rx)); 637 assert (isfinite(ry)); 638 639 // points at offset 1,1 640 if ((Qx == 1) && (Qy == 1)) { 641 rx_rx_ry_ry += rx*rx*ry*ry*wt; 642 rx_rx_dy_ry += rx*rx*dy*ry*wt; 643 dx_rx_ry_ry += dx*rx*ry*ry*wt; 644 dx_rx_dy_ry += dx*rx*dy*ry*wt; 645 fi_rx_ry += fi*rx*ry*wt; 646 } 647 // points at offset 1,0 648 if ((Qx == 1) && (Qy == 0)) { 649 rx_rx_py_py += rx*rx*py*py*wt; 650 rx_rx_qy_py += rx*rx*qy*py*wt; 651 dx_rx_py_py += dx*rx*py*py*wt; 652 dx_rx_qy_py += dx*rx*qy*py*wt; 653 fi_rx_py += fi*rx*py*wt; 654 } 655 // points at offset 0,1 656 if ((Qx == 0) && (Qy == 1)) { 657 px_px_ry_ry += px*px*ry*ry*wt; 658 px_px_dy_ry += px*px*dy*ry*wt; 659 qx_px_ry_ry += qx*px*ry*ry*wt; 660 qx_px_dy_ry += qx*px*dy*ry*wt; 661 fi_px_ry += fi*px*ry*wt; 662 } 663 // points at offset 0,0 664 if ((Qx == 0) && (Qy == 0)) { 665 px_px_py_py += px*px*py*py*wt; 666 px_px_qy_py += px*px*qy*py*wt; 667 qx_px_py_py += qx*px*py*py*wt; 668 qx_px_qy_py += qx*px*qy*py*wt; 669 fi_px_py += fi*px*py*wt; 670 } 671 } 672 673 // the chi-square derivatives have elements of the form g(n+jn,m+jm)*A(jn,jm), 674 // jn,jm = -1 to +1. Convert the sums above into the correct coefficients 675 sA[-1][-1] = qx_px_qy_py; 676 sA[-1][ 0] = qx_px_ry_ry + qx_px_py_py; 677 sA[-1][+1] = qx_px_dy_ry; 678 sA[ 0][-1] = rx_rx_qy_py + px_px_qy_py; 679 sA[ 0][ 0] = rx_rx_ry_ry + px_px_ry_ry + rx_rx_py_py + px_px_py_py; 680 sA[ 0][+1] = rx_rx_dy_ry + px_px_dy_ry; 681 sA[+1][-1] = dx_rx_qy_py; 682 sA[+1][ 0] = dx_rx_ry_ry + dx_rx_py_py; 683 sA[+1][+1] = dx_rx_dy_ry; 684 685 // I[ 0][ 0] = index for this n,m element: 686 int I = n + Nx * m; 687 // B->data.F32[I] = fi_rx_ry + fi_rx_py + fi_px_ry + fi_px_py; 688 // CZW: call to psSparseVector Element 689 if (fi_rx_ry + fi_rx_py + fi_px_ry + fi_px_py == 0.0) { 690 psSparseVectorElement(Asparse, I, 1.0); 691 } 692 else { 693 psSparseVectorElement(Asparse, I, fi_rx_ry + fi_rx_py + fi_px_ry + fi_px_py); 694 } 695 696 // printf("ADDING: %d %g \n",I, fi_rx_ry + fi_rx_py + fi_px_ry + fi_px_py); 697 // insert these values into their corresponding locations in A, B 698 for (int jn = -1; jn <= +1; jn++) { 699 if (n + jn < 0) continue; 700 if (n + jn >= Nx) continue; 701 for (int jm = -1; jm <= +1; jm++) { 702 if (m + jm < 0) continue; 703 if (m + jm >= Ny) continue; 704 int J = (n + jn) + Nx * (m + jm); 705 // printf("A: %d %d %g\n",J,I,sA[jn][jm]); 706 // A->data.F32[J][I] = sA[jn][jm]; 707 // CZW: call to psSparseMatrixElement 708 if (J < I) { continue; } 709 psSparseMatrixElement(Asparse,J,I,sA[jn][jm]); // Ensure J < I? 710 711 } 712 } 713 } 714 } 715 716 // test for empty diagonal elements (unconstained cells), mark, and set pivots to 1.0 717 // CZW: I'm not totally sure how to check these in the sparse context. 718 // Iterate over all ii pairs, and manually check the structure? 719 #if (0) 720 psVector *Empty = psVectorAlloc (Nx*Ny, PS_TYPE_S8); 721 psVectorInit (Empty, 0); 722 for (int i = 0; i < Nx*Ny; i++) { 723 if (A->data.F32[i][i] == 0.0) { 724 Empty->data.S8[i] = 1; 725 for (int j = 0; j < Nx*Ny; j++) { 726 A->data.F32[i][j] = 0.0; 727 A->data.F32[j][i] = 0.0; 728 } 729 A->data.F32[i][i] = 1.0; 730 B->data.F32[i] = 0.0; 731 } 732 } 733 #endif 734 735 // CZW: call to psSparseSolve 736 psVector *solution = psVectorAlloc(Nx*Ny, PS_TYPE_F32); 737 psSparseConstraint Constraint; 738 Constraint.paramDelta = 1e-3; 739 Constraint.paramMin = -1e5; 740 Constraint.paramMax = 1e5; 741 solution = psSparseSolve(solution, Constraint, Asparse, 1000); 742 if (!solution) { 743 psFree(solution); 744 psFree(Asparse); 745 return(false); 746 } 747 748 #if (0) 749 // CZW: This is a continuation of the above information 750 // set bad values to NaN 751 for (int i = 0; i < Nx*Ny; i++) { 752 if (Empty->data.S8[i]) { 753 B->data.F32[i] = NAN; 754 A->data.F32[i][i] = 0; 755 } 756 } 757 #endif 758 759 for (int n = 0; n < Nx; n++) { 760 for (int m = 0; m < Ny; m++) { 761 int I = n + Nx * m; 762 map->map->data.F32[m][n] = solution->data.F32[I]; 763 map->error->data.F32[m][n] = NAN; // sqrt(A->data.F32[I][I]); // CZW: fix this to be a real error. 764 } 765 } 766 767 // psFree (A); 768 // psFree (B); 769 // psFree (Empty); 770 // CZW: free things 771 psFree(solution); 772 psFree(Asparse); 773 774 *pGoodFit = true; 775 return true; 776 } 777 778 // measure residuals on each pass and clip outliers based on stats 779 bool psImageMapClipFitSparse(bool *pGoodFit, psImageMap *map, psStats *stats, psVector *inMask, psVectorMaskType maskValue, 780 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 781 { 782 // XXX add in full PS_ASSERTS 783 psAssert(map, "impossible"); 784 psAssert(stats, "impossible"); 785 psAssert(x, "impossible"); 786 psAssert(y, "impossible"); 787 psAssert(f, "impossible"); 788 789 *pGoodFit = false; 790 791 // the user supplies one of various stats option pairs, 792 // determine the desired mean and stdev STATS options: 793 psStatsOptions meanOption = psStatsMeanOption(stats->options); 794 psStatsOptions stdevOption = psStatsStdevOption(stats->options); 795 if (!psStatsSingleOption(meanOption)) { 796 psError(PS_ERR_UNKNOWN, true, "no valid mean stats option selected"); 797 return false; 798 } 799 if (!psStatsSingleOption(stdevOption)) { 800 psError(PS_ERR_UNKNOWN, true, "no valid stdev stats option selected"); 801 return false; 802 } 803 804 // clipping range defined by min and max and/or clipSigma 805 psF32 minClipSigma; 806 psF32 maxClipSigma; 807 if (isfinite(stats->max)) { 808 maxClipSigma = fabs(stats->max); 809 } else { 810 maxClipSigma = fabs(stats->clipSigma); 811 } 812 if (isfinite(stats->min)) { 813 minClipSigma = fabs(stats->min); 814 } else { 815 minClipSigma = fabs(stats->clipSigma); 816 } 817 818 psVector *mask = inMask; 819 if (!inMask) { 820 mask = psVectorAlloc (x->n, PS_TYPE_VECTOR_MASK); 821 psVectorInit (mask, 0); 822 } 823 824 // vector to store residuals 825 psVector *resid = psVectorAlloc(f->n, PS_TYPE_F32); 826 827 psTrace("psLib.imageops", 4, "stats->clipIter is %d\n", stats->clipIter); 828 psTrace("psLib.imageops", 4, "(minClipSigma, maxClipSigma) is (%.2f, %.2f)\n", minClipSigma, maxClipSigma); 829 830 for (psS32 N = 0; N < stats->clipIter; N++) { 831 psTrace("psLib.imageops", 6, "Loop iteration %d. Calling psImageMapFit()\n", N); 832 psS32 Nkeep = 0; 833 if (!psImageMapFitSparse(pGoodFit, map, mask, maskValue, x, y, f, df)) { 404 834 psError(PS_ERR_UNKNOWN, false, "Could not fit image map.\n"); 405 835 psFree(resid); -
branches/eam_branches/ipp-20140904/psLib/src/imageops/psImageMapFit.h
r30044 r37804 20 20 // fit the image map to a set of points 21 21 bool psImageMapClipFit(bool *pGoodFit, 22 psImageMap *map, 23 psStats *stats, 24 psVector *mask, // WARNING: Mask is modified! 25 psVectorMaskType maskValue, 26 const psVector *x, 27 const psVector *y, 28 const psVector *f, 29 const psVector *df 30 ); 31 32 33 // fit the image map to a set of points, using sparse matrix tools 34 bool psImageMapFitSparse(bool *pGoodFit, 35 psImageMap *map, 36 const psVector *mask, 37 psVectorMaskType maskValue, // 38 const psVector *x, 39 const psVector *y, 40 const psVector *f, 41 const psVector *df 42 ); 43 44 // fit the image map to a set of points using sparse matrix tools 45 bool psImageMapClipFitSparse(bool *pGoodFit, 22 46 psImageMap *map, 23 47 psStats *stats, -
branches/eam_branches/ipp-20140904/psLib/src/math/psMinimizePolyFit.c
- Property svn:mergeinfo set to
r36296 r37804 700 700 701 701 // Define values that may be used by PS_POLYNOMIAL_ORD form. 702 // these scaling values put the dynamic range of the data into some vaguely sensible location 702 703 bool scale = false; 704 bool median_zero = false; 703 705 double median = 0.0; 704 706 double sigma = 1.0; 705 psVector *sorted = NULL; 706 psVector *z64 = NULL; 707 707 708 708 switch (poly->type) { 709 709 case PS_POLYNOMIAL_ORD: 710 710 if ((f64->n < 10000)&&(poly->nX > 1)) { 711 711 scale = true; 712 sorted = psVectorSort(NULL,x64); 712 713 // generate a subset of the unmasked values: 714 psVector *tmp = psVectorAllocEmpty (x64->n, PS_TYPE_F64); 715 for (int itmp = 0; itmp < x64->n; itmp++) { 716 if (mask && (mask->data.PS_TYPE_VECTOR_MASK_DATA[itmp] && maskValue)) continue; 717 psVectorAppend (tmp, x64->data.F64[itmp]); 718 } 719 psVector *sorted = psVectorSort(NULL,tmp); 713 720 median = sorted->data.F64[sorted->n / 2]; 714 721 // CZW: I'm not bothering to scale this because it doesn't really matter. 715 722 sigma = (sorted->data.F64[3 * sorted->n / 4] - sorted->data.F64[sorted->n / 4]); 716 723 psFree(sorted); 724 psFree(tmp); 717 725 718 726 if ((!isfinite(median))|| … … 721 729 sigma = 1.0; 722 730 } 723 if ((median == 0.0)&&(sigma == 1.0)) { 724 scale = false; 731 if (fabs(median) < 1e-10) { 732 // CZW 2014-10-21: This median is small and close to zero. This can cause issues with the 733 // scaling, 734 median_zero = true; 735 if ((sigma == 1.0)||(fabs(sigma) <= 1e-10)) { 736 // Don't bother scaling if sigma is unity (it's already scaled) or if the sigma calculation has gone wrong. 737 scale = false; 738 } 725 739 } 740 726 741 // I can't see a way to not clobber x if it's already F64, so make a copy.x 727 z64 = psVectorCopy(NULL,x64,PS_TYPE_F64);742 psVector *z64 = psVectorCopy(NULL,x64,PS_TYPE_F64); 728 743 psBinaryOp(z64,z64,"-",psScalarAlloc(median,PS_TYPE_F64)); 729 744 psBinaryOp(z64,z64,"/",psScalarAlloc(sigma,PS_TYPE_F64)); … … 733 748 #endif 734 749 735 736 750 result = VectorFitPolynomial1DOrd(poly, mask, maskValue, f64, fErr64, z64); 737 751 psFree(z64); // Done with this. … … 758 772 #endif 759 773 } 774 760 775 for (psS32 i = 0; i <= poly->nX; i++) { 761 776 poly->coeff[i] = 0.0; 762 777 poly->coeffErr[i] = 0.0; 763 764 for (psS32 j = 0; j <= poly->nX; j++) { 778 if (median_zero) { // If the median is zero, the obtained solution just needs to be scaled by the sigma values. 779 poly->coeff[i] = Zcoeff[i] * pow(1.0 / sigma,i); 780 poly->coeffErr[i] = ZcoeffErr[i] * pow(1.0 / sigma,i); 781 } 782 else { // Otherwise, do the correct transformations by expanding the (x-m)/s terms. 783 for (psS32 j = 0; j <= poly->nX; j++) { 765 784 #if (CZW) 766 printf(" %d %d %f %f %f %f => %f\n",767 i,j,Zcoeff[j],768 pow(1.0 / sigma,j) * pow(-1,j - i),769 pow(median,j - i),770 1.0 * psBinomialCoeff(j,i),771 Zcoeff[j] * pow(1.0 / sigma,j) * pow(-1,j -i) * pow(median,j - i) * 1.0 * psBinomialCoeff(j,i)772 );785 printf(" %d %d %f %f %f %f => %f\n", 786 i,j,Zcoeff[j], 787 pow(1.0 / sigma,j) * pow(-1,j - i), 788 pow(median,j - i), 789 1.0 * psBinomialCoeff(j,i), 790 Zcoeff[j] * pow(1.0 / sigma,j) * pow(-1,j -i) * pow(median,j - i) * 1.0 * psBinomialCoeff(j,i) 791 ); 773 792 #endif 774 poly->coeff[i] += Zcoeff[j] * pow(1.0 / sigma,j) * pow(-1,j - i) * pow(median,j - i) * psBinomialCoeff(j,i); 775 poly->coeffErr[i] += pow(ZcoeffErr[j] * pow(1.0 / sigma,j) * pow(-1,j - i) * pow(median,j - 1) * psBinomialCoeff(j,i),2); 793 poly->coeff[i] += Zcoeff[j] * pow(1.0 / sigma,j) * pow(-1,j - i) * pow(median,j - i) * psBinomialCoeff(j,i); 794 poly->coeffErr[i] += pow(ZcoeffErr[j] * pow(1.0 / sigma,j) * pow(-1,j - i) * pow(median,j - 1) * psBinomialCoeff(j,i),2); 795 } 796 poly->coeffErr[i] = sqrt(poly->coeffErr[i]); 776 797 } 777 poly->coeffErr[i] = sqrt(poly->coeffErr[i]);778 798 #if (CZW) 779 799 printf("poly1d: unscaled parameters: %d %f %f\n", … … 784 804 psFree(ZcoeffErr); 785 805 786 } 806 } // End scaling block. 787 807 788 808 break; -
branches/eam_branches/ipp-20140904/psLib/src/mathtypes/psImage.c
r23443 r37804 91 91 } 92 92 93 long numBytes = numRows * numCols *elementSize;93 size_t numBytes = (size_t) numRows * (size_t) numCols * (size_t) elementSize; 94 94 95 95 psImage* image = (psImage* ) p_psAlloc(file, lineno, func, sizeof(psImage)); -
branches/eam_branches/ipp-20140904/psModules/src/concepts/pmConcepts.c
r36834 r37804 312 312 conceptRegisterEnum("FPA.TIMESYS", "Time system", p_pmConceptParse_TIMESYS, p_pmConceptFormat_TIMESYS, p_pmConceptCopy_TIMESYS, false, PM_FPA_LEVEL_FPA); 313 313 conceptRegisterTime("FPA.TIME", "Time of exposure", false, PM_FPA_LEVEL_FPA); 314 315 conceptRegisterStr("FPA.SHUTOUTC", "Time of exposure", NULL,NULL,NULL,false, PM_FPA_LEVEL_FPA); 316 314 317 conceptRegisterF32("FPA.TEMP", "Temperature of focal plane", NULL, NULL, NULL, false, PM_FPA_LEVEL_FPA); 315 318 conceptRegisterF32("FPA.M1X", "Primary Mirror X Position", NULL, NULL, NULL, false, PM_FPA_LEVEL_FPA); -
branches/eam_branches/ipp-20140904/psModules/src/imcombine/pmSubtraction.c
r36650 r37804 995 995 996 996 } 997 998 if (0) { 999 FILE *f = fopen ("vector.dat", "w"); 1000 psAssert (f, "should not fail to open test file"); 1001 1002 for (int qq = 0; qq < match->chisq->n; qq++) { 1003 fprintf (f, "%f %f : %f %f : %d\n", 1004 match->chisq->data.F32[qq], match->fluxes->data.F32[qq], 1005 logchisq->data.F32[qq], logflux->data.F32[qq], 1006 match->stampMask->data.PS_TYPE_VECTOR_MASK_DATA[qq]); 1007 } 1008 fclose (f); 1009 } 1010 1011 997 1012 bool result = psVectorClipFitPolynomial1D(model, stats, match->stampMask, 0xff, logchisq, NULL, logflux); 998 1013 if (!result) { -
branches/eam_branches/ipp-20140904/psModules/src/objects/pmSourceExtendedPars.c
r36375 r37804 226 226 pars->petrosianR50 = NAN; 227 227 pars->petrosianR50Err = NAN; 228 pars->ghalfLightRadius = NAN; 229 pars->gRT = NAN; 230 pars->gRA = NAN; 231 pars->gS2 = NAN; 232 pars->gA = NAN; 233 pars->gbumpy = NAN; 228 234 return pars; 229 235 } -
branches/eam_branches/ipp-20140904/psModules/src/objects/pmSourceExtendedPars.h
r36747 r37804 65 65 float petrosianR50Err; 66 66 float petrosianFill; 67 float ghalfLightRadius; 68 float gRT; // total residual (from eliptically symmetric model) Simard 2002 69 float gRA; // assymetric residual (from eliptically symmetric model) Simard 2002 70 float gS2; // (un) smoothness (Simard, 2011 Cheng 2011) 71 float gA; // assymetry index (Gyory & Bell 2010) 72 float gbumpy; // Blakeslee bumpiness 67 73 } pmSourceExtendedPars; 68 74 -
branches/eam_branches/ipp-20140904/psModules/src/objects/pmSourceIO_CMF.c.in
- Property svn:mergeinfo set to
r37325 r37804 319 319 320 320 // define PSF model type 321 int modelType = pmModelClassGetType ("PS_MODEL_GAUSS"); 321 int defaultModelType = pmModelClassGetType ("PS_MODEL_GAUSS"); 322 int modelType = -1; 322 323 323 324 // if header does not define the model, default to a gaussian … … 326 327 modelType = pmModelClassGetType (PSF_NAME); 327 328 } 328 assert (modelType > -1); 329 // work around bug in psphotFullForce 330 if (modelType < 0) { 331 modelType = defaultModelType; 332 } 333 // assert (modelType > -1); 329 334 330 335 // do we expect to find lensing parameters? … … 456 461 @>PS1_V4@ source->lensingOBJ->shear->e2 = psMetadataLookupF32 (&status, row, "LENS_E2_SH_OBJ"); 457 462 } 463 464 @>PS1_V4@ source->chipNum = psMetadataLookupS16 (&status, row, "SRC_CHIP_NUM"); 465 @>PS1_V4@ source->chipX = psMetadataLookupS16 (&status, row, "SRC_CHIP_X"); 466 @>PS1_V4@ source->chipY = psMetadataLookupS16 (&status, row, "SRC_CHIP_Y"); 458 467 459 468 if (haveLensPSF) { … … 639 648 psMetadataAdd (row, PS_LIST_TAIL, "PETRO_RADIUS_90_ERR", PS_DATA_F32, "Petrosian R90 Error (pix)", extpars->petrosianR90Err); 640 649 psMetadataAdd (row, PS_LIST_TAIL, "PETRO_FILL", PS_DATA_F32, "Petrosian Fill Factor", extpars->petrosianFill); 650 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "HALF_LIGHT_RADIUS", 0, "Half Light Radius", extpars->ghalfLightRadius); 651 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_RT", 0, "total residual Sersic Model", extpars->gRT); 652 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_RA", 0, "assymetric residual Sersic Model", extpars->gRA); 653 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_S2", 0, "(un)smoothness paramter residual Sersic Model", extpars->gS2); 654 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_A", 0, "assymetry index", extpars->gA); 655 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_BUMPY", 0, "bumpiness", extpars->gbumpy); 641 656 } else { 642 657 psMetadataAdd (row, PS_LIST_TAIL, "PETRO_MAG", PS_DATA_F32, "Petrosian Magnitude", NAN); … … 649 664 psMetadataAdd (row, PS_LIST_TAIL, "PETRO_RADIUS_90_ERR", PS_DATA_F32, "Petrosian R90 Error (pix)",NAN); 650 665 psMetadataAdd (row, PS_LIST_TAIL, "PETRO_FILL", PS_DATA_F32, "Petrosian Fill Factor", NAN); 666 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "HALF_LIGHT_RADIUS", 0, "Half Light Radius", NAN); 667 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_RT", 0, "total residual Sersic Model", NAN); 668 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_RA", 0, "assymetric residual Sersic Model", NAN); 669 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_S2", 0, "(un)smoothness paramter residual Sersic Model", NAN); 670 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_A", 0, "assymetry index", NAN); 671 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "G_BUMPY", 0, "bumpiness", NAN); 651 672 } 652 673 } … … 848 869 extpars->petrosianR90Err = psMetadataLookupF32(&status, row, "PETRO_RADIUS_90_ERR"); 849 870 extpars->petrosianFill = psMetadataLookupF32(&status, row, "PETRO_FILL"); 871 extpars->ghalfLightRadius = psMetadataLookupF32(&status, row, "HALF_LIGHT_RADIUS"); 872 extpars->gRT = psMetadataLookupF32(&status, row, "G_RT"); 873 extpars->gRA = psMetadataLookupF32(&status, row, "G_RA"); 874 extpars->gS2 = psMetadataLookupF32(&status, row, "G_S2"); 875 extpars->gA = psMetadataLookupF32(&status, row, "G_A"); 876 extpars->gbumpy = psMetadataLookupF32(&status, row, "G_BUMPY"); 850 877 851 878 psVector *radSB = psMetadataLookupVector(&status, row, "PROF_SB"); … … 995 1022 psMetadataAddF32 (row, PS_LIST_TAIL, "X_EXT_SIG", 0, "Sigma in EXT x coordinate", xErr); 996 1023 psMetadataAddF32 (row, PS_LIST_TAIL, "Y_EXT_SIG", 0, "Sigma in EXT y coordinate", yErr); 1024 @>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "SKY_EXT", 0, "EXT fit sky value", PAR ? PAR[PM_PAR_SKY] : NAN); 997 1025 @>PS1_DV2,>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "RA_EXT", 0, "EXT model ra coordinate", raPos); 998 1026 @>PS1_DV2,>PS1_SV3@ psMetadataAddF32 (row, PS_LIST_TAIL, "DEC_EXT", 0, "EXT model dec coordinate", decPos); -
branches/eam_branches/ipp-20140904/psastro/src/psastro.h
r36837 r37804 154 154 155 155 bool psastroZeroPoint (pmConfig *config); 156 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime );156 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime, float refminMag, float refmaxMag); 157 157 bool psastroZeroPointAnalysis (psMetadata *header, psVector *dMag, float zeropt, psMetadata *recipe); 158 158 bool psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, pmFPA *fpa, psMetadata *recipe); 159 bool psastroZeroPointRefMagLimitFromRecipe (float *refminMag, float *refmaxMag, pmFPA *fpa, psMetadata *recipe); 159 160 160 161 psStats *psastroStatsPercentile (psVector *myVector, psMetadata *recipe); -
branches/eam_branches/ipp-20140904/psastro/src/psastroChooseRefstars.c
r35715 r37804 66 66 psF32 clampMagMin = psMetadataLookupF32 (&status, recipe, "REFSTAR_CLAMP_MAG_MIN"); 67 67 if (!status) clampMagMin = -5.0; 68 //MEH adding max option as well -- really should not be hardcoded.. 69 psF32 clampMagMax = psMetadataLookupF32 (&status, recipe, "REFSTAR_CLAMP_MAG_MAX"); 70 if (!status) clampMagMax = 30.0; 71 psWarning("Will skip/clamp refstar with brighter/fainter magnitude %f/%f\n",clampMagMin,clampMagMax); 72 68 73 69 74 // de-activate all files except PSASTRO.REFSTARS … … 109 114 110 115 if (ref->Mag < clampMagMin) { 111 psWarning("Skipping refstar with abusrd magnitude %f ra: %f dec: %f\n", 112 ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d)); 116 //psWarning("Skipping refstar with abusrd magnitude %f ra: %f dec: %f\n", 117 // ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d)); 118 psTrace ("psastro", 6, "Skipping by clamp refstar with bright magnitude %f ra: %f dec: %f\n", 119 ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d)); 120 goto skip; 121 } 122 //MEH option for max mag clamp also -- need to change psWarning (to log) to trace and above for bright.. 123 if (ref->Mag > clampMagMax) { 124 //psWarning("Skipping by clamp refstar with faint magnitude %f ra: %f dec: %f\n", 125 // ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d)); 126 psTrace ("psastro", 6, "Skipping by clamp refstar with faint magnitude %f ra: %f dec: %f\n", 127 ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d)); 113 128 goto skip; 114 129 } -
branches/eam_branches/ipp-20140904/psastro/src/psastroZeroPoint.c
r33643 r37804 20 20 pmCell *cell = NULL; 21 21 pmReadout *readout = NULL; 22 float refminMag,refmaxMag; 22 23 23 24 // select the current recipe … … 59 60 } 60 61 62 // MEH -- RefMagLimit for ZP with photcode option (merr probably better but not an option) 63 // -- defualt is to use general config value (no hardcode..) 64 if (!psastroZeroPointRefMagLimitFromRecipe (&refminMag, &refmaxMag, fpa, recipe)) { 65 psLogMsg ("psastro", PS_LOG_INFO, "failed to load ref min,maxMag data from recipe"); 66 return false; 67 } 68 61 69 // if we measure the zero point by exposure, accumulate the dMag values here: 62 70 psVector *dMag = NULL; 71 // MEH -- also the number of refcat sources used 72 int zpt_nref = 0; 63 73 64 74 float fpaZP = 0.0; // Average zero point … … 81 91 82 92 // calculate dMag for the matched stars 83 dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime); 84 93 //dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime); 94 // MEH -- additional limits should be available for ZP if just robust mean and w/ stack skycal 95 dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime, refminMag, refmaxMag); 85 96 if (!byExposure) { 86 97 // calculate dMag for the matched stars just for this readout (well, chip) 87 98 psMetadata *header = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER"); 88 99 psastroZeroPointAnalysis (header, dMag, zeropt, recipe); 100 // MEH -- per readout N refcat, min/max mag -- added here, not part of median/edge process 101 zpt_nref += dMag->n; 102 psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "N refcat sources for zero point", dMag->n); 103 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag); 104 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag); 89 105 psFree (dMag); 90 106 dMag = NULL; … … 95 111 numZP++; 96 112 } 113 97 114 98 115 … … 110 127 } 111 128 psastroZeroPointAnalysis (header, dMag, zeropt, recipe); 129 //MEH -- all N refcat sources here 130 zpt_nref = dMag->n; 112 131 psFree (dMag); 113 132 dMag = NULL; … … 141 160 // calculate dMag for the matched stars just for this readout (well, chip) 142 161 psMetadata *header = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER"); 143 144 162 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_OBS", PS_META_REPLACE, "measured zero point", zptObs); 145 163 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_REF", PS_META_REPLACE, "reference zero point", zptRef); 146 164 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_ERR", PS_META_REPLACE, "error on zero point", zptErr); 147 165 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_OFF", PS_META_REPLACE, "zero point offset", zptOff); 166 //MEH -- per readout N refcat, MIN/MAX for consistency 167 psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "N refcat sources for zero point", zpt_nref); 168 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag); 169 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag); 148 170 } 149 171 } … … 151 173 } 152 174 175 // MEH add N refcat, min/max mag to primary header 176 psMetadata *header = psMetadataLookupMetadata (&status, fpa->analysis, "PSASTRO.HEADER"); 177 if (!header) { 178 header = psMetadataAlloc (); 179 psMetadataAddMetadata (fpa->analysis, PS_LIST_TAIL, "PSASTRO.HEADER", PS_META_REPLACE, "psastro header stats", header); 180 psFree (header); 181 } 182 psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "Total N refcat sources for zero point", zpt_nref); 183 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag); 184 psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag); 153 185 154 186 psMetadataItem *item = psMetadataLookup(fpa->concepts, "FPA.ZP"); … … 162 194 * accumulate the dMag values from this readout 163 195 */ 164 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime ) {196 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime, float refminMag, float refmaxMag) { 165 197 166 198 bool status; … … 191 223 // XXX I should be applying the airmass term here or in psastroLoadRefstars 192 224 // (ie, ref->Mag would be a prediction for a given star. 193 float value = ref->Mag - raw->Mag - 2.5*log10(exptime); 194 psVectorAppend (dMag, value); 225 // MEH -- only append if in allowed ref mag range -- may want merr but not available.. 226 if ( ref->Mag >= refminMag && ref->Mag <= refmaxMag ){ 227 float value = ref->Mag - raw->Mag - 2.5*log10(exptime); 228 psVectorAppend (dMag, value); 229 } 195 230 } 196 231 return dMag; … … 490 525 continue; 491 526 } 492 } 527 //MEH null is a pain.. so only log if set 528 psLogMsg ("psastro", PS_LOG_INFO, "found GHOST_MAX_MAG %f",*ghostMaxMag); 529 } 530 //MEH what zpt is set to 531 psLogMsg ("psastro", PS_LOG_INFO, "found ZEROPT %f",*zeropt); 493 532 psFree (iter); 494 533 return true; … … 497 536 return false; 498 537 } 538 539 540 541 bool psastroZeroPointRefMagLimitFromRecipe (float *refminMag, float *refmaxMag, pmFPA *fpa, psMetadata *recipe) { 542 543 bool status; 544 float tmpmin,tmpmax; 545 546 // MEH -- duplicate psastroZeroPointFromRecipe for ZeroPoint adding RefMag limits with photcode option for extra restrictions 547 // must have non-photcode dependent setting -- use as default rather than a hardcoded value 548 *refminMag = psMetadataLookupF32 (&status, recipe, "REFSTAR.ZP.MIN.MAG"); 549 //if (!status) *refminMag = -5.0; 550 if (!status) { 551 psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit is missing REFSTAR.ZP.MIN.MAG"); 552 return false; 553 } 554 *refmaxMag = psMetadataLookupF32 (&status, recipe, "REFSTAR.ZP.MAX.MAG"); 555 //if (!status) *refmaxMag = 30.0; 556 if (!status) { 557 psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit is missing REFSTAR.ZP.MAX.MAG"); 558 return false; 559 } 560 561 // select the filter; default to any photcode and mag limit otherwise 562 char *filter = psMetadataLookupStr (&status, fpa->concepts, "FPA.FILTERID"); 563 if (!status) ESCAPE ("RefMagLimit missing FPA.FILTER in concepts"); 564 565 // need to select the PHOTCODE.DATA folder that matches our filter 566 psMetadataItem *item = psMetadataLookup (recipe, "PHOTCODE.DATA"); 567 if (!item) ESCAPE ("RefMagLimit PHOTCODE.DATA folders missing"); 568 if (item->type != PS_DATA_METADATA_MULTI) ESCAPE ("RefMagLimit PHOTCODE.DATA not a multi"); 569 570 // PHOTCODE.DATA is a multi of metadata items 571 psListIterator *iter = psListIteratorAlloc(item->data.list, PS_LIST_HEAD, false); 572 573 psMetadataItem *refItem = NULL; 574 while ((refItem = psListGetAndIncrement (iter))) { 575 if (refItem->type != PS_DATA_METADATA) ESCAPE ("RefMagLimit PHOTCODE.DATA entry is not a metadata folder"); 576 577 char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER"); 578 if (!status) { 579 // always seems to happen once, commented out in ZeroPoint above as well 580 //psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit PHOTCODE.DATA recipe folder is missing FILTER"); 581 continue; 582 } 583 584 // does this entry match the current filter? 585 if (strcmp (refFilter, filter)) continue; 586 587 psLogMsg ("psastro", PS_LOG_DETAIL, "RefMagLimit PHOTCODE.DATA found for filter %s", filter); 588 589 // -- may set one or other or both -- no reason to log if found or often not 590 tmpmin = psMetadataLookupF32 (&status, refItem->data.md, "REFSTAR.ZP.MIN.MAG"); 591 if (status) { 592 *refminMag = tmpmin; 593 } 594 tmpmax = psMetadataLookupF32 (&status, refItem->data.md, "REFSTAR.ZP.MAX.MAG"); 595 if (status) { 596 *refmaxMag = tmpmax; 597 } 598 // once finds filter, should free and return true but multiple groups cause issue so just go through all groups now 599 //psFree (iter); 600 //return true; 601 } 602 603 // log out set values 604 psLogMsg ("psastro", PS_LOG_INFO, "using REFSTAR.ZP.MIN.MAG %f",*refminMag); 605 psLogMsg ("psastro", PS_LOG_INFO, "using REFSTAR.ZP.MAX.MAG %f",*refmaxMag); 606 607 psFree (iter); 608 return true; 609 } 610 -
branches/eam_branches/ipp-20140904/psphot/src/Makefile.am
r37321 r37804 260 260 psphotSetNFrames.c \ 261 261 psphotSourceMemory.c \ 262 psphotChipParams.c 262 psphotChipParams.c \ 263 psphotGalaxyParams.c 263 264 264 265 # not currently used -
branches/eam_branches/ipp-20140904/psphot/src/psphot.h
r37321 r37804 138 138 bool psphotExtendedSourceFits_Threaded (psThreadJob *job); 139 139 140 bool psphotGalaxyParams (pmConfig *config, const pmFPAview *view, const char *filerule); 141 bool psphotGalaxyParamsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe); 142 bool psphotGalaxyParams_Threaded (psThreadJob *job); 143 140 144 bool psphotApResid (pmConfig *config, const pmFPAview *view, const char *filerule); 141 145 bool psphotApResidReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe); 142 146 143 147 bool psphotMagnitudes (pmConfig *config, const pmFPAview *view, const char *filerule); 144 bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf );148 bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf, int index); 145 149 bool psphotMagnitudes_Threaded (psThreadJob *job); 146 150 … … 168 172 // in psphotChoosePSF.c: 169 173 bool psphotPSFstats (pmReadout *readout, pmPSF *psf); 174 bool psphotPSFstatsSources (pmReadout *readout, psArray *sources, pmPSF *psf); 170 175 bool psphotMomentsStats (pmReadout *readout, psArray *sources); 171 176 … … 232 237 int psphotSaveImage (psMetadata *header, psImage *image, char *filename); 233 238 bool psphotDumpConfig (pmConfig *config); 234 pmReadout *psphotSelectBackground (pmConfig *config, const pmFPAview *view );235 pmReadout *psphotSelectBackgroundStdev (pmConfig *config, const pmFPAview *view );239 pmReadout *psphotSelectBackground (pmConfig *config, const pmFPAview *view, int index); 240 pmReadout *psphotSelectBackgroundStdev (pmConfig *config, const pmFPAview *view, int index); 236 241 237 242 // PSF / DBL / EXT evaluation functions -
branches/eam_branches/ipp-20140904/psphot/src/psphotChooseAnalysisOptions.c
r36453 r37804 606 606 psLogMsg ("psphot.options", PS_LOG_WARN, "choose analysis options for %ld objects: %f sec\n", objects->n, psTimerMark ("psphot.options")); 607 607 608 psFree(exptime); 609 psFree(zeropt); 610 psFree(chips); 611 psFree(inputFilters); 612 psFree(petroFluxLim); 613 psFree(extFitFluxLim); 608 614 psFree(toGal); 609 615 -
branches/eam_branches/ipp-20140904/psphot/src/psphotChoosePSF.c
r36863 r37804 1 1 # include "psphotInternal.h" 2 bool psphotPSFstatsSources (pmReadout *readout, psArray *sources, pmPSF *psf); 2 3 3 4 // generate a PSF model for inputs without PSF models already loaded … … 388 389 psFree (models); 389 390 390 if (!psphotPSFstats (readout, psf)) { 391 // if (!psphotPSFstats (readout, psf)) { 392 393 if (!psphotPSFstatsSources (readout, sources, psf)) { 391 394 psError(PSPHOT_ERR_PSF, false, "cannot measure PSF shape terms"); 392 395 psFree(options); … … 466 469 467 470 if (modelPSF->params->n > 7) { 468 psVectorAppend (psfExtra1, modelPSF->params->data.F32[7]);471 psVectorAppend (psfExtra1, modelPSF->params->data.F32[7]); 469 472 } 470 473 if (modelPSF->params->n > 8) { 471 psVectorAppend (psfExtra2, modelPSF->params->data.F32[8]);474 psVectorAppend (psfExtra2, modelPSF->params->data.F32[8]); 472 475 } 473 476 psFree (modelPSF); 474 477 475 //float fwhmtest = pmPSFtoFWHM(psf, xc, yc);476 //fprintf (stderr, "fwhm: %f, %f : %f\n", FWHM_MAJOR, FWHM_MINOR, fwhmtest);478 float fwhmtest = pmPSFtoFWHM(psf, xc, yc); 479 fprintf (stderr, "fwhm: %f, %f : %f\n", FWHM_MAJOR, FWHM_MINOR, fwhmtest); 477 480 } 478 481 } … … 522 525 523 526 if (psfExtra1->n) { 524 if (!psVectorStats (stats, psfExtra1, NULL, NULL, 0)) { 525 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 1"); 527 if (!psVectorStats (stats, psfExtra1, NULL, NULL, 0)) { 528 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 1"); 529 goto escape; 530 } 531 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT1", PS_META_REPLACE, "PSF extra param 1", stats->sampleMean); 532 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 1: %f +/- %f", stats->sampleMean, stats->sampleStdev); 533 } 534 535 if (psfExtra2->n) { 536 if (!psVectorStats (stats, psfExtra2, NULL, NULL, 0)) { 537 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 2"); 538 goto escape; 539 } 540 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT2", PS_META_REPLACE, "PSF extra param 2", stats->sampleMean); 541 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 2: %f +/- %f", stats->sampleMean, stats->sampleStdev); 542 } 543 544 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "ANGLE", PS_META_REPLACE, "PSF angle", axes.theta); 545 psMetadataAddS32 (readout->analysis, PS_LIST_TAIL, "NPSFSTAR", PS_META_REPLACE, "Number of stars used to make PSF", psf->nPSFstars); 546 547 // psLogMsg ("psphot", PS_LOG_DETAIL, "PSF angle: %f, nstars: %d", axes.theta, psf->nPSFstars); 548 549 char *psfModelName = pmModelClassGetName(psf->type); 550 psMetadataAddStr(readout->analysis, PS_LIST_TAIL, "PSFMODEL", PS_META_REPLACE, "PSF Model Name", psfModelName); 551 psMetadataAddBool(readout->analysis, PS_LIST_TAIL, "PSF_OK", PS_META_REPLACE, "Valid PSF Model?", true); 552 553 int nParams = pmModelClassParameterCount(psf->type); 554 psMetadataAddS32(readout->analysis, PS_LIST_TAIL, "PSF_NPAR", PS_META_REPLACE, "Number of PSF parameters", nParams); 555 556 psFree (fwhmMajor); 557 psFree (fwhmMinor); 558 psFree (psfExtra1); 559 psFree (psfExtra2); 560 psFree (stats); 561 return true; 562 563 escape: 564 psFree (fwhmMajor); 565 psFree (fwhmMinor); 566 psFree (psfExtra1); 567 psFree (psfExtra2); 568 psFree (stats); 569 return false; 570 } 571 572 // measure average parameters of the PSF model 573 bool psphotPSFstatsSources (pmReadout *readout, psArray *sources, pmPSF *psf) { 574 575 psEllipseShape shape; 576 psEllipseAxes axes; 577 578 PS_ASSERT_PTR_NON_NULL(readout, false); 579 PS_ASSERT_PTR_NON_NULL(psf, false); 580 581 psImage *image = readout->image; 582 PS_ASSERT_PTR_NON_NULL(image, false); 583 584 // XXX a minor hack: measure the values for a grid of points across the image, determine mean, UQ, LQ, etc: 585 psVector *fwhmMajor = psVectorAllocEmpty (100, PS_DATA_F32); 586 psVector *fwhmMinor = psVectorAllocEmpty (100, PS_DATA_F32); 587 psVector *psfExtra1 = psVectorAllocEmpty (100, PS_DATA_F32); 588 psVector *psfExtra2 = psVectorAllocEmpty (100, PS_DATA_F32); 589 590 for (int i = 0; i < sources->n; i++) { 591 592 pmSource *source = sources->data[i]; 593 594 if (!(source->mode & PM_SOURCE_MODE_PSFSTAR)) continue; 595 596 float xc = source->peak->xf; 597 float yc = source->peak->yf; 598 599 // create modelPSF from this model 600 pmModel *modelPSF = pmModelFromPSFforXY (psf, xc, yc, 1.0); 601 if (!modelPSF) { 602 fprintf (stderr, "?"); 603 continue; 604 } 605 606 // get the model full-width at half-max 607 float FWHM_MAJOR = 2*modelPSF->class->modelRadius (modelPSF->params, 0.5); 608 609 // XXX make sure this is consistent with the re-definition of PM_PAR_SXX 610 shape.sx = modelPSF->params->data.F32[PM_PAR_SXX]; 611 shape.sy = modelPSF->params->data.F32[PM_PAR_SYY]; 612 shape.sxy = modelPSF->params->data.F32[PM_PAR_SXY]; 613 axes = psEllipseShapeToAxes (shape, 20.0); 614 615 float FWHM_MINOR = FWHM_MAJOR * (axes.minor / axes.major); 616 if (!isfinite(FWHM_MAJOR) || !isfinite(FWHM_MINOR)) { 617 fprintf (stderr, "!"); 618 psFree (modelPSF); 619 continue; 620 } 621 psVectorAppend (fwhmMajor, FWHM_MAJOR); 622 psVectorAppend (fwhmMinor, FWHM_MINOR); 623 624 if (modelPSF->params->n > 7) { 625 psVectorAppend (psfExtra1, modelPSF->params->data.F32[7]); 626 } 627 if (modelPSF->params->n > 8) { 628 psVectorAppend (psfExtra2, modelPSF->params->data.F32[8]); 629 } 630 psFree (modelPSF); 631 632 float fwhmtest = pmPSFtoFWHM(psf, xc, yc); 633 fprintf (stderr, "fwhm: %f, %f : %f\n", FWHM_MAJOR, FWHM_MINOR, fwhmtest); 634 } 635 636 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEAN | PS_STAT_SAMPLE_STDEV | PS_STAT_SAMPLE_QUARTILE); 637 if (!psVectorStats (stats, fwhmMajor, NULL, NULL, 0)) { 638 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for FWHM MAJOR"); 526 639 goto escape; 527 } 528 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT1", PS_META_REPLACE, "PSF extra param 1", stats->sampleMean); 529 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 1: %f +/- %f", stats->sampleMean, stats->sampleStdev); 640 } 641 642 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FWHM_MAJ", PS_META_REPLACE, "PSF FWHM Major axis (mean)", stats->sampleMean); 643 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_SG", PS_META_REPLACE, "PSF FWHM Major axis (sigma)", stats->sampleStdev); 644 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_LQ", PS_META_REPLACE, "PSF FWHM Major axis (lower quartile)", stats->sampleLQ); 645 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MJ_UQ", PS_META_REPLACE, "PSF FWHM Major axis (upper quartile)", stats->sampleUQ); 646 647 float fwhmMaj = stats->sampleMean; // FWHM on major axis 648 649 if (!psVectorStats (stats, fwhmMinor, NULL, NULL, 0)) { 650 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for FWHM MINOR"); 651 goto escape; 652 } 653 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FWHM_MIN", PS_META_REPLACE, "PSF FWHM Minor axis (mean)", stats->sampleMean); 654 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_SG", PS_META_REPLACE, "PSF FWHM Minor axis (sigma)", stats->sampleStdev); 655 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_LQ", PS_META_REPLACE, "PSF FWHM Minor axis (lower quartile)", stats->sampleLQ); 656 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "FW_MN_UQ", PS_META_REPLACE, "PSF FWHM Minor axis (upper quartile)", stats->sampleUQ); 657 658 float fwhmMin = stats->sampleMean; // FWHM on minor axis 659 660 if (readout->parent) { 661 662 // we now have 2 possible measurements of the seeing : the PSF model based version and 663 // the Moments based value we need to define a definitive "CHIP.SEEING" value. This 664 // value is used by the PSF-matching programs (ppSub and ppStack). The moments-based 665 // value is probably more representative of the value needed by those tools (it is also 666 // more stable?) 667 bool status = false; 668 float fwhmMajorMoments = psMetadataLookupF32(&status, readout->analysis, "IQ_FW1"); 669 float fwhmMinorMoments = psMetadataLookupF32(&status, readout->analysis, "IQ_FW1"); 670 671 pmChip *chip = readout->parent->parent; // Parent chip 672 psAssert(chip, "Cell should be attached to a chip."); 673 psMetadataItem *item = psMetadataLookup(chip->concepts, "CHIP.SEEING"); // Item with chip 674 item->data.F32 = 0.5 * (fwhmMajorMoments + fwhmMinorMoments); 675 676 psLogMsg ("psphot", PS_LOG_DETAIL, "fwhm (psf): %f,%f (moments): %f,%f", fwhmMaj, fwhmMin, fwhmMajorMoments, fwhmMinorMoments); 677 } 678 679 if (psfExtra1->n) { 680 if (!psVectorStats (stats, psfExtra1, NULL, NULL, 0)) { 681 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 1"); 682 goto escape; 683 } 684 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT1", PS_META_REPLACE, "PSF extra param 1", stats->sampleMean); 685 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 1: %f +/- %f", stats->sampleMean, stats->sampleStdev); 530 686 } 531 687 532 688 if (psfExtra2->n) { 533 if (!psVectorStats (stats, psfExtra2, NULL, NULL, 0)) {534 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 2");535 goto escape;536 }537 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT2", PS_META_REPLACE, "PSF extra param 2", stats->sampleMean);538 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 2: %f +/- %f", stats->sampleMean, stats->sampleStdev);689 if (!psVectorStats (stats, psfExtra2, NULL, NULL, 0)) { 690 psError(PS_ERR_UNKNOWN, false, "failure to measure stats for PSF EXTRA 2"); 691 goto escape; 692 } 693 psMetadataAddF32 (readout->analysis, PS_LIST_TAIL, "PSF_EXT2", PS_META_REPLACE, "PSF extra param 2", stats->sampleMean); 694 psLogMsg ("psphot", PS_LOG_DETAIL, "PSF extra parameter 2: %f +/- %f", stats->sampleMean, stats->sampleStdev); 539 695 } 540 696 -
branches/eam_branches/ipp-20140904/psphot/src/psphotCleanup.c
r36555 r37804 25 25 // don't display memory leaks unless trace is on. 26 26 // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "psphot"); 27 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "psphot");27 fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks2 (0, NULL, stdout, false, 500), "psphot"); 28 28 #endif 29 29 return; -
branches/eam_branches/ipp-20140904/psphot/src/psphotEfficiency.c
r36863 r37804 502 502 503 503 // measure the magnitudes and fluxes for the sources 504 if (!psphotMagnitudesReadout(config, recipe, view, readout, fakeSourcesAll, psf )) {504 if (!psphotMagnitudesReadout(config, recipe, view, readout, fakeSourcesAll, psf, index)) { 505 505 psError(PS_ERR_UNKNOWN, false, "Unable to measure magnitudes of fake sources."); 506 506 psFree(fakeSources); -
branches/eam_branches/ipp-20140904/psphot/src/psphotExtendedSourceFits.c
r36375 r37804 629 629 pmSourceCacheModel (source, maskVal); 630 630 631 # if ( PS_TRACE_ON)631 # if (0 && PS_TRACE_ON) 632 632 pmModel *model = source->modelFits->data[0]; 633 633 int flags = 0xffffffff; -
branches/eam_branches/ipp-20140904/psphot/src/psphotFitSourcesLinear.c
r34418 r37804 263 263 } 264 264 } 265 if (modelSum == 0 || maskedSum == 0) { 266 // no pixels at all drop the modelPSF (probably only an issue for external sources 267 // which are created from a fake peak (full force)) 268 psFree(source->modelPSF); 269 continue; 270 } 265 271 if (modelSum < 0.5) continue; // skip sources with no model constraint (somewhat arbitrary limit) 266 272 if (modelSum < 0.8) { -
branches/eam_branches/ipp-20140904/psphot/src/psphotFullForceReadout.c
r37321 r37804 117 117 psphotGalaxyShape (config, view, filerule); 118 118 119 // measure aperture photometry corrections 120 if (!psphotApResid (config, view, filerule)) { 121 psLogMsg ("psphot", 3, "failed on psphotApResid"); 122 return psphotReadoutCleanup (config, view, filerule); 123 } 124 119 125 // calculate source magnitudes (psf mag and ap mag) 120 126 psphotMagnitudes(config, view, filerule); -
branches/eam_branches/ipp-20140904/psphot/src/psphotMagnitudes.c
r34404 r37804 38 38 psAssert (psf, "missing psf?"); 39 39 40 if (!psphotMagnitudesReadout (config, recipe, view, readout, sources, psf )) {40 if (!psphotMagnitudesReadout (config, recipe, view, readout, sources, psf, i)) { 41 41 psError (PSPHOT_ERR_CONFIG, false, "failed to measure magnitudes for %s entry %d", filerule, i); 42 42 return false; … … 46 46 } 47 47 48 bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf ) {48 bool psphotMagnitudesReadout(pmConfig *config, psMetadata *recipe, const pmFPAview *view, pmReadout *readout, psArray *sources, pmPSF *psf, int index) { 49 49 50 50 bool status = false; … … 65 65 66 66 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN 67 pmReadout *backModel = psphotSelectBackground (config, view );68 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view );67 pmReadout *backModel = psphotSelectBackground (config, view, index); 68 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view, index); 69 69 70 70 // bit-masks to test for good/bad pixels -
branches/eam_branches/ipp-20140904/psphot/src/psphotOutput.c
r35769 r37804 29 29 } 30 30 31 pmReadout *psphotSelectBackground (pmConfig *config, const pmFPAview *view) { 32 33 bool status; 34 35 36 pmFPAfile *file = psMetadataLookupPtr (&status, config->files, psphotGetFilerule("PSPHOT.BACKMDL")); 31 pmReadout *psphotSelectBackground (pmConfig *config, const pmFPAview *view, int index) { 32 33 pmFPAfile *file = pmFPAfileSelectSingle (config->files, psphotGetFilerule("PSPHOT.BACKMDL"), index); 37 34 if (!file) return NULL; 38 35 … … 41 38 } 42 39 43 pmReadout *psphotSelectBackgroundStdev (pmConfig *config, const pmFPAview *view) { 44 45 bool status; 46 47 pmFPAfile *file = psMetadataLookupPtr (&status, config->files, psphotGetFilerule("PSPHOT.BACKMDL.STDEV")); 40 pmReadout *psphotSelectBackgroundStdev (pmConfig *config, const pmFPAview *view, int index) { 41 42 pmFPAfile *file = pmFPAfileSelectSingle (config->files, psphotGetFilerule("PSPHOT.BACKMDL.STDEV"), index); 48 43 if (!file) return NULL; 49 44 -
branches/eam_branches/ipp-20140904/psphot/src/psphotPetrosianAnalysis.c
r31154 r37804 12 12 // XXX temporary user-supplied systematic sky noise measurement (derive from background model) 13 13 float skynoise = psMetadataLookupF32 (&status, recipe, "SKY.NOISE"); 14 15 # if (0)16 // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN17 // XXX use this to set skynoise18 pmReadout *backModel = psphotSelectBackground (config, view);19 pmReadout *backStdev = psphotSelectBackgroundStdev (config, view);20 # endif21 14 22 15 // S/N limit to perform full non-linear fits -
branches/eam_branches/ipp-20140904/psphot/src/psphotReadout.c
r36623 r37804 325 325 psphotExtendedSourceAnalysis (config, view, filerule); // pass 1 (detections->allSources) 326 326 psphotExtendedSourceFits (config, view, filerule); // pass 1 (detections->allSources) 327 // measure some parameters for galaxy science 328 psphotGalaxyParams (config, view, filerule); 327 329 psphotRadialApertures(config, view, filerule, 0); 328 330 -
branches/eam_branches/ipp-20140904/psphot/src/psphotReadoutCleanup.c
r35771 r37804 57 57 // use the psf-model to measure FWHM stats 58 58 if (psf) { 59 if (!psphotPSFstats (readout, psf)) {59 if (!psphotPSFstatsSources (readout, sources, psf)) { 60 60 psError(PSPHOT_ERR_PROG, false, "Failed to measure PSF shape parameters"); 61 61 return false; -
branches/eam_branches/ipp-20140904/psphot/src/psphotSetNFrames.c
r33691 r37804 45 45 46 46 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 47 psAssert (detections, "missing detections?"); 48 psAssert (detections->allSources, "missing sources?"); 47 if (!detections) { 48 psLogMsg ("psphot", PS_LOG_INFO, "No detections image input %d", index); 49 return true; 50 } 49 51 50 52 psArray *sources = detections->allSources; 53 if (!sources) { 54 psLogMsg ("psphot", PS_LOG_INFO, "No sources for input %d", index); 55 return true; 56 } 51 57 52 58 int col0 = expnum->col0; -
branches/eam_branches/ipp-20140904/psphot/src/psphotSetThreads.c
r37321 r37804 92 92 psFree(task); 93 93 94 task = psThreadTaskAlloc("PSPHOT_GALAXY_PARAMS", 11); 95 task->function = &psphotGalaxyParams_Threaded; 96 psThreadTaskAdd(task); 97 psFree(task); 98 94 99 return true; 95 100 } -
branches/eam_branches/ipp-20140904/psphot/src/psphotSourceStats.c
r36375 r37804 185 185 psThreadJob *job = psThreadJobAlloc ("PSPHOT_SOURCE_STATS"); 186 186 187 psArrayAdd(job->args, 1, cells->data[j]); // sources188 189 PS_ARRAY_ADD_SCALAR(job->args, INNER, PS_TYPE_F32); 190 PS_ARRAY_ADD_SCALAR(job->args, MIN_SN, PS_TYPE_F32); 191 PS_ARRAY_ADD_SCALAR(job->args, RADIUS, PS_TYPE_F32); 192 PS_ARRAY_ADD_SCALAR(job->args, SIGMA, PS_TYPE_F32); 193 PS_ARRAY_ADD_SCALAR(job->args, MIN_KRON_RADIUS, PS_TYPE_F32); 194 195 PS_ARRAY_ADD_SCALAR(job->args, maskVal, PS_TYPE_IMAGE_MASK); 196 PS_ARRAY_ADD_SCALAR(job->args, markVal, PS_TYPE_IMAGE_MASK); 197 198 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nmoments199 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfail200 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfaint187 psArrayAdd(job->args, 1, cells->data[j]); // 0 : sources 188 189 PS_ARRAY_ADD_SCALAR(job->args, INNER, PS_TYPE_F32); // 1 190 PS_ARRAY_ADD_SCALAR(job->args, MIN_SN, PS_TYPE_F32); // 2 191 PS_ARRAY_ADD_SCALAR(job->args, RADIUS, PS_TYPE_F32); // 3 192 PS_ARRAY_ADD_SCALAR(job->args, SIGMA, PS_TYPE_F32); // 4 193 PS_ARRAY_ADD_SCALAR(job->args, MIN_KRON_RADIUS, PS_TYPE_F32); // 5 194 195 PS_ARRAY_ADD_SCALAR(job->args, maskVal, PS_TYPE_IMAGE_MASK); // 6 196 PS_ARRAY_ADD_SCALAR(job->args, markVal, PS_TYPE_IMAGE_MASK); // 7 197 198 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // 8 : this is used as a return value for Nmoments 199 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // 9 : this is used as a return value for Nfail 200 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // 10 : this is used as a return value for Nfaint 201 201 202 202 if (!psThreadJobAddPending(job)) { … … 316 316 317 317 // XXX: this must match the above 318 psAbort ("this code is broken: must match psphotSourceStatsReadout above"); 318 319 psArrayAdd(job->args, 1, cells->data[j]); // sources 319 320 psArrayAdd(job->args, 1, recipe); … … 472 473 473 474 // change the value of a scalar on the array (wrap this and put it in psArray.h) 474 scalar = job->args->data[ 7];475 scalar = job->args->data[8]; 475 476 scalar->data.S32 = Nmoments; 476 477 477 scalar = job->args->data[ 8];478 scalar = job->args->data[9]; 478 479 scalar->data.S32 = Nfail; 479 480 480 scalar = job->args->data[ 9];481 scalar = job->args->data[10]; 481 482 scalar->data.S32 = Nfaint; 482 483 -
branches/eam_branches/ipp-20140904/psphot/src/psphotStackParseCamera.c
r34528 r37804 262 262 } 263 263 264 #ifdef MAKE_CHISQ_IMAGE 264 265 // generate an pmFPAimage for the chisqImage 265 266 { … … 293 294 chisqVariance->save = saveChisq; 294 295 } 296 #else 297 (void) saveChisq; 298 #endif // MAKE_CHISQ_IMAGE 295 299 296 300 psTrace("psphot", 1, "Done with psphotStackParseCamera...\n"); -
branches/eam_branches/ipp-20140904/psphot/src/psphotStackReadout.c
r36630 r37804 341 341 // measure non-linear extended source models (exponential, deVaucouleur, Sersic) (sources sorted by S/N) 342 342 psphotExtendedSourceFits (config, view, STACK_RAW); // pass 1 (detections->allSources) 343 344 // measure some parameters for galxy science 345 psphotGalaxyParams (config, view, STACK_RAW); // pass 1 (detections->allSources) 343 346 344 347 // create source children for the OUT filerule (for radial aperture photometry and output) … … 354 357 return psphotReadoutCleanup (config, view, STACK_RAW); 355 358 } 359 // These arrays are no longer needed. The inputs' sources arrays have references to the data 360 psFree (objects); 361 psFree (objectsOut); 356 362 357 363 bool radial_apertures = psMetadataLookupBool(NULL, recipe, "RADIAL_APERTURES"); … … 410 416 // measure aperture photometry corrections 411 417 if (!psphotApResid (config, view, STACK_RAW)) { 412 psFree (objects);413 psFree (objectsOut);414 418 psLogMsg ("psphot", 3, "failed on psphotApResid"); 415 419 return psphotReadoutCleanup (config, view, STACK_RAW); … … 432 436 433 437 logMemStats("final"); 434 #if ( 1)438 #if (0) 435 439 psphotSourceMemory(config, view, STACK_RAW); 436 440 psphotSourceMemory(config, view, STACK_OUT); … … 448 452 psphotStackRemoveChisqFromInputs(config, STACK_RAW); 449 453 #endif 450 451 psFree (objects);452 psFree (objectsOut);453 454 454 455 // create the exported-metadata and free local data -
branches/eam_branches/ipp-20140904/pstamp/scripts/pstamp_checkdependent.pl
- Property svn:mergeinfo changed
/branches/eam_branches/ps2-tc3-20130727/pstamp/scripts/pstamp_checkdependent.pl (added) merged: 36680,37403 /trunk/pstamp/scripts/pstamp_checkdependent.pl (added) merged: 37408,37772,37784
r37354 r37804 24 24 my $ra_max_3PI_hours = 22.5; # disable updates for skycells with ra greater than this (hours) 25 25 my $ra_max_3PI = $ra_max_3PI_hours * 15 * 3.14149 / 180.; # rawExp.ra is in radians 26 27 # verbose flag for parse commands 28 my $parse_verbose = 0; 26 29 27 30 # XXX: put this in a module somewhere … … 49 52 'dbserver=s' => \$ps_dbserver, # postage stamp server dbserver 50 53 'verbose' => \$verbose, 54 'parse-verbose' => \$parse_verbose, 51 55 'save-temps' => \$save_temps, 52 56 'no-update' => \$no_update, … … 78 82 } 79 83 84 print "\n==== Starting dependency checking for $dep_id $stage $stage_id $component at " . (scalar localtime) . ". ====\n"; 85 80 86 if ($label) { 81 87 # rlabel is deprecated. Use one based on the supplied label parameter which is the current label … … 84 90 # (and formerly in pstampparse.pl) is not particularly clean but it's simple. 85 91 my $new_rlabel = 'ps_ud_' . $label; 92 $rlabel = "undefined" if !defined $rlabel; 86 93 if ($new_rlabel ne $rlabel) { 87 94 print "Notice: using $new_rlabel instead of $rlabel for update label.\n"; … … 120 127 } 121 128 122 my $it = runToolAndParseExpectOne($cmd, $ verbose);129 my $it = runToolAndParseExpectOne($cmd, $parse_verbose); 123 130 124 131 my_die("no components found", $PS_EXIT_PROG_ERROR) if ( !$it); … … 136 143 } 137 144 145 138 146 # magic is no longer rquired 139 147 $need_magic = 0; … … 142 150 if ((($it->{state} eq 'full') or ($it->{state} eq 'update')) and ($it->{data_state} eq 'full')) { 143 151 152 print "\nDependency Satisfied for $stage $stage_id $component\n"; 144 153 # This Dependency is satisfied. All done. Release the pstampJobs 145 154 # … … 178 187 } 179 188 180 # assume the fault is transient.189 # hope the fault is transient. 181 190 # fault the dependent to give the fault a chance to correct itself 182 191 my_die("Component faulted on update dep_id: $dep_id", $PS_EXIT_SYS_ERROR); … … 279 288 ($fault eq $PSTAMP_GONE)) { 280 289 281 print "chipRun state is $chip->{chip_id} has state: $state data_state: $data_state fault: $fault cannot update\n";290 print "chipRun state is $chip->{chip_id} has state: $state class_id $chip->{class_id} data_state: $data_state fault: $fault cannot update.\n"; 282 291 my $error_code; 283 292 if (($state eq 'error_cleaned') or ($data_state ='error_cleaned')) { … … 291 300 } elsif ($chip->{state} eq 'goto_cleaned') { 292 301 293 # we don't need to check for full data_state294 # if ($chip->{data_state} eq 'full') {295 302 { 303 print "dependent chip is in state goto_cleaned, changing state to update.\n"; 304 296 305 # cleanup must not be running. Set state to update. If this chip is not 'full' it will be 297 306 # set to be updated the next time this script is invoked 298 # XXX: In the very rarecase that this chip run is actually in the running cleanup pantasks307 # XXX: In the very unlikely case that this chip run is actually in the running cleanup pantasks 299 308 # queue things may get confused but we can live with that 300 309 my $command = "$chiptool -updaterun -set_state update -chip_id $chip_id"; … … 313 322 } 314 323 } elsif (($chip->{data_state} ne 'update') and ($chip->{data_state} ne 'full')) { 324 325 print "Setting chip imfile $chip_id $chip->{class_id} to be updated.\n"; 315 326 316 327 # chiptool does more state checking to insure this isn't done prematurely. … … 343 354 # we've had a number of runs in this limbo state 344 355 356 print "Changing chip run $chip_id to state update for $chip->{class_id} which is in data_state update.\n"; 345 357 my $command = "$chiptool -updaterun -set_state update -chip_id $chip_id"; 346 358 $command .= " -set_label $rlabel" if $rlabel; … … 364 376 return $PSTAMP_GONE; 365 377 } elsif ($fault_count > $max_fault_count) { 366 print " $stage $stage_id has faulted $fault_count times. Giving up\n";378 print "Dependency for $stage $stage_id has been found in fault state $fault_count times. Giving up. Fault: $fault\n"; 367 379 # XXX: stop faulting chips for now 368 380 # $fault = $PSTAMP_GONE; … … 421 433 if (($state =~ /error/) or ($state =~ /purged/) or ($state =~ /scrubbed/) or ($state eq 'drop') or 422 434 ($data_state =~ /error/) or ($data_state =~ /purged/) or ($data_state =~ /scrubbed/) or ($data_state eq 'drop')) { 423 print STDERR "warpRun $warp_id $skycell_id has state $state $data_state faulting jobs \n";435 print STDERR "warpRun $warp_id $skycell_id has state $state $data_state faulting jobs.\n"; 424 436 my $error_code; 425 437 if (($state eq 'error_cleaned') or ($data_state eq 'error_cleaned')) { … … 430 442 return $error_code 431 443 } 432 if (( $data_state eq 'full') and ($metadata->{fault})) {444 if ((($data_state eq 'full') or ($data_state eq 'update')) and ($metadata->{fault})) { 433 445 # fault dependent. 434 446 my $fault = $metadata->{fault}; 435 print STDERR "warp $warp_id $skycell_id faulted: $fault"; 447 print STDERR "warp $warp_id $skycell_id faulted with code: $fault."; 448 # XXX: TODO maybe: If ($fault != 2 and $fault != $PSTAMP_GONE) revert the skycell. The warp task only reverts fault 2 449 # and sometimes warps will fault due to nfs problems that end up with fault = 4;. 436 450 return $fault; 437 451 } 438 452 if ($metadata->{quality} ne 0) { 439 print STDERR "warp $warp_id $skycell_id bad quality on update: $metadata->{quality} \n";453 print STDERR "warp $warp_id $skycell_id bad quality on update: $metadata->{quality}.\n"; 440 454 return $PSTAMP_GONE; 441 455 } … … 448 462 # It's "safe" to set the state to update. If the skycell is not full it will be set to update 449 463 # the next time this task runs 464 print "Change state of warp $warp_id to update.\n"; 450 465 my $command = "$warptool -updaterun -set_state update -warp_id $warp_id"; 451 466 $command .= " -set_label $rlabel" if $rlabel; … … 465 480 # get the list of input chips for this skycell 466 481 my $command = "$warptool -scmap -warp_id $warp_id -skycell_id $skycell_id"; 467 my $data = runToolAndParse($command, $ verbose);482 my $data = runToolAndParse($command, $parse_verbose); 468 483 if (!$data or scalar @$data == 0) { 469 484 # This happens if the chipProcessedImfile disappears which happened when earlier 470 485 # versions of chiptool -revertprocessedimfile didn't check the chipRun.state before 471 486 # deleting the row. 472 print STDERR "failed to find warpSkyCell lMap for warpRun $warp_id skycell_id $skycell_id";487 print STDERR "failed to find warpSkyCellMap for warpRun $warp_id skycell_id $skycell_id"; 473 488 return $PSTAMP_GONE; 474 489 } … … 478 493 my $chip_id; 479 494 foreach my $chip (@$data) { 495 # XXX: change tools to include cam_state (camRun.state). If it is not full the warp updates will never run. 480 496 my $cam_fault = $chip->{cam_fault}; 481 497 if (defined $cam_fault and $cam_fault > 0) { … … 488 504 $chip->{decl} = $metadata->{decl}; 489 505 506 if (0) { 490 507 # if chip has been magicked before require it to be magicked again 491 508 # because the warp pending query requires it. 492 if (0) {493 509 if ($chip->{magicked} < 0) { 494 510 print "Input has been destreaked so we must destreak before warping\n"; … … 514 530 # the reason we defer setting the warp to update is so that we can handle error conditions at previous 515 531 # stages more easily. 532 print "Chips are ready for warp $warp_id $skycell->{skycell_id}. Setting skycell to be updated.\n"; 516 533 my $command = "$warptool -setskyfiletoupdate -warp_id $warp_id -skycell_id $skycell->{skycell_id}"; 517 534 $command .= " -set_label $rlabel" if $rlabel; … … 527 544 } 528 545 } elsif ($chips_ready and $skycell->{data_state} eq 'update' and $skycell->{state} ne 'update') { 546 print "Chips are ready for warp $warp_id $skycell->{skycell_id} but run state is $skycell->{state}. Changing state to update.\n"; 529 547 my $command = "$warptool -updaterun -warp_id $warp_id -set_state update"; 530 548 $command .= " -set_label $rlabel" if $rlabel; … … 566 584 my $skycell_id = $skycell->{skycell_id}; 567 585 568 # if ($metadata->{state} eq 'goto_cleaned' and $metadata->{data_state} eq 'full') {569 586 if ($metadata->{state} eq 'goto_cleaned') { 570 587 # cleanup must not be running. Set state to update. If the skycell is not 'full' it will be 571 # set to be updated the next time this script is invoked 572 print " changing state of diffRun $diff_id from goto_cleaned to update. skycell $skycell_id is full\n";588 # set to be updated the next time this script is invoked. 589 print "Changing state of diffRun $diff_id from goto_cleaned to update.\n"; 573 590 my $command = "$difftool -updaterun -set_state update -diff_id $diff_id"; 574 591 $command .= " -set_label $rlabel" if $rlabel; … … 589 606 # check the state of the template stack 590 607 my $command = "$stacktool -sumskyfile -stack_id $skycell->{stack2}"; 591 my $stack = runToolAndParseExpectOne($command, $ verbose);608 my $stack = runToolAndParseExpectOne($command, $parse_verbose); 592 609 my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack2}", $PS_EXIT_UNKNOWN_ERROR) if !$stack; 593 610 … … 597 614 return $PSTAMP_GONE; 598 615 } 616 print " Stack $skycell->{stack2} is ready.\n"; 599 617 600 618 # now check the warp 601 619 $command = "$warptool -warped -warp_id $skycell->{warp1} -skycell_id $skycell_id"; 602 my $warp = runToolAndParseExpectOne($command, $ verbose);620 my $warp = runToolAndParseExpectOne($command, $parse_verbose); 603 621 my_die("failed to find warpSkyfile for warpRun $skycell->{warp1} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp; 604 622 … … 615 633 } 616 634 # warps are ready fall through and queue the diff update 635 print " Warp $skycell->{warp1} $skycell_id is ready.\n"; 617 636 } elsif ($diff_mode eq $IPP_DIFF_MODE_WARP_WARP) { 618 637 my $command = "$warptool -warped -warp_id $skycell->{warp1} -skycell_id $skycell_id"; 619 my $warp1 = runToolAndParseExpectOne($command, $ verbose);638 my $warp1 = runToolAndParseExpectOne($command, $parse_verbose); 620 639 my_die("failed to find warpSkyfile for warpRun $skycell->{warp1} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp1; 621 640 … … 637 656 } 638 657 $command = "$warptool -warped -warp_id $skycell->{warp2} -skycell_id $skycell_id"; 639 my $warp2 = runToolAndParseExpectOne($command, $ verbose);658 my $warp2 = runToolAndParseExpectOne($command, $parse_verbose); 640 659 my_die("failed to find warpSkyfile for warpRun $skycell->{warp2} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp2; 641 660 … … 661 680 # check the state of the input stack 662 681 my $command = "$stacktool -sumskyfile -stack_id $skycell->{stack1}"; 663 my $stack1 = runToolAndParseExpectOne($command, $ verbose);682 my $stack1 = runToolAndParseExpectOne($command, $parse_verbose); 664 683 my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack1}", $PS_EXIT_UNKNOWN_ERROR) if !$stack1; 665 684 … … 671 690 # check the state of the template stack 672 691 $command = "$stacktool -sumskyfile -stack_id $skycell->{stack2}"; 673 my $stack2 = runToolAndParseExpectOne($command, $ verbose);692 my $stack2 = runToolAndParseExpectOne($command, $parse_verbose); 674 693 my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack2}", $PS_EXIT_UNKNOWN_ERROR) if !$stack2; 675 694 … … 684 703 # check the state of the input stack 685 704 my $command = "$stacktool -sumskyfile -stack_id $skycell->{stack1}"; 686 my $stack = runToolAndParseExpectOne($command, $ verbose);705 my $stack = runToolAndParseExpectOne($command, $parse_verbose); 687 706 my_die("failed to find stackSumSkyfile for stack_id $skycell->{stack1}", $PS_EXIT_UNKNOWN_ERROR) if !$stack; 688 707 … … 695 714 # now check the template warp 696 715 $command = "$warptool -warped -warp_id $skycell->{warp2} -skycell_id $skycell_id"; 697 my $warp = runToolAndParseExpectOne($command, $ verbose);716 my $warp = runToolAndParseExpectOne($command, $parse_verbose); 698 717 my_die("failed to find warpSkyfile for warpRun $skycell->{warp2} skycell_id $skycell_id", $PS_EXIT_UNKNOWN_ERROR) if !$warp; 699 718 … … 736 755 print "skipping $command\n"; 737 756 } 757 } else { 758 print " diff is in update state\n"; 738 759 } 739 760 … … 763 784 my $now = DateTime->now->mjd; 764 785 my $dtime_tool = (DateTime->now->mjd - $start_tool) * 86400.; 765 print "Time to run $program: $dtime_tool\n"; 786 if ($dtime_tool > 0.1) { 787 print "Time to run $program: $dtime_tool\n"; 788 } 766 789 767 790 my $buf = join "", @$stdout_buf; … … 777 800 778 801 my $dtime_parse = (DateTime->now->mjd - $start_parse) * 86400.; 779 print "Time to parse results from $program: $dtime_parse\n"; 802 if ($dtime_parse > 0.1) { 803 print "Time to parse results from $program: $dtime_parse\n"; 804 } 780 805 781 806 return $results; … … 848 873 if (!$dsRun_state) { 849 874 my $command = "$chiptool -listrun -chip_id $stage_id"; 850 my $data = runToolAndParse($command, $ verbose);875 my $data = runToolAndParse($command, $parse_verbose); 851 876 my $chipRun = $data->[0]; 852 877 $dsRun_state = $chipRun->{dsRun_state}; … … 862 887 foreach my $c (@$components) { 863 888 my $command = "$magicdstool -destreakedfile -magic_ds_id $magic_ds_id -component $c"; 864 my $dsfile = runToolAndParseExpectOne($command, $ verbose);889 my $dsfile = runToolAndParseExpectOne($command, $parse_verbose); 865 890 if (!$dsfile) { 866 891 my_die("failed to find magicDSFile for ${stage}Run $stage_id $c", $PS_EXIT_UNKNOWN_ERROR); - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/pstamp/scripts/pstamp_finish.pl
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/pstamp/scripts/pstamp_job_run.pl
- Property svn:mergeinfo changed
/branches/eam_branches/ps2-tc3-20130727/pstamp/scripts/pstamp_job_run.pl (added) merged: 36680,37403 /trunk/pstamp/scripts/pstamp_job_run.pl (added) merged: 37408,37772
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/pstamp/scripts/pstampparse.pl
- Property svn:mergeinfo changed
/branches/eam_branches/ps2-tc3-20130727/pstamp/scripts/pstampparse.pl (added) merged: 36680,37403 /trunk/pstamp/scripts/pstampparse.pl (added) merged: 37408,37772
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/pstamp/scripts/request_finish.pl
- Property svn:mergeinfo changed
/branches/eam_branches/ps2-tc3-20130727/pstamp/scripts/request_finish.pl (added) merged: 37403 /trunk/pstamp/scripts/request_finish.pl (added) merged: 37408,37772
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140904/tools/heather/queuesliceslap2.pl
r37311 r37804 4 4 5 5 6 #$label = "LAP.ThreePi.20130717"; 7 $label = "LAP.ThreePi.20130717.pole3"; 8 #$label = "LAP.ThreePi.20130717.pole3.CNP"; 9 6 $label1 = "LAP.ThreePi.20130717"; 7 $label2 = "LAP.ThreePi.20130717.pole3"; 8 $label3 = "LAP.ThreePi.20130717.pole3.CNP"; 9 #heather done bad things to segments and slices... 10 @labels = ($label1, $label2, $label3); 10 11 @segments = (0,1,2,3,4,5,6,7,8); 12 #@segments=(0,1); 11 13 @segments1 = ( -35, -22,-10,2,14,26,38,50,62); 12 14 @segments2 = ( -22,-10,2,14,26,38,50,62,75); … … 14 16 15 17 @slices = ("00","02","04","06","08","10","12","14","16","18","20","22"); 16 18 #@slices = ("00","02","04"); 19 20 foreach $label (@labels) { 21 17 22 foreach $slice (@slices) { 18 23 … … 21 26 foreach $num (@segments) { 22 27 23 $dvodb = "LAP.PV2. 20130717";24 $minidvodb_group = "LAP.PV2. slice$slice.$segments[$num].cam";28 $dvodb = "LAP.PV2.V2.20130717"; 29 $minidvodb_group = "LAP.PV2.V2.slice$slice.$segments[$num].cam"; 25 30 $dvodb_label = "$minidvodb_group"; 26 31 $ra_min = $slice*15.0; … … 37 42 38 43 } 39 $com2 = "addtool -definebyquery -label $label -set_dvodb $dvodb -set_minidvodb_group LAP.PV2. pole.cam -set_minidvodb -set_label LAP.PV2.pole.cam -stage cam -uncensored -ra_min 0 -ra_max 360 -decl_min 75 -decl_max 90 -dbname gpc1";44 $com2 = "addtool -definebyquery -label $label -set_dvodb $dvodb -set_minidvodb_group LAP.PV2.V2.pole.cam -set_minidvodb -set_label LAP.PV2.V2.pole.cam -stage cam -uncensored -ra_min 0 -ra_max 360 -decl_min 75 -decl_max 90 -dbname gpc1"; 40 45 print "$com2\n"; 41 46 `$com2`; 47 } -
branches/eam_branches/ipp-20140904/tools/heather/queuesliceslap2skycal.pl
r37311 r37804 4 4 5 5 6 #$label= "LAP.ThreePi.20130717";7 #$label= "LAP.ThreePi.20130717.pole3";8 $label = "LAP.ThreePi.20130717.pole3.CNP";9 6 $label1 = "LAP.ThreePi.20130717"; 7 $label2 = "LAP.ThreePi.20130717.pole3"; 8 $label3 = "LAP.ThreePi.20130717.pole3.CNP"; 9 @labels = ($label1,$label2,$label3); 10 10 @segments = (0,1,2,3,4,5,6,7,8); 11 11 @segments1 = ( -35, -22,-10,2,14,26,38,50,62); … … 14 14 15 15 @slices = ("00","02","04","06","08","10","12","14","16","18","20","22"); 16 16 foreach $label (@labels) { 17 17 foreach $slice (@slices) { 18 18 … … 21 21 foreach $num (@segments) { 22 22 23 $dvodb = "LAP.PV2. 20130717";24 $minidvodb_group = "LAP.PV2. slice$slice.$segments[$num].skycal";23 $dvodb = "LAP.PV2.V2.20130717"; 24 $minidvodb_group = "LAP.PV2.V2.slice$slice.$segments[$num].skycal"; 25 25 $dvodb_label = "$minidvodb_group"; 26 26 $ra_min = $slice*15.0; … … 36 36 } 37 37 38 38 39 } 39 $com2 = "addtool -definebyquery -label $label -set_dvodb $dvodb -set_minidvodb_group LAP.PV2. pole.skycal -set_minidvodb -set_label LAP.PV2.pole.skycal -stage skycal -uncensored -ra_min 0 -ra_max 360 -dec_min 75 -dec_max 90 -dbname gpc1";40 $com2 = "addtool -definebyquery -label $label -set_dvodb $dvodb -set_minidvodb_group LAP.PV2.V2.pole.skycal -set_minidvodb -set_label LAP.PV2.V2.pole.skycal -stage skycal -uncensored -ra_min 0 -ra_max 360 -dec_min 75 -dec_max 90 -dbname gpc1"; 40 41 print "$com2\n"; 41 42 `$com2`; 43 } -
branches/eam_branches/ipp-20140904/tools/iasc/getit
r37326 r37804 45 45 chdir $final_destdir or die "failed to chdir to $final_destdir"; 46 46 47 system 'perl /data/ippc18.0/home/ipp/iasc .v2/rename.stamp.outputs.pl *';47 system 'perl /data/ippc18.0/home/ipp/iasc/rename.stamp.outputs.pl *'; 48 48 49 49
Note:
See TracChangeset
for help on using the changeset viewer.
