Changeset 34839
- Timestamp:
- Dec 18, 2012, 5:57:19 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20121130
- Files:
-
- 58 edited
- 6 copied
-
Nebulous-Server/bin/neb-host (modified) (1 diff)
-
Nebulous-Server/bin/neb-voladm (modified) (1 diff)
-
Nebulous-Server/lib/Nebulous/Server/SQL.pm (modified) (2 diffs)
-
ippScripts/Build.PL (modified) (1 diff)
-
ippScripts/MANIFEST (modified) (1 diff)
-
ippScripts/scripts/chip_imfile.pl (modified) (6 diffs)
-
ippScripts/scripts/destreak_restore_camera.pl (modified) (1 prop)
-
ippScripts/scripts/detrend_process_imfile.pl (modified) (2 diffs)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (1 prop)
-
ippScripts/scripts/ipp_cleanup.pl (modified) (32 diffs)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 prop)
-
ippScripts/scripts/regenerate_background.pl (copied) (copied from trunk/ippScripts/scripts/regenerate_background.pl )
-
ippScripts/scripts/skycalibration.pl (modified) (5 diffs)
-
ippScripts/scripts/skycell_jpeg.pl (modified) (2 diffs)
-
ippScripts/scripts/stack_skycell.pl (modified) (2 diffs)
-
ippScripts/scripts/warp_skycell.pl (modified) (7 diffs)
-
ippTasks (modified) (1 prop)
-
ippTasks/Makefile.am (modified) (1 diff)
-
ippTasks/addstar.pro (modified) (2 diffs)
-
ippTasks/bg.regeneration.pro (copied) (copied from trunk/ippTasks/bg.regeneration.pro )
-
ippTasks/nightly_science.pro (modified) (1 diff)
-
ippTasks/science.cleanup.pro (modified) (8 diffs)
-
ippTasks/skycal.pro (modified) (7 diffs)
-
ippTasks/staticsky.pro (modified) (2 diffs)
-
ippTasks/summit.copy.pro (modified) (1 diff)
-
ippTasks/survey.pro (modified) (6 diffs)
-
ippToPsps (modified) (1 prop)
-
ippToPsps/config/OB/tables.vot (modified) (3 diffs)
-
ippToPsps/jython/objectbatch.py (modified) (5 diffs)
-
ippToPsps/jython/stackbatch.py (modified) (3 diffs)
-
ippToPsps/src/Dvo.c (modified) (2 diffs)
-
ippTools/configure.ac (modified) (1 diff)
-
ippTools/share/Makefile.am (modified) (4 diffs)
-
ippTools/share/camtool_find_pendingimfile.sql (modified) (1 prop)
-
ippTools/share/camtool_pendingcleanuprun.sql (modified) (1 diff)
-
ippTools/share/chiptool_pendingcleanupimfile_all.sql (copied) (copied from trunk/ippTools/share/chiptool_pendingcleanupimfile_all.sql )
-
ippTools/share/chiptool_pendingcleanuprun.sql (modified) (1 diff)
-
ippTools/share/chiptool_setimfiletoupdate.sql (modified) (1 prop)
-
ippTools/share/difftool_pendingcleanuprun.sql (modified) (4 diffs)
-
ippTools/share/difftool_pendingcleanupskyfile_all.sql (copied) (copied from trunk/ippTools/share/difftool_pendingcleanupskyfile_all.sql )
-
ippTools/share/pstamptool_revertdependent.sql (modified) (1 diff)
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 diff, 1 prop)
-
ippTools/share/stacktool_inputskyfile.sql (modified) (1 diff)
-
ippTools/share/stacktool_pendingcleanuprun.sql (modified) (1 diff)
-
ippTools/share/stacktool_tobkg.sql (copied) (copied from trunk/ippTools/share/stacktool_tobkg.sql )
-
ippTools/share/staticskytool_defineskycalrun.sql (modified) (2 diffs)
-
ippTools/share/staticskytool_pendingskycalrun.sql (modified) (1 diff)
-
ippTools/share/warptool_pendingcleanuprun.sql (modified) (1 diff)
-
ippTools/share/warptool_pendingcleanupskyfile_all.sql (copied) (copied from trunk/ippTools/share/warptool_pendingcleanupskyfile_all.sql )
-
ippTools/share/warptool_towarped.sql (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/chiptool.c (modified) (2 diffs)
-
ippTools/src/chiptoolConfig.c (modified) (1 diff)
-
ippTools/src/difftool.c (modified) (3 diffs)
-
ippTools/src/difftoolConfig.c (modified) (3 diffs)
-
ippTools/src/magictool.c (modified) (1 prop)
-
ippTools/src/stacktool.c (modified) (4 diffs)
-
ippTools/src/stacktool.h (modified) (1 diff)
-
ippTools/src/stacktoolConfig.c (modified) (3 diffs)
-
ippTools/src/staticskytool.c (modified) (9 diffs)
-
ippTools/src/staticskytoolConfig.c (modified) (4 diffs)
-
ippTools/src/warptool.c (modified) (5 diffs)
-
ippTools/src/warptoolConfig.c (modified) (2 diffs)
-
magic/censorObjects/src/censorLoop.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121130/Nebulous-Server/bin/neb-host
r32919 r34839 141 141 $dbh->commit; 142 142 143 my $format = "%-15s %-15s %-7s %-8s %-9s %-5s % s\n";144 my @columns = qw(host name mounted allocate available xattr note);143 my $format = "%-15s %-15s %-7s %-8s %-9s %-5s %15s %s\n"; 144 my @columns = qw(host name mounted allocate available xattr last_modified note); 145 145 printf($format, @columns); 146 146 -
branches/eam_branches/ipp-20121130/Nebulous-Server/bin/neb-voladm
r32615 r34839 68 68 if (defined $allocate and $allocate !~ m/^[01]$/) 69 69 or (defined $available and $available !~ m/^[01]$/) 70 or (defined $xattr and $xattr !~ m/^[012 ]$/);70 or (defined $xattr and $xattr !~ m/^[0123]$/); 71 71 } 72 72 -
branches/eam_branches/ipp-20121130/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r33826 r34839 389 389 mountedvol.vol_id IS NOT NULL as mounted, 390 390 v.cab_id, 391 v.last_modified, 391 392 v.note 392 393 FROM volume AS v … … 694 695 cab_id INT, 695 696 note VARCHAR(255), 697 last_modified TIMESTAMP NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, # SC: Added by Haydn with ALTER TABLE(?) on 2012-12-03 696 698 PRIMARY KEY(vol_id), 697 699 UNIQUE KEY(name), -
branches/eam_branches/ipp-20121130/ippScripts/Build.PL
r33627 r34839 128 128 scripts/listvideocells.pl 129 129 scripts/skycalibration.pl 130 scripts/regenerate_background.pl 130 131 )], 131 132 dist_abstract => 'Scripts for running the Pan-STARRS IPP', -
branches/eam_branches/ipp-20121130/ippScripts/MANIFEST
r31435 r34839 46 46 scripts/skycell_jpeg.pl 47 47 scripts/lap_science.pl 48 scripts/regenerate_background.pl 48 49 t/00_distribution.t -
branches/eam_branches/ipp-20121130/ippScripts/scripts/chip_imfile.pl
r33052 r34839 150 150 $outputStats = prepare_output("PPIMAGE.STATS", $outroot, $class_id, 1); 151 151 my $do_binned_images = 1; 152 152 153 if ($run_state eq 'new') { 153 154 # prepare the files that are only created for a new run … … 586 587 587 588 # check whether psphot outputs should be regenerated. 588 # Whether we need to or not is a somewhat complicated question. 589 # Whether we need to or not was a somewhat complicated question. Since we clean cmfs now we only rerun 590 # photometry if the psf file has gone missing since it is needed to run warps 591 589 592 sub rerun_photometry 590 593 { … … 594 597 or &my_die("Missing entry from camera config: PSPHOT.OUTPUT", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 595 598 599 my $update_sources_if_gone = 0; # set this to regenerate sources if gone. 600 # We no longer do this as of 2012-12 596 601 my $make_sources = 0; 597 602 my $sources_available = 0; … … 599 604 $sources_available = 1; 600 605 } else { 601 carp "WARNING: photometry sources file $outputSources is not available"; 602 my $gone; 603 if (storage_object_exists($outputSources, \$gone)) { 604 # check whether the file is permanantely or temporarily gone 605 if ($gone) { 606 carp "WARNING: photometry sources storage object exists but all instances are permanently gone"; 606 if ($update_sources_if_gone) { 607 carp "WARNING: photometry sources file $outputSources is not available"; 608 my $gone; 609 if (storage_object_exists($outputSources, \$gone)) { 610 # check whether the file is permanantely or temporarily gone 611 if ($gone) { 612 carp "WARNING: photometry sources storage object exists but all instances are permanently gone"; 613 $make_sources = 1; 614 } 615 } else { 616 # storage object must have been deleted 607 617 $make_sources = 1; 608 618 } 609 } else {610 # storage object must have been deleted611 $make_sources = 1;612 619 } 613 620 } … … 616 623 my $psf_available = 0; 617 624 my $outputPsf = $ipprc->filename("PSPHOT.PSF.SAVE", $outroot, $class_id) 618 or &my_die("Missing entry from camera config: PSPHOT.PSF.SAVE", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 625 or &my_die("Missing entry from camera config: PSPHOT.PSF.SAVE", 626 $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR); 627 619 628 if ($ipprc->file_exists($outputPsf)) { 620 629 $psf_available = 1; … … 638 647 } 639 648 640 # if either of the files are gone rerun photometry unless the other file is temporarily not available 641 642 if (!$sources_available && !$make_sources) { 643 # destreak will die if the sources is not available 644 &my_die("PSPHOT.SOURCES is missing but we cannot regenerate it", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 645 } 649 if ($update_sources_if_gone) { 650 if (!$sources_available && !$make_sources) { 651 # destreak will die if the sources is not available 652 # but magic is dead.... 653 &my_die("PSPHOT.SOURCES is missing but we cannot regenerate it", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 654 } 655 } 656 646 657 if (!$psf_available && !$make_psf) { 647 658 # warp updates need the psf file -
branches/eam_branches/ipp-20121130/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippScripts/scripts/destreak_restore_camera.pl (added) merged: 34772 /trunk/ippScripts/scripts/destreak_restore_camera.pl (added) merged: 34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippScripts/scripts/detrend_process_imfile.pl
r33666 r34839 27 27 my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1); 28 28 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 29 my $nebrepair = can_run('neb-repair') or (warn "Can't find neb-repair" and $missing_tools = 1); 30 29 31 if ($missing_tools) { 30 32 warn("Can't find required tools."); … … 124 126 # Run ppImage 125 127 unless ($no_op) { 128 my $repair_cmd = "$nebrepair $input_uri"; 129 my ($repair_success, $repair_error_code, $repair_full_buf, $repair_stdout_buf, $repair_stderr_buf ) = run(command => $repair_cmd, verbose => $verbose); 130 unless ($repair_success) { 131 &my_die("Unable to attempt repair: $input_uri $repair_error_code", $det_id, $exp_id, $class_id $PS_EXIT_SYS_ERROR); 132 } 133 134 126 135 my $command = "$ppImage -file $input_uri $outroot"; 127 136 $command .= " -recipe PPIMAGE $ppimage_recipe"; -
branches/eam_branches/ipp-20121130/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippScripts/scripts/ipp_apply_burntool_single.pl merged: 34772,34786 /trunk/ippScripts/scripts/ipp_apply_burntool_single.pl merged: 34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippScripts/scripts/ipp_cleanup.pl
r33664 r34839 18 18 19 19 # Parse the command-line arguments 20 my ($stage, $camera, $stage_id, $mode, $path_base, $dbname, $verbose, $no_op, $helplist, $logfile); 20 my ($stage, $camera, $stage_id, $mode, $path_base, $dbname, $verbose, $no_op, $helplist, $logfile, $check_all); 21 my $very_verbose = 0; 22 23 # this gets set to 1 the first time we set the corresponding destreak run to be cleaned 24 #my $ds_done = 0; 25 # magic is dead 26 my $ds_done = 1; 27 21 28 GetOptions('stage=s' => \$stage, # which analysis stage to clean? 22 29 'camera|i=s' => \$camera, # user-supplied camera name … … 24 31 'mode|m=s' => \$mode, # cleanup mode (clean / purge) 25 32 'path_base=s' => \$path_base, # basename for files 33 'check-all' => \$check_all, # if set clean all chips regardless of data_state 26 34 'dbname|d=s' => \$dbname, # Database name 27 35 'verbose' => \$verbose, # Print to stdout … … 56 64 $ipprc->redirect_output($logfile) or 57 65 &my_die("Unable to redirect ouput", $stage, $stage_id, $PS_EXIT_UNKNOWN_ERROR) if $logfile; 66 67 68 my $bzip2 = can_run('bzip2') or die 'cannot find bzip2\n'; 58 69 59 70 # set this to 1 to enable checking for files on dead nodes … … 91 102 # this stage uses 'chiptool' 92 103 my $chiptool = can_run('chiptool') or die "Can't find chiptool"; 104 my $censorObjects = can_run('censorObjects') or die "Can't find censorObjects"; 93 105 94 106 # Get list of component imfiles … … 96 108 my $imfiles; # Array of component files 97 109 my $command = "$chiptool -pendingcleanupimfile -chip_id $stage_id"; # Command to run 110 $command .= ' -all' if ($check_all); 98 111 $command .= " -dbname $dbname" if defined $dbname; 99 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 112 113 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 114 = run(command => $command, verbose => $very_verbose); 100 115 unless ($success) { 101 116 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 114 129 unless ($success) { 115 130 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 116 &my_die("Unable to perform chiptool : $error_code", "chip", $stage_id, $error_code);131 &my_die("Unable to perform chiptool -processedimfile: $error_code", "chip", $stage_id, $error_code); 117 132 } 118 133 exit 0; … … 123 138 &my_die("Unable to parse metadata config doc", "chip", $stage_id, $PS_EXIT_PROG_ERROR); 124 139 140 my $numchips = scalar @$imfiles; 141 print "Found $numchips to clean\n"; 142 143 my $clean_sources = 0; 144 if ((scalar @$imfiles > 0) and ($mode eq 'goto_cleaned')) { 145 # go and find the smf file(s) for the associated camRun and check the status of the file 146 # if a good one is found we have the sources for this chipRun and thus can clean the cmfs 147 my $command = "$chiptool -listrun -chip_id $stage_id"; 148 $command .= " -dbname $dbname" if defined $dbname; 149 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $very_verbose); 150 unless ($success) { 151 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 152 &my_die("Unable to perform chiptool -listrun: $error_code", "chip", $stage_id, $error_code); 153 } 154 my $entries = $mdcParser->parse_list(join "", @$stdout_buf) or 155 &my_die("Unable to parse metadata config doc", "chip", $stage_id, $PS_EXIT_PROG_ERROR); 156 my $good_smf = 0; 157 foreach my $entry (@$entries) { 158 my $camRun_state = $entry->{camRun_state}; 159 next if $camRun_state ne 'full'; 160 my $cam_id = $entry->{cam_id}; 161 if (!$cam_id) { 162 carp('no cam_id for listrun entry'); 163 next; 164 } 165 my $cam_path_base = $entry->{cam_path_base}; 166 if ( !defined $cam_path_base ) { 167 carp("no path_base for $cam_id\n"); 168 next; 169 } 170 171 # XXX: This assumes that the filerules are filerules-split 172 my $smf = $ipprc->filename("PSASTRO.OUTPUT", $cam_path_base); 173 if (!$ipprc->file_exists($smf)) { 174 carp("smf for $cam_path_base not found"); 175 next; 176 } 177 # we run the program censorObjects in the check mode 178 # If this program succeeds the smf is a valid fits file and each of the 179 # extensions was succesfully read. 180 # XXX: create a new program outside of magic that performs this check 181 182 my $command = "$censorObjects -checkinputonly -file $smf"; 183 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 184 run(command => $command, verbose => $very_verbose); 185 unless ($success) { 186 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 187 print STDERR "censorObjects failed:\n"; 188 print STDERR "\nSTDOUT:\n" . join "", @$stdout_buf; 189 print STDERR "\nSTDERR:\n" . join "", @$stderr_buf; 190 &my_die("Unable to perform censorObjects -checkinputonly: $error_code", "chip", $stage_id, $error_code); 191 } 192 $good_smf++; 193 } 194 if ($good_smf) { 195 # we have a good one so we can clean the sources 196 $clean_sources = 1; 197 print "Found $good_smf good smf files will clean sources\n"; 198 } else { 199 print "Unable to find good smf file will NOT clean sources\n"; 200 } 201 } 202 125 203 # loop over all of the imfiles, determine the path_base and class_id for each 204 my $num_errors = 0; 126 205 foreach my $imfile (@$imfiles) { 127 206 my $class_id = $imfile->{class_id}; 128 207 my $path_base = $imfile->{path_base}; 208 my $data_state = $imfile->{data_state}; 129 209 my $status = 1; 130 210 $status = 0 unless defined $path_base and $path_base ne "NULL"; 131 211 132 my $poor_quality = $imfile->{quality} > 0; 212 my $quality = $imfile->{quality}; 213 my $good_quality = ($quality == 0); 214 215 print "Starting cleanup for $class_id\n"; 133 216 134 217 # don't clean up unless the data needed to update is available 135 218 # modes goto_purged and goto_scrubbed will remove files even if the config is non-existent 136 219 # goto_scrubbed now requires the config file to not exist. 137 if ($status and !$poor_quality) {220 if ($status and $good_quality) { 138 221 if ($mode eq "goto_cleaned") { 139 222 my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id); 140 223 141 224 unless ($ipprc->file_exists($config_file)) { 225 my $fault = $imfile->{fault}; 226 142 227 if (file_gone($config_file)) { 143 print STDERR "forcing cleanup for chipRun $stage_id $class_id " 228 # config file was lost. Clean up. If the chip is ever updated a new config 229 # file will be created 230 print STDERR "forcing cleanup chip $stage_id $class_id fault: $fault quality: $quality" 144 231 . " because config file ($config_file) is gone\n"; 232 } elsif ($fault == 0 and $quality == 0) { 233 print STDERR "skipping cleaning up chip $stage_id $class_id fault: $fault quality: $quality" 234 . " because config file ($config_file) is missing\n"; 235 $status = 0; 145 236 } else { 146 print STDERR "skipping cleanup for chipRun $stage_id $class_id "147 . " because config file ($config_file) is missing\n";148 $status = 0;237 # config file is missing but this is a bad chip anyways so clean it 238 print STDERR "cleaning up chip $stage_id $class_id fault: $fault quality: $quality" 239 . " even though config file ($config_file) is missing\n"; 149 240 } 150 241 } … … 154 245 155 246 if ($ipprc->file_exists($config_file)) { 156 print STDERR "skipping scrubbed for chip Run$stage_id $class_id "247 print STDERR "skipping scrubbed for chip $stage_id $class_id " 157 248 . " because config file ($config_file) is present\n"; 158 249 $status = 0; … … 165 256 my @files = (); 166 257 167 # delete the temporary image datafiles168 # addFilename (\@files, "PPIMAGE.OUTPUT", $path_base, $class_id);169 # addFilename (\@files, "PPIMAGE.OUTPUT.MASK", $path_base, $class_id);170 # addFilename (\@files, "PPIMAGE.OUTPUT.VARIANCE", $path_base, $class_id);171 258 addFilename (\@files, "PPIMAGE.CHIP", $path_base, $class_id, 1); 172 259 addFilename (\@files, "PPIMAGE.CHIP.MASK", $path_base, $class_id, 1); 173 260 addFilename (\@files, "PPIMAGE.CHIP.VARIANCE", $path_base, $class_id, 1); 174 261 addFilename (\@files, "PPIMAGE.PATTERN", $path_base, $class_id, 0); 262 if ($clean_sources) { 263 addFilename (\@files, "PSPHOT.OUTPUT", $path_base, $class_id); 264 addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id); 265 } 175 266 if ($mode eq "goto_purged") { 176 267 # additional files to remove for 'purge' mode 268 if (!$clean_sources) { 269 # these weren't added above but we do want to clean it 270 addFilename (\@files, "PSPHOT.OUTPUT", $path_base, $class_id); 271 addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id); 272 } 273 274 # background model is needed to build stack background images so we do not remove it 275 # addFilename (\@files, "PSPHOT.BACKMDL", $path_base, $class_id); 276 277 addFilename (\@files, "PSPHOT.PSF.SAVE", $path_base, $class_id); 177 278 addFilename (\@files, "PPIMAGE.OUTPUT.FPA1", $path_base, $class_id); 178 279 addFilename (\@files, "PPIMAGE.OUTPUT.FPA2", $path_base, $class_id); 179 addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id); # clean? 180 addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id); # clean? 280 addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id); 181 281 addFilename (\@files, "PPIMAGE.JPEG1", $path_base, $class_id); 182 282 addFilename (\@files, "PPIMAGE.JPEG2", $path_base, $class_id); 183 addFilename (\@files, "PPIMAGE.STATS", $path_base, $class_id); #clean?283 addFilename (\@files, "PPIMAGE.STATS", $path_base, $class_id); 184 284 addFilename (\@files, "PPIMAGE.CONFIG", $path_base, $class_id); 185 285 } … … 188 288 $status = &delete_files (\@files); 189 289 } 290 bzip2_file("LOG.IMFILE", $path_base, $class_id); 291 bzip2_file("LOG.IMFILE.UPDATE", $path_base, $class_id); 190 292 191 293 if ($status) { 294 my $update_chip = 1; 192 295 my $command = "$chiptool -chip_id $stage_id -class_id $class_id"; 193 296 if ($mode eq "goto_purged") { 194 297 $command .= " -topurgedimfile"; 298 if ($data_state eq 'purged') { 299 $update_chip = 0; 300 } 195 301 } 196 302 elsif ($mode eq "goto_cleaned") { 197 303 $command .= " -tocleanedimfile"; 304 if ($data_state eq 'cleaned') { 305 $update_chip = 0; 306 } 198 307 } 199 308 elsif ($mode eq "goto_scrubbed") { 200 309 $command .= " -toscrubbedimfile"; 201 } 202 203 $command .= " -dbname $dbname" if defined $dbname; 204 205 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 206 run(command => $command, verbose => $verbose); 207 unless ($success) { 208 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 209 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code); 210 } 211 212 set_destreak_goto_cleaned(); 213 310 if ($data_state eq 'scrubbed') { 311 $update_chip = 0; 312 } 313 } 314 315 if ($update_chip) { 316 $command .= " -dbname $dbname" if defined $dbname; 317 318 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 319 run(command => $command, verbose => $verbose); 320 unless ($success) { 321 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 322 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code); 323 } 324 set_destreak_goto_cleaned(); 325 } 214 326 } else { 327 $num_errors++; 215 328 216 329 # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*) … … 218 331 $command .= " -dbname $dbname" if defined $dbname; 219 332 220 if (0) {221 # XXX Don't set components to error cleaned anymore222 333 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 223 334 run(command => $command, verbose => $verbose); … … 226 337 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code); 227 338 } 228 }229 339 230 340 # We want to flag the run as well, to avoid attempting to reprocess the same data over and over again. … … 241 351 } 242 352 } 353 print "Cleanup completed for chip_id $stage_id."; 354 print " num_errors: $num_errors" if $num_errors; 355 print "\n"; 243 356 exit 0; 244 357 } … … 350 463 my $skyfiles; # Array of component files 351 464 my $command = "$warptool -pendingcleanupskyfile -warp_id $stage_id"; # Command to run 465 $command .= ' -all' if $check_all; 352 466 $command .= " -dbname $dbname" if defined $dbname; 353 467 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 354 run(command => $command, verbose => $ver bose);468 run(command => $command, verbose => $very_verbose); 355 469 unless ($success) { 356 470 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 378 492 &my_die("Unable to parse metadata config doc", "warp", $stage_id, $PS_EXIT_PROG_ERROR); 379 493 494 my $numskycells = scalar @$skyfiles; 495 print "Found $numskycells to clean\n"; 496 380 497 my @files = (); 498 my $num_errors = 0; 381 499 foreach my $skyfile (@$skyfiles) { 382 500 my $path_base = $skyfile->{path_base}; 383 501 my $skycell_id = $skyfile->{skycell_id}; 502 my $data_state = $skyfile->{data_state}; 384 503 385 504 my $status = 1; … … 391 510 392 511 unless ($ipprc->file_exists($config_file)) { 512 my $fault = $skyfile->{fault}; 513 my $quality = $skyfile->{quality}; 393 514 if (file_gone($config_file)) { 394 print STDERR "forcing cleanup for warpRun $stage_id $skycell_id" . 395 " because config file is gone\n"; 515 print STDERR "forcing cleanup warp $stage_id $skycell_id fault: $fault quality: $quality" 516 . " because config file ($config_file) is gone\n"; 517 } elsif ($fault == 0 and $quality == 0) { 518 print STDERR "skipping cleaning up warp $stage_id $skycell_id fault: $fault quality: $quality" 519 . " because config file ($config_file) is missing\n"; 520 $status = 0; 396 521 } else { 397 print STDERR "skipping cleanup for warpRun $stage_id $skycell_id" .398 " because config file is missing\n";399 $status = 0;522 # config file is missing but this is a bad warp anyways so clean it 523 print STDERR "cleaning up warp $stage_id $skycell_id fault: $fault quality: $quality" 524 . " even though config file ($config_file) is missing\n"; 400 525 } 401 526 } … … 413 538 414 539 if ($status) { 415 if ($skyfile->{quality} != 8007) { 540 # XXX: what is special about quality == 8007? 541 if ($skyfile->{quality} != 8007 || $check_all) { 416 542 my @files = (); 417 543 … … 420 546 addFilename(\@files, "PSWARP.OUTPUT.MASK", $path_base, $skycell_id, 1); 421 547 addFilename(\@files, "PSWARP.OUTPUT.VARIANCE", $path_base, $skycell_id, 1); 422 # addFilename(\@files, "PSWARP.OUTPUT.SOURCES", $path_base, $skycell_id); 548 # these are rebuilt during update so we can delete them here 549 addFilename(\@files, "PSWARP.OUTPUT.SOURCES", $path_base, $skycell_id); 550 addFilename(\@files, "SKYCELL.TEMPLATE", $path_base, $skycell_id ); 423 551 if ($mode eq "goto_purged") { 424 552 # additional files to remove for 'purge' mode … … 426 554 addFilename(\@files, "PSWARP.BIN2", $path_base, $skycell_id ); 427 555 addFilename(\@files, "SKYCELL.STATS", $path_base, $skycell_id ); 428 # addFilename(\@files, "PSPHOT.PSF.SKY.SAVE", $path_base); 429 430 # XXX: do we want to delete these? 556 addFilename(\@files, "SKYCELL.STATS.UPDATE", $path_base, $skycell_id ); 557 addFilename(\@files, "PSWARP.CONFIG", $path_base, $skycell_id); 558 559 # XXX: do we want to delete these? trace file is empty 431 560 # addFilename(\@files, "TRACE.EXP", $path_base, $skycell_id); 432 # addFilename(\@files, "PSWARP.CONFIG", $path_base, $skycell_id); 433 } 434 # actual command to delete the files 561 } 562 # actual command to delete the files 435 563 $status = &delete_files (\@files); 436 564 } 437 565 } 566 bzip2_file("LOG.EXP", $path_base, $skycell_id); 567 bzip2_file("LOG.EXP.UPDATE", $path_base, $skycell_id); 438 568 439 569 if ($status) { 570 my $update_skyfile = 1; 440 571 my $command = "$warptool -warp_id $stage_id -skycell_id $skycell_id"; 441 572 if ($mode eq "goto_purged") { 442 573 $command .= " -topurgedskyfile"; 574 if ($data_state eq 'purged') { 575 $update_skyfile = 0; 576 } 443 577 } 444 578 elsif ($mode eq "goto_cleaned") { 445 579 $command .= " -tocleanedskyfile"; 580 if ($data_state eq 'cleaned') { 581 $update_skyfile = 0; 582 } 446 583 } 447 584 elsif ($mode eq "goto_scrubbed") { 448 585 $command .= " -toscrubbedskyfile"; 449 } 450 $command .= " -dbname $dbname" if defined $dbname; 451 452 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 453 run(command => $command, verbose => $verbose); 586 if ($data_state eq 'scrubbed') { 587 $update_skyfile = 0; 588 } 589 } 590 $command .= " -dbname $dbname" if defined $dbname; 591 592 if ($update_skyfile) { 593 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 594 run(command => $command, verbose => $verbose); 595 unless ($success) { 596 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 597 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 598 } 599 600 set_destreak_goto_cleaned(); 601 } 602 603 } else { 604 $num_errors++; 605 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state"; 606 $command .= " -dbname $dbname" if defined $dbname; 607 608 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 609 run(command => $command, verbose => $verbose); 454 610 unless ($success) { 455 611 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 457 613 } 458 614 459 set_destreak_goto_cleaned(); 460 461 } else { 462 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state"; 463 $command .= " -dbname $dbname" if defined $dbname; 464 465 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 615 # We want to flag the run as well, to avoid attempting to reprocess the same data over and over again. 616 $command = "$warptool -warp_id $stage_id -updaterun -set_state $error_state"; 617 $command .= " -dbname $dbname" if defined $dbname; 618 619 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 466 620 run(command => $command, verbose => $verbose); 467 621 unless ($success) { … … 469 623 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code); 470 624 } 471 472 # exit $PS_EXIT_UNKNOWN_ERROR; 473 } 474 } 625 } 626 } 627 print "Cleanup completed for warp_id $stage_id."; 628 print " num_errors: $num_errors" if $num_errors; 629 print "\n"; 475 630 exit 0; 476 631 } … … 603 758 &my_die("Unable to perform stacktool: $error_code", "stack", $stage_id, $error_code); 604 759 } 605 # exit $PS_EXIT_UNKNOWN_ERROR;606 760 } 607 761 } … … 619 773 my $skyfiles; # Array reference of component files 620 774 my $command = "difftool -pendingcleanupskyfile -diff_id $stage_id"; # Command to run 775 $command .= ' -all' if $check_all; 621 776 $command .= " -dbname $dbname" if defined $dbname; 622 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $ver bose);777 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $very_verbose); 623 778 unless ($success) { 624 779 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 646 801 &my_die("Unable to parse metadata config doc", "diff", $stage_id, $PS_EXIT_PROG_ERROR); 647 802 803 my $num_errors = 0; 648 804 my @files = (); 649 805 foreach my $skyfile (@{ $skyfiles }) { 650 806 my $path_base = $skyfile->{path_base}; 651 807 my $skycell_id = $skyfile->{skycell_id}; 808 my $data_state = $skyfile->{data_state}; 652 809 653 810 my $status = 1; … … 661 818 my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id); 662 819 820 if (0) { 663 821 unless ($ipprc->file_exists($config_file)) { 664 822 if (file_gone($config_file)) { … … 672 830 } 673 831 } 832 unless ($ipprc->file_exists($config_file)) { 833 my $fault = $skyfile->{fault}; 834 my $quality = $skyfile->{quality}; 835 if (file_gone($config_file)) { 836 print STDERR "forcing cleanup diff $stage_id $skycell_id fault: $fault quality: $quality" 837 . " because config file ($config_file) is gone\n"; 838 } elsif ($fault == 0 and $quality == 0) { 839 print STDERR "skipping cleaning up diff $stage_id $skycell_id fault: $fault quality: $quality" 840 . " because config file ($config_file) is missing\n"; 841 $status = 0; 842 } else { 843 # config file is missing but this is a bad diff anyways so clean it 844 print STDERR "cleaning up diff $stage_id $skycell_id fault: $fault quality: $quality" 845 . " even though config file ($config_file) is missing\n"; 846 } 847 } 848 } 674 849 elsif ($mode eq "goto_scrubbed") { 675 850 my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id); … … 712 887 713 888 } 714 # print STDERR "MY FILES: @files\n";715 889 $status = &delete_files(\@files); 716 890 } 717 # print STDERR "MY STATUS: $status\n"; 891 892 bzip2_file("LOG.EXP", $path_base, $skycell_id); 893 bzip2_file("LOG.EXP.UPDATE", $path_base, $skycell_id); 894 718 895 if ($status) { 719 896 my $command = "$difftool -diff_id $stage_id -skycell_id $skycell_id"; 897 my $update_skyfile = 1; 720 898 721 899 if ($mode eq "goto_purged") { 722 900 $command .= " -topurgedskyfile"; 901 if ($data_state eq 'purged') { 902 $update_skyfile = 0; 903 } 723 904 } 724 905 elsif ($mode eq "goto_cleaned") { 725 906 $command .= " -tocleanedskyfile"; 907 if ($data_state eq 'cleaned') { 908 $update_skyfile = 0; 909 } 726 910 } 727 911 elsif ($mode eq "goto_scrubbed") { 728 912 $command .= " -toscrubbedskyfile"; 729 } 730 913 if ($data_state eq 'scrubbed') { 914 $update_skyfile = 0; 915 } 916 } 917 918 $command .= " -dbname $dbname" if defined $dbname; 919 920 if ($update_skyfile) { 921 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 922 run(command => $command, verbose => $verbose); 923 unless ($success) { 924 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 925 &my_die("Unable to perform difftool: $error_code", "diff", $stage_id, $error_code); 926 } 927 set_destreak_goto_cleaned(); 928 } 929 930 931 } else { 932 $num_errors++; 933 my $command = "$difftool -updatediffskyfile -diff_id $stage_id -skycell_id $skycell_id -set_state $error_state"; 731 934 $command .= " -dbname $dbname" if defined $dbname; 732 935 … … 738 941 } 739 942 740 set_destreak_goto_cleaned(); 741 742 } else { 743 my $command = "$difftool -updaterun -diff_id $stage_id -set_state $error_state"; 744 745 $command .= " -dbname $dbname" if defined $dbname; 746 747 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 943 $command = "$difftool -updaterun -diff_id $stage_id -set_state $error_state"; 944 945 $command .= " -dbname $dbname" if defined $dbname; 946 947 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 748 948 run(command => $command, verbose => $verbose); 749 949 unless ($success) { … … 751 951 &my_die("Unable to perform difftool: $error_code", "diff", $stage_id, $error_code); 752 952 } 753 # exit $PS_EXIT_UNKNOWN_ERROR; 754 } 755 } 953 } 954 } 955 print "Cleanup completed for diff_id $stage_id."; 956 print " num_errors: $num_errors" if $num_errors; 957 print "\n"; 756 958 exit 0; 757 959 } … … 1917 2119 1918 2120 foreach my $file (@$files) { 1919 print STDERR "unlinking $stage $stage_id $file\n" ;2121 print STDERR "unlinking $stage $stage_id $file\n" if $very_verbose; 1920 2122 1921 2123 my $error_code = $ipprc->kill_file($file); … … 2008 2210 } 2009 2211 2010 # this gets set to 1 the first time we set the corresponding destreak run to be cleaned2011 my $ds_done = 0;2012 2212 sub set_destreak_goto_cleaned { 2013 2213 … … 2027 2227 } 2028 2228 2229 sub bzip2_file { 2230 my $filerule = shift; 2231 my $path_base = shift; 2232 my $component = shift; 2233 2234 my $filename = $ipprc->filename($filerule, $path_base, $component); 2235 if (!$ipprc->file_exists($filename)) { 2236 return 1; 2237 } 2238 if (my $resolved = $ipprc->file_resolve($filename)) { 2239 my $bzip2_filename = $filename . '.bz2'; 2240 if ($ipprc->file_exists($bzip2_filename)) { 2241 $ipprc->kill_file($bzip2_filename); 2242 } 2243 my $bzip2_file = $ipprc->file_create($bzip2_filename); 2244 my_die("Unable to create $bzip2_filename", $stage_id, $PS_EXIT_SYS_ERROR) unless $bzip2_file; 2245 2246 my $command = "$bzip2 < $resolved > $bzip2_file"; 2247 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 2248 run(command => $command, verbose => $very_verbose); 2249 if ($success) { 2250 # success delete the original file 2251 my $error_code = $ipprc->kill_file($filename); 2252 } else { 2253 # if bzip2 failed. Carry on but don't delete the existing file 2254 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 2255 print STDERR "Failed to bzip2 $filename: $error_code\n"; 2256 return 0; 2257 } 2258 } 2259 return 1; 2260 } 2261 2029 2262 # XXX we currently do not set the error state in the db on my_die 2030 2263 sub my_die -
branches/eam_branches/ipp-20121130/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippScripts/scripts/magic_destreak.pl (added) merged: 34772 /trunk/ippScripts/scripts/magic_destreak.pl (added) merged: 34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippScripts/scripts/skycalibration.pl
r34738 r34839 134 134 # First check the expected file name where the stack_id is the FILE_ID 135 135 my $file; 136 if (!$singlefilter) { 136 # if (!$singlefilter) { 137 if (1) { 138 137 139 $file = $ipprc->filename('PSPHOT.STACK.OUTPUT', $path_base, $stack_id); 138 140 if (! $ipprc->file_resolve($file)) { 139 # XXX: Beginning of section that can be removed eventually140 141 # no file with the expected name found142 # assume that the input is from an early staticsky run that did not use stack_id as the FILE_ID143 # but instead used FILE_ID = [0 .. num_filters-1]144 141 print "\nfailed to resolve $file\n"; 145 if (!$filter) { 146 &my_die("filter not supplied unable to identify appropriate staticsky input.", $skycal_id, $PS_EXIT_SYS_ERROR); 147 } 148 print "Trying old style FILE_ID\n"; 149 my $max_filters = 5; 150 for (my $i=0; $i < $max_filters; $i++) { 151 my $file_id = sprintf "%03d", $i; 152 $file = $ipprc->filename('PSPHOT.STACK.OUTPUT', $path_base, $file_id); 153 my $resolved = $ipprc->file_resolve($file); 154 if (!$resolved) { 155 # we fail here assumming that if file_id N doesn't exist, neither to N+1 156 print "\nfailed to resolve $file\n\n"; 157 &my_die("unable to identify appropriate staticsky input.", $skycal_id, $PS_EXIT_SYS_ERROR); 142 # file with proper file rule not found. Try older systems 143 if ($singlefilter) { 144 # input is from a single filter static sky run which used psphot instead of psphotStack 145 # The file rule is different for psphot 146 $file = $ipprc->filename('PSPHOT.OUT.CMF.MEF', $path_base); 147 &my_die("Unable to find input for $stack_id $filter", $skycal_id, $PS_EXIT_SYS_ERROR) 148 unless $ipprc->file_exists($file); 149 } else { 150 # XXX: Beginning of section that can be removed eventually 151 # no file with the expected name found 152 # assume that the input is from an early multifilter staticsky run that did not use stack_id as the FILE_ID 153 # but instead used FILE_ID = [0 .. num_filters-1] 154 if (!$filter) { 155 &my_die("filter not supplied unable to identify appropriate staticsky input.", $skycal_id, $PS_EXIT_SYS_ERROR); 158 156 } 159 # Check the filter id for this file 160 my $command = "$fhead $resolved | grep FILTERID"; 161 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 162 run(command => $command, verbose => 0); 163 unless ($success) { 164 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 165 &my_die("Unable to perform $command: $error_code", $skycal_id, $PS_EXIT_SYS_ERROR); 157 print "Trying old style FILE_ID\n"; 158 my $max_filters = 5; 159 for (my $i=0; $i < $max_filters; $i++) { 160 my $file_id = sprintf "%03d", $i; 161 $file = $ipprc->filename('PSPHOT.STACK.OUTPUT', $path_base, $file_id); 162 my $resolved = $ipprc->file_resolve($file); 163 if (!$resolved) { 164 # we fail here assumming that if file_id N doesn't exist, neither to N+1 165 print "\nfailed to resolve $file\n\n"; 166 &my_die("unable to identify appropriate staticsky input.", $skycal_id, $PS_EXIT_SYS_ERROR); 167 } 168 # Check the filter id for this file 169 my $command = "$fhead $resolved | grep FILTERID"; 170 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 171 run(command => $command, verbose => 0); 172 unless ($success) { 173 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 174 &my_die("Unable to perform $command: $error_code", $skycal_id, $PS_EXIT_SYS_ERROR); 175 } 176 # Expected output: HIERARCH FPA.FILTERID = 'r.00000 ' / Filter used (parsed, abstract name) 177 my ($undef, undef, undef, $filt) = split " ", join("", @$stdout_buf); 178 my $this_filter = substr $filt, 1, 7; 179 180 # if it matches we're done 181 last if $this_filter eq $filter; 182 183 # nope loop around to try the next one 184 print "Input file for $filter is not $file ($this_filter)\n"; 185 $file = undef; 166 186 } 167 # Expected output: HIERARCH FPA.FILTERID = 'r.00000 ' / Filter used (parsed, abstract name) 168 my ($undef, undef, undef, $filt) = split " ", join("", @$stdout_buf); 169 my $this_filter = substr $filt, 1, 7; 170 171 # if it matches we're done 172 last if $this_filter eq $filter; 173 174 # nope loop around to try the next one 175 print "Input file for $filter is not $file ($this_filter)\n"; 176 $file = undef; 177 } 187 } 188 # XXX: End of section that can be removed eventually 189 } 190 if ($file) { 178 191 print "\nInput file for $stack_id filter: $filter: $file\n"; 179 180 # XXX: End of section that can be removed eventually 181 } 182 } else { 183 # input is from a single filter static sky run use a different file rule 184 # XXX: can't we just make staticsky.pl use the same file rule? 185 $file = $ipprc->filename('PSPHOT.OUT.CMF.MEF', $path_base); 186 &my_die("Unable to find input for $stack_id $filter", $skycal_id, $PS_EXIT_SYS_ERROR) 187 unless $ipprc->file_exists($file); 188 } 189 190 if (!$file) { 191 &my_die("Unable to find input for $stack_id $filter", $skycal_id, $PS_EXIT_SYS_ERROR); 192 } else { 193 &my_die("Unable to find input file for stack_id $stack_id.", $skycal_id, $PS_EXIT_SYS_ERROR); 194 } 192 195 } 193 196 … … 197 200 } 198 201 199 # read the input header to find the number of detections and the number of detections 200 # with extended model 202 # XXX: The following is for compatability with psphotStack cmfs created prior to adding NDET 203 # read the input header to find the number of detections 204 my $compatability_flags = ""; 201 205 my $n_detections = 0; 202 my $n_extended = 0;203 206 { 207 # NSTARS is buggy. It only counts sources with a model, and counts them twice. 208 # We want the actual number of sources (real + matched). Use the length of the psf table 204 209 my $command = "echo $resolved | $fields -n SkyChip.psf NAXIS2"; 205 210 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 211 216 unless defined $n_detections; 212 217 213 $command = "echo $resolved | $fields -n SkyChip.hdr NDET_EXT"; 214 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 215 run(command => $command, verbose => 0); 216 (undef, $n_extended) = split " ", join "", @$stdout_buf; 217 chomp $n_extended; 218 &my_die("Unable to find number of extended objects from $file: ", $skycal_id, $PS_EXIT_SYS_ERROR) 219 unless defined $n_extended; 218 $compatability_flags .= " -n_detections $n_detections"; 219 220 220 } 221 221 … … 257 257 } 258 258 259 # if ppStats didn't get n_detections use the compatability version extracted above 260 $cmdflags .= $compatability_flags unless ($cmdflags =~ /-n_detections/); 261 259 262 my $quality; 260 263 ($quality) = $cmdflags =~ /-quality (\d+)/; … … 276 279 { 277 280 my $command = "$staticskytool -skycal_id $skycal_id"; 278 $command .= " -n_detections $n_detections";279 $command .= " -n_extended $n_extended";280 281 $command .= " -addskycalresult -path_base $outroot"; 281 282 $command .= " $cmdflags"; -
branches/eam_branches/ipp-20121130/ippScripts/scripts/skycell_jpeg.pl
r28403 r34839 268 268 269 269 my %tangents = (); 270 271 my %products = ('image' => "PPSTACK.UNCONV", 272 'mask' => "PPSTACK.UNCONV.MASK", 273 'variance' => "PPSTACK.UNCONV.VARIANCE", 274 'exp' => "PPSTACK.UNCONV.EXP", 275 'num' => "PPSTACK.UNCONV.EXPNUM", 276 'bkg' => "PPSTACK.OUTPUT.BKGMODEL" 277 ); 270 278 271 279 foreach my $imfile (@$imfiles) { … … 281 289 282 290 $projection_cell =~ s/^(.*)\..*$/$1/; 283 291 284 292 unless (exists($tangents{$projection_cell})) { 285 293 # Make a temp file and fill, but be sure to save 286 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.XXXX", 287 UNLINK => !$save_temps); 288 $tangents{$projection_cell}{FILE} = $tempFile; 289 $tangents{$projection_cell}{NAME} = $tempName; 290 if ($masks) { 291 my ($maskFile, $maskName) = tempfile("/tmp/skycell.$projection_cell.masks.XXXX", 292 UNLINK => !$save_temps); 293 $tangents{$projection_cell}{MFILE} = $maskFile; 294 $tangents{$projection_cell}{MNAME} = $maskName; 295 } 296 } 297 print "$skycell_id $projection_cell\n"; 298 my $file = $ipprc->filename("PPSTACK.OUTPUT", $path_base, $skycell_id); 299 print "$file $state $quality\n"; 300 my $f_fh = $tangents{$projection_cell}{FILE}; 301 print $f_fh "$file\n"; 302 if ($masks) { 303 my $mask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base, $skycell_id); 304 print "$mask\n"; 305 my $m_fh = $tangents{$projection_cell}{MFILE}; 306 print $m_fh "$mask\n"; 294 foreach my $key (keys %products) { 295 ($tempFile, $tempName) = tempfile("/tmp/skycell.$projection_cell.$key.XXXX", 296 UNLINK => !$save_temps); 297 $tangents{$projection_cell}{$key}{FILE} = $tempFile; 298 $tangents{$projection_cell}{$key}{NAME} = $tempName; 299 } 300 } 301 foreach my $key (keys %products) { 302 print "$skycell_id $projection_cell\n"; 303 my $file = $ipprc->filename($products{$key}, $path_base, $skycell_id); 304 print "$file $state $quality\n"; 305 my $f_fh = $tangents{$projection_cell}{$key}{FILE}; 306 print $f_fh "$file\n"; 307 307 } 308 308 } 309 309 foreach my $projection_cell (keys %tangents) { 310 $command = "$ppSkycell -images $tangents{$projection_cell}{NAME}"; 311 if ($masks) { 312 $command .= " -masks $tangents{$projection_cell}{MNAME} "; 313 } 314 $command .= " ${outroot}.${projection_cell} "; 315 print "$command\n"; 316 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 317 unless ($success) { 318 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 319 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code); 320 } 310 ## Loop over results here. 311 # Images 312 # Masks 313 # Variances 314 # Nexptime 315 # Nexp 316 # Backgrounds 317 318 foreach my $key (keys %products) { 319 $command = "$ppSkycell -images $tangents{$projection_cell}{$key}{NAME}"; 320 $command .= " ${outroot}.${projection_cell}.${key} "; 321 if ($key eq 'bkg') { 322 $command .= " -Di BIN1 1 -Di BIN2 1 "; 323 } 324 elsif ($key eq 'image') { 325 $command .= " -masks $tangents{$projection_cell}{mask}{NAME} "; 326 } 327 elsif ($key eq 'mask') { 328 next; # This should be made with the images. 329 } 330 print "$command\n"; 331 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose); 332 unless ($success) { 333 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 334 &my_die("unable to perform ppSkycell: $error_code", $stage_id, $error_code); 335 } 336 } 337 321 338 # Update database: 322 339 $command = "$stacktool -addsummary -sass_id $stage_id -projection_cell $projection_cell -path_base $outroot"; -
branches/eam_branches/ipp-20121130/ippScripts/scripts/stack_skycell.pl
r32562 r34839 229 229 my $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $file->{path_base}); # Sources name 230 230 231 my $bkgmodel = $ipprc->filename("PSWARP.OUTPUT.BKGMODEL", $file->{path_base}); 232 231 233 &my_die("Image $image does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $image ); 232 234 &my_die("Mask $mask does not exist", $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $mask ); … … 240 242 print $listFile "\tPSF\tSTR\t" . $psf . "\n" if $convolve; 241 243 print $listFile "\tSOURCES\tSTR\t" . $sources . "\n"; 244 print $listFile "\tBKGMODEL\tSTR\t" . $bkgmodel . "\n" if $ipprc->file_exists( $bkgmodel ); 242 245 243 246 print $listFile "END\n\n"; -
branches/eam_branches/ipp-20121130/ippScripts/scripts/warp_skycell.pl
r33053 r34839 128 128 # Where do we get the astrometry source from? 129 129 my $astromSource; # The astrometry source 130 my $doBackground; # Do we want to make background models? 130 131 { 131 132 my $command = "$ppConfigDump -camera $camera -recipe PSWARP $recipe_pswarp -dump-recipe PSWARP -"; … … 139 140 &my_die("Unable to parse metadata config doc", $warp_id, $skycell_id, $tess_dir, $PS_EXIT_PROG_ERROR); 140 141 $astromSource = metadataLookupStr($metadata, 'ASTROM.SOURCE'); 142 $doBackground = metadataLookupBool($metadata, 'BACKGROUND.MODEL'); 141 143 } 142 144 … … 168 170 if ($do_stats) { 169 171 $outputStats = prepare_output ("SKYCELL.STATS", $outroot, $skycell_id, 1) if $do_stats; 172 } 173 my $outputBKGs; 174 if ($doBackground) { 175 $outputBKGs = prepare_output ("PSWARP.OUTPUT.BKGMODEL", $outroot, $skycell_id, 1); 170 176 } 171 177 my $configuration; … … 209 215 my ($weightFile, $weightName) = tempfile( "$tempOutRoot.weight.list.XXXX", UNLINK => !$save_temps); 210 216 my ($astromFile, $astromName) = tempfile( "$tempOutRoot.astrom.list.XXXX", UNLINK => !$save_temps); 211 217 my ($bkgFile, $bkgName); 218 if ($doBackground) { 219 ($bkgFile, $bkgName) = tempfile( "$tempOutRoot.bkg.list.XXXX", UNLINK => !$save_temps); 220 } 212 221 my $wrote_astrom = 0; 213 222 foreach my $imfile (@$imfiles) { … … 235 244 print $maskFile "$mask\n"; 236 245 print $weightFile "$weight\n"; 246 my $bkg; 247 if ($doBackground) { 248 $bkg = $ipprc->filename("PSPHOT.BACKMDL", $imfile->{chip_path_base}, $imfile->{class_id}); 249 print $bkgFile "$bkg\n"; 250 } 237 251 238 252 if (!$wrote_astrom) { … … 245 259 close $weightFile; 246 260 close $astromFile; 247 261 if ($doBackground) { 262 close($bkgFile); 263 } 248 264 # We need the recipe to determine if we care whether the PSF is generated or not 249 265 my $recipe; … … 269 285 $command .= " -variancelist $weightName"; 270 286 $command .= " -astromlist $astromName"; 287 $command .= " -bkglist $bkgName" if ($doBackground); 271 288 $command .= " $outroot $skyFile"; 272 289 $command .= " -F PSPHOT.PSF.SAVE PSPHOT.PSF.SKY.SAVE"; -
branches/eam_branches/ipp-20121130/ippTasks
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20121130/ippTasks/Makefile.am
r33030 r34839 45 45 diffphot.pro \ 46 46 lap.pro \ 47 vp.pro 47 vp.pro \ 48 bg.regeneration.pro 48 49 49 50 other_files = \ -
branches/eam_branches/ipp-20121130/ippTasks/addstar.pro
r34265 r34839 212 212 host local 213 213 periods -poll $LOADPOLL 214 periods -exec 300214 periods -exec $LOADEXEC_ADD 215 215 periods -timeout 300 216 216 npending 1 … … 266 266 host local 267 267 periods -poll $LOADPOLL 268 periods -exec 300268 periods -exec $LOADEXEC_ADD 269 269 periods -timeout 300 270 270 npending 1 -
branches/eam_branches/ipp-20121130/ippTasks/nightly_science.pro
r32375 r34839 258 258 task ns.dqstats.load 259 259 host local 260 periods -poll 3600260 periods -poll $LOADPOLL 261 261 periods -exec $LOADEXEC 262 262 periods -timeout 300 -
branches/eam_branches/ipp-20121130/ippTasks/science.cleanup.pro
r34203 r34839 13 13 14 14 check.globals 15 16 # if set tell cleanup script to check for files from all components regardless of the data_state 17 $CHECK_ALL_COMPONENTS = 0 18 macro set.check.all.components 19 $CHECK_ALL_COMPONENTS = 1 20 end 21 macro clear.check.all.components 22 $CHECK_ALL_COMPONENTS = 0 23 end 24 macro get.check.all.components 25 echo CHECK_ALL_COMPONENTS = $CHECK_ALL_COMPONENTS 26 end 27 15 28 16 29 ## chip.cleanup.pro : -*- sh -*- … … 130 143 book getword chipPendingCleanup $pageName state -var CLEANUP_MODE 131 144 book getword chipPendingCleanup $pageName chip_id -var CHIP_ID 145 book getword chipPendingCleanup $pageName exp_tag -var EXP_TAG 146 book getword chipPendingCleanup $pageName workdir -var WORKDIR_TEMPLATE 132 147 book getword chipPendingCleanup $pageName dbname -var DBNAME 133 148 134 # specify choice of local or remote host based on camera and chip ( class_id)149 # specify choice of local or remote host based on camera and chip (in this case FPA) 135 150 set.host.for.camera $CAMERA FPA 151 152 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 153 154 sprintf LOGFILE "%s/%s/%s.ch.%s.cleanup.log" $WORKDIR $EXP_TAG $EXP_TAG $CHIP_ID 136 155 137 156 stdout $LOGDIR/chip.cleanup.log 138 157 stderr $LOGDIR/chip.cleanup.log 139 158 140 # XXX is everything listed here needed? 141 $run = ipp_cleanup.pl --stage chip --stage_id $CHIP_ID --camera $CAMERA --mode $CLEANUP_MODE 159 $run = ipp_cleanup.pl --stage chip --stage_id $CHIP_ID --camera $CAMERA --mode $CLEANUP_MODE --logfile $LOGFILE 160 if ($CHECK_ALL_COMPONENTS) 161 $run = $run --check-all 162 end 142 163 add_standard_args run 143 164 … … 282 303 book getword camPendingCleanup $pageName state -var CLEANUP_MODE 283 304 book getword camPendingCleanup $pageName cam_id -var CAM_ID 305 book getword camPendingCleanup $pageName exp_tag -var EXP_TAG 306 book getword camPendingCleanup $pageName workdir -var WORKDIR_TEMPLATE 284 307 book getword camPendingCleanup $pageName dbname -var DBNAME 285 308 … … 287 310 set.host.for.camera $CAMERA FPA 288 311 312 # set the WORKDIR variable 313 set.workdir.by.camera $CAMERA FPA $WORKDIR_TEMPLATE $default_host WORKDIR 314 315 ## generate LOGFILE specific to this exposure (& cam_id) 316 sprintf LOGFILE "%s/%s/%s.cm.%s.cleanup.log" $WORKDIR $EXP_TAG $EXP_TAG $CAM_ID 317 289 318 stdout $LOGDIR/camera.cleanup.log 290 319 stderr $LOGDIR/camera.cleanup.log 291 320 292 # XXX is everything listed here needed? 293 $run = ipp_cleanup.pl --stage camera --stage_id $CAM_ID --camera $CAMERA --mode $CLEANUP_MODE 321 $run = ipp_cleanup.pl --stage camera --stage_id $CAM_ID --camera $CAMERA --mode $CLEANUP_MODE --logfile $LOGFILE 294 322 add_standard_args run 295 323 … … 591 619 book getword warpPendingCleanup $pageName state -var CLEANUP_MODE 592 620 book getword warpPendingCleanup $pageName warp_id -var WARP_ID 621 book getword warpPendingCleanup $pageName exp_tag -var EXP_TAG 622 book getword warpPendingCleanup $pageName workdir -var WORKDIR_TEMPLATE 593 623 book getword warpPendingCleanup $pageName dbname -var DBNAME 594 624 595 625 # specify choice of local or remote host based on camera and warp (class_id) 596 626 set.host.for.camera $CAMERA FPA 627 set.workdir.by.camera $CAMERA $WARP_ID $WORKDIR_TEMPLATE $default_host WORKDIR 628 629 sprintf LOGFILE "%s/%s/%s.wrp.%s.cleanup.log" $WORKDIR $EXP_TAG $EXP_TAG $WARP_ID 597 630 598 631 stdout $LOGDIR/warp.cleanup.log 599 632 stderr $LOGDIR/warp.cleanup.log 600 633 601 # XXX is everything listed here needed? 602 $run = ipp_cleanup.pl --stage warp --stage_id $WARP_ID --camera $CAMERA --mode $CLEANUP_MODE 634 $run = ipp_cleanup.pl --stage warp --stage_id $WARP_ID --camera $CAMERA --mode $CLEANUP_MODE --logfile $LOGFILE 635 if ($CHECK_ALL_COMPONENTS) 636 $run = $run --check-all 637 end 603 638 add_standard_args run 604 639 … … 748 783 book getword diffCleanup $pageName state -var CLEANUP_MODE 749 784 book getword diffCleanup $pageName diff_id -var DIFF_ID 785 book getword diffCleanup $pageName tess_id -var TESS_ID 786 book getword diffCleanup $pageName workdir -var WORKDIR_TEMPLATE 750 787 book getword diffCleanup $pageName dbname -var DBNAME 751 788 752 789 # specify choice of local or remote host based on camera and diff (class_id) 753 790 set.host.for.camera $CAMERA FPA 791 set.workdir.by.camera $CAMERA $DIFF_ID $WORKDIR_TEMPLATE $default_host WORKDIR 792 sprintf LOGFILE "%s/%s/%s.dif.%s.cleanup.log" $WORKDIR $TESS_ID $TESS_ID $DIFF_ID 793 754 794 755 795 stdout $LOGDIR/diff.cleanup.log 756 796 stderr $LOGDIR/diff.cleanup.log 757 797 758 # XXX is everything listed here needed? 759 $run = ipp_cleanup.pl --stage diff --stage_id $DIFF_ID --camera $CAMERA --mode $CLEANUP_MODE 798 $run = ipp_cleanup.pl --stage diff --stage_id $DIFF_ID --camera $CAMERA --mode $CLEANUP_MODE --logfile $LOGFILE 799 if ($CHECK_ALL_COMPONENTS) 800 $run = $run --check-all 801 end 760 802 add_standard_args run 761 803 … … 899 941 book getword stackCleanup $pageName state -var CLEANUP_MODE 900 942 book getword stackCleanup $pageName stack_id -var STACK_ID 943 book getword stackCleanup $pageName path_base -var PATH_BASE 901 944 book getword stackCleanup $pageName dbname -var DBNAME 902 945 … … 907 950 stderr $LOGDIR/stack.cleanup.log 908 951 909 # XXX is everything listed here needed?910 $run = ipp_cleanup.pl --stage stack --stage_id $STACK_ID --camera $CAMERA --mode $CLEANUP_MODE 952 sprintf LOGFILE "%s.cleanup.log" PATH_BASE 953 $run = ipp_cleanup.pl --stage stack --stage_id $STACK_ID --camera $CAMERA --mode $CLEANUP_MODE --logfile $LOGFILE 911 954 add_standard_args run 912 955 -
branches/eam_branches/ipp-20121130/ippTasks/skycal.pro
r32983 r34839 8 8 # test for required global variables 9 9 check.globals 10 11 # skcal.pro should have a more restricted polling limit (to avoid stress with getstar) 12 if ($?POLL_LIMIT_SKYCAL == 0) set POLL_LIMIT_SKYCAL = 25 13 14 macro set.skycal.poll 15 if ($0 != 2) 16 echo "USAGE:set.skycal.poll (value)" 17 break 18 end 19 20 $POLL_LIMIT_SKYCAL = $1 21 end 22 23 macro get.skycal.poll 24 echo "skycal poll limit: $POLL_LIMIT_SKYCAL" 25 end 10 26 11 27 ### Initialise the books containing the tasks to do … … 79 95 # save the DB name for the exit tasks 80 96 option $DB:$skycal_DB 81 $run = $run -dbname $DB:$skycal_DB -limit 4097 $run = $run -dbname $DB:$skycal_DB 82 98 $skycal_DB ++ 83 99 if ($skycal_DB >= $DB:n) set skycal_DB = 0 … … 85 101 add_poll_args run 86 102 add_poll_labels run 103 $run = $run -limit $POLL_LIMIT_SKYCAL 87 104 command $run 88 105 end … … 123 140 124 141 task.exec 142 # if we are unable to run use "long" exectime 143 periods -exec $RUNEXEC 125 144 book npages skycalRun -var N 126 145 if ($N == 0) break 127 146 if ($NETWORK == 0) break 128 147 if ($BURNTOOLING == 1) break 148 129 149 130 150 # look for new entries in skycalRun (pantaskState == INIT) … … 147 167 148 168 # set the host and workdir based on the skycell hash 149 set.host.for.skycell $SKYCELL_ID 169 # set.host.for.skycell $SKYCELL_ID 170 host anyhost 150 171 set.workdir.by.skycell $SKYCELL_ID $WORKDIR_TEMPLATE $default_host WORKDIR 151 172 … … 172 193 echo command $run 173 194 end 195 # since we have work to do shorten exec time 196 periods -exec .1 174 197 command $run 175 198 end … … 197 220 host local 198 221 199 periods -poll 60.0200 periods -exec 1 800.0222 periods -poll 10.0 223 periods -exec 1200.0 201 224 periods -timeout 120.0 202 225 npending 1 203 active false226 active true 204 227 205 228 stdout NULL -
branches/eam_branches/ipp-20121130/ippTasks/staticsky.pro
r33957 r34839 70 70 71 71 periods -poll $LOADPOLL 72 periods -exec $LOADEXEC73 periods -timeout 3072 periods -exec 30 73 periods -timeout 60 74 74 npending 1 75 75 … … 154 154 155 155 # set the host and workdir based on the skycell hash 156 set.host.for.skycell $SKYCELL_ID 156 # set.host.for.skycell $SKYCELL_ID 157 host anyhost 157 158 set.workdir.by.skycell $SKYCELL_ID $WORKDIR_TEMPLATE $default_host WORKDIR 158 159 -
branches/eam_branches/ipp-20121130/ippTasks/summit.copy.pro
r33168 r34839 223 223 periods -exec 10 224 224 periods -poll 1 225 periods -timeout 20225 periods -timeout 60 226 226 npending 1 227 227 -
branches/eam_branches/ipp-20121130/ippTasks/survey.pro
r34350 r34839 17 17 book create SURVEY_PUBLISH 18 18 book create SURVEY_STATICSKYSINGLE 19 book create SURVEY_SKYCAL 19 20 $haveSurveyBooks = TRUE 20 21 end … … 31 32 $SURVEY_WARP_BG_DB = 0 32 33 $SURVEY_PUBLISH_DB = 0 34 $SURVEY_SKYCAL_DB = 0 33 35 $SURVEY_STATICSKYSINGLE_DB = 0 34 36 $SURVEY_EXEC = 120 … … 73 75 active true 74 76 end 77 task survey.skycal 78 active true 79 end 75 80 end 76 81 … … 110 115 end 111 116 task survey.staticskysingle 117 active false 118 end 119 task survey.skycal 112 120 active false 113 121 end … … 464 472 book delpage SURVEY_STATICSKYSINGLE $1 465 473 end 474 475 macro survey.add.skycal 476 if ($0 != 3) 477 echo "USAGE: survey.add.skycal (label) (dist_group)" 478 break 479 end 480 book newpage SURVEY_SKYCAL $1 481 book setword SURVEY_SKYCAL $1 LABEL $1 482 book setword SURVEY_SKYCAL $1 DIST_GROUP $2 483 book setword SURVEY_SKYCAL $1 STATE PENDING 484 end 485 486 macro survey.del.skycal 487 if ($0 != 2) 488 echo "USAGE: survey.del.skycal (label)" 489 break 490 end 491 book delpage SURVEY_SKYCAL $1 492 end 493 494 macro survey.show.skycal 495 if ($0 != 1) 496 echo "USAGE: survey.show.skyacl" 497 break 498 end 499 book listbook SURVEY_SKYCAL 500 end 501 466 502 467 503 task survey.diff … … 1453 1489 end 1454 1490 1491 # Survey task for Skycal stage 1492 1493 task survey.skycal 1494 host local 1495 1496 periods -poll $SURVEY_POLL 1497 periods -exec $SURVEY_EXEC 1498 periods -timeout $SURVEY_TIMEOUT 1499 npending 1 1500 1501 stdout $LOGDIR/survey.skycal.log 1502 stderr $LOGDIR/survey.skycal.log 1503 1504 task.exec 1505 book npages SURVEY_SKYCAL -var N 1506 if ($N == 0) 1507 # echo "No labels for processing" 1508 break 1509 endif 1510 1511 book getpage SURVEY_SKYCAL 0 -var label -key STATE NEW 1512 if ("$label" == "NULL") 1513 # All labels have been done --- reset 1514 # echo "Resetting labels" 1515 for i 0 $N 1516 book getpage SURVEY_SKYCAL $i -var label 1517 book setword SURVEY_SKYCAL $label STATE NEW 1518 end 1519 book getpage SURVEY_SKYCAL 0 -var label -key STATE NEW 1520 1521 # Select different database 1522 $SURVEY_SKYCAL_DB ++ 1523 if ($SURVEY_SKYCAL_DB >= $DB:n) set SURVEY_SKYCAL_DB = 0 1524 end 1525 1526 book setword SURVEY_SKYCAL $label STATE DONE 1527 book getword SURVEY_SKYCAL $label DIST_GROUP -var dist_group 1528 1529 # note: currently skycal uses the staticskyRun workdir 1530 1531 $run = staticskytool -defineskycalrun -select_label $label -set_dist_group $dist_group 1532 1533 if ($DB:n == 0) 1534 option DEFAULT 1535 else 1536 $run = $run -dbname $DB:$SURVEY_SKYCAL_DB 1537 option $DB:$SURVEY_SKYCAL_DB 1538 end 1539 1540 # echo $run 1541 command $run 1542 end 1543 1544 # success 1545 task.exit 0 1546 # echo "Success" 1547 end 1548 1549 # locked list 1550 task.exit default 1551 showcommand failure 1552 end 1553 1554 task.exit crash 1555 showcommand crash 1556 end 1557 1558 # operation times out? 1559 task.exit timeout 1560 showcommand timeout 1561 end 1562 end -
branches/eam_branches/ipp-20121130/ippToPsps
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippToPsps (added) merged: 34772,34786 /trunk/ippToPsps (added) merged: 34782,34800,34806-34811,34832-34834
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippToPsps/config/OB/tables.vot
r34615 r34839 27 27 <DESCRIPTION>flag indicating odd properties</DESCRIPTION> 28 28 </FIELD> 29 <FIELD name=" varFlag" arraysize="1" datatype="unsignedByte" unit="unknown">30 <DESCRIPTION> variable in difference image detections</DESCRIPTION>29 <FIELD name="qualityFlag" arraysize="1" datatype="unsignedByte" unit="unknown"> 30 <DESCRIPTION>subset of objInfoFlag - flags related to goodness of object</DESCRIPTION> 31 31 </FIELD> 32 32 <FIELD name="surveyID" arraysize="1" datatype="unsignedByte" unit="unknown"> … … 45 45 <DESCRIPTION> Declination error</DESCRIPTION> 46 46 </FIELD> 47 <FIELD name="cx" arraysize="1" datatype="double" unit="unknown"> 48 <DESCRIPTION>Cartesian x</DESCRIPTION> 49 </FIELD> 50 <FIELD name="cy" arraysize="1" datatype="double" unit="unknown"> 51 <DESCRIPTION>Cartesian y</DESCRIPTION> 52 </FIELD> 53 <FIELD name="cz" arraysize="1" datatype="double" unit="unknown"> 54 <DESCRIPTION>Cartesian z</DESCRIPTION> 55 </FIELD> 47 56 <FIELD name="lambda" arraysize="1" datatype="double" unit="degree"> 48 57 <DESCRIPTION> ecliptic longitude</DESCRIPTION> … … 284 293 <FIELD name="consistencyFlag" arraysize="1" datatype="short" unit="unknown"> 285 294 <DESCRIPTION>Value computed from associated detections, it is originally given by IPP and should agree with the ODM validation</DESCRIPTION> 295 </FIELD> 296 <FIELD name="Random" arraysize="1" datatype="double" unit="unknown"> 297 <DESCRIPTION>Random number between 0 and 1</DESCRIPTION> 286 298 </FIELD> 287 299 <FIELD name="dataRelease" arraysize="1" datatype="unsignedByte" unit="unknown"> -
branches/eam_branches/ipp-20121130/ippToPsps/jython/objectbatch.py
r34723 r34839 134 134 ," + filter[1] + "80pct = MAG_80/1000 \ 135 135 ," + filter[1] + "Flags = (0x7fff & FLAGS) | ((FLAGS >> 11) & 0x2000) \ 136 ," + filter[1] + "StackDetectID = STACK_DETECT_ID + " + str(filterID)136 ," + filter[1] + "StackDetectID = STACK_DETECT_ID" 137 137 138 138 #self.logger.info(sql) … … 236 236 ,ippObjID \ 237 237 ,objInfoFlag \ 238 , varFlag \238 ,qualityFlag \ 239 239 ,surveyID \ 240 240 ,ra \ … … 246 246 ,sgSep \ 247 247 ,dataRelease \ 248 ,Random \ 248 249 ) \ 249 250 SELECT \ … … 251 252 ,CAT_ID*1000000000 + OBJ_ID \ 252 253 ,FLAGS \ 253 , 0\254 ,FLAGS >> 24 & 0xFF \ 254 255 ," + str(self.surveyID) + " \ 255 256 ,RA \ … … 257 258 ,RA_ERR \ 258 259 ,DEC_ERR \ 259 , NMEASURE\260 ,0 \ 260 261 ,PSF_QF_PERF \ 261 262 ,STARGAL_SEP \ 262 263 , " + str(self.config.dataRelease) + "\ 264 , RAND() \ 263 265 FROM " + cptTableName 264 266 -
branches/eam_branches/ipp-20121130/ippToPsps/jython/stackbatch.py
r34661 r34839 5 5 6 6 import stilts 7 import re 7 8 from java.lang import * 8 9 from java.sql import * … … 143 144 ''' 144 145 def updateApFlxs(self, prefix, psfCondition): 146 #properly -999 these to start with: 145 147 146 148 sql = "UPDATE StackApFlx AS a, SkyChip_xrad AS b SET \ 147 "+prefix+"flxR1=b.APER_FLUX_1 / " + str(self.expTime) + ", \ 148 "+prefix+"flxR1Err=b.APER_FLUX_ERR_1 / " + str(self.expTime) + ", \ 149 "+prefix+"flxR1Std=b.APER_FLUX_STDEV_1 / " + str(self.expTime) + ", \ 150 "+prefix+"flxR1Fill=b.APER_FILL_1, \ 151 "+prefix+"flxR2=b.APER_FLUX_2 / " + str(self.expTime) + ", \ 152 "+prefix+"flxR2Err=b.APER_FLUX_ERR_2 / " + str(self.expTime) + ", \ 153 "+prefix+"flxR2Std=b.APER_FLUX_STDEV_2 / " + str(self.expTime) + ", \ 154 "+prefix+"flxR2Fill=b.APER_FILL_2, \ 155 "+prefix+"flxR3=b.APER_FLUX_3 / " + str(self.expTime) + ", \ 156 "+prefix+"flxR3Err=b.APER_FLUX_ERR_3 / " + str(self.expTime) + ", \ 157 "+prefix+"flxR3Std=b.APER_FLUX_STDEV_3 / " + str(self.expTime) + ", \ 158 "+prefix+"flxR3Fill=b.APER_FILL_3, \ 159 "+prefix+"flxR4=b.APER_FLUX_4 / " + str(self.expTime) + ", \ 160 "+prefix+"flxR4Err=b.APER_FLUX_ERR_4 / " + str(self.expTime) + ", \ 161 "+prefix+"flxR4Std=b.APER_FLUX_STDEV_4 / " + str(self.expTime) + ", \ 162 "+prefix+"flxR4Fill=b.APER_FILL_4, \ 163 "+prefix+"flxR5=b.APER_FLUX_5 / " + str(self.expTime) + ", \ 164 "+prefix+"flxR5Err=b.APER_FLUX_ERR_5 / " + str(self.expTime) + ", \ 165 "+prefix+"flxR5Std=b.APER_FLUX_STDEV_5 / " + str(self.expTime) + ", \ 166 "+prefix+"flxR5Fill=b.APER_FILL_5, \ 167 "+prefix+"flxR6=b.APER_FLUX_6 / " + str(self.expTime) + ", \ 168 "+prefix+"flxR6Err=b.APER_FLUX_ERR_6 / " + str(self.expTime) + ", \ 169 "+prefix+"flxR6Std=b.APER_FLUX_STDEV_6 / " + str(self.expTime) + ", \ 170 "+prefix+"flxR6Fill=b.APER_FILL_6, \ 171 "+prefix+"flxR7=b.APER_FLUX_7 / " + str(self.expTime) + ", \ 172 "+prefix+"flxR7Err=b.APER_FLUX_ERR_7 / " + str(self.expTime) + ", \ 173 "+prefix+"flxR7Std=b.APER_FLUX_STDEV_7 / " + str(self.expTime) + ", \ 174 "+prefix+"flxR7Fill=b.APER_FILL_7, \ 175 "+prefix+"flxR8=b.APER_FLUX_8 / " + str(self.expTime) + ", \ 176 "+prefix+"flxR8Err=b.APER_FLUX_ERR_8 / " + str(self.expTime) + ", \ 177 "+prefix+"flxR8Std=b.APER_FLUX_STDEV_8 / " + str(self.expTime) + ", \ 178 "+prefix+"flxR8Fill=b.APER_FILL_8, \ 179 "+prefix+"flxR9=b.APER_FLUX_9 / " + str(self.expTime) + ", \ 180 "+prefix+"flxR9Err=b.APER_FLUX_ERR_9 / " + str(self.expTime) + ", \ 181 "+prefix+"flxR9Std=b.APER_FLUX_STDEV_9 / " + str(self.expTime) + ", \ 182 "+prefix+"flxR9Fill=b.APER_FILL_9, \ 183 "+prefix+"flxR10=b.APER_FLUX_10 / " + str(self.expTime) + ", \ 184 "+prefix+"flxR10Err=b.APER_FLUX_ERR_10 / " + str(self.expTime) + ", \ 185 "+prefix+"flxR10Std=b.APER_FLUX_STDEV_10 / " + str(self.expTime) + ", \ 186 "+prefix+"flxR10Fill=b.APER_FILL_10 \ 187 WHERE a.ippDetectID=b.IPP_IDET AND b.PSF_FWHM "+psfCondition 188 189 self.scratchDb.execute(sql) 149 "+prefix+"flxR1=-999, \ 150 "+prefix+"flxR1Err=-999, \ 151 "+prefix+"flxR1Std=-999, \ 152 "+prefix+"flxR1Fill=-999, \ 153 "+prefix+"flxR2=-999, \ 154 "+prefix+"flxR2Err=-999, \ 155 "+prefix+"flxR2Std=-999, \ 156 "+prefix+"flxR2Fill=-999, \ 157 "+prefix+"flxR3=-999, \ 158 "+prefix+"flxR3Err=-999, \ 159 "+prefix+"flxR3Std=-999, \ 160 "+prefix+"flxR3Fill=-999, \ 161 "+prefix+"flxR4=-999, \ 162 "+prefix+"flxR4Err=-999, \ 163 "+prefix+"flxR4Std=-999, \ 164 "+prefix+"flxR4Fill=-999, \ 165 "+prefix+"flxR5=-999, \ 166 "+prefix+"flxR5Err=-999, \ 167 "+prefix+"flxR5Std=-999, \ 168 "+prefix+"flxR5Fill=-999, \ 169 "+prefix+"flxR6=-999, \ 170 "+prefix+"flxR6Err=-999, \ 171 "+prefix+"flxR6Std=-999, \ 172 "+prefix+"flxR6Fill=-999, \ 173 "+prefix+"flxR7=-999, \ 174 "+prefix+"flxR7Err=-999, \ 175 "+prefix+"flxR7Std=-999, \ 176 "+prefix+"flxR7Fill=-999, \ 177 "+prefix+"flxR8=-999, \ 178 "+prefix+"flxR8Err=-999, \ 179 "+prefix+"flxR8Std=-999, \ 180 "+prefix+"flxR8Fill=-999, \ 181 "+prefix+"flxR9=-999, \ 182 "+prefix+"flxR9Err=-999, \ 183 "+prefix+"flxR9Std=-999, \ 184 "+prefix+"flxR9Fill=-999, \ 185 "+prefix+"flxR10=-999, \ 186 "+prefix+"flxR10Err=-999, \ 187 "+prefix+"flxR10Std=-999, \ 188 "+prefix+"flxR10Fill=-999 \ 189 WHERE a.ippDetectID=b.IPP_IDET " 190 #self.logger.infoPair("sql", sql) 191 self.scratchDb.execute(sql) 192 193 194 #we have variable numbers of these columns. find out which are in use 195 sql = "DESCRIBE SkyChip_xrad 'aper_fill_%'" 196 rs = self.scratchDb.executeQuery(sql) 197 rs.first() 198 columns = [] 199 column = rs.getString(1) 200 columns.append(column) 201 while (rs.next()): 202 column = rs.getString(1) 203 columns.append(column) 204 rs.close() 205 206 #use regex to leave just the numbers 207 208 numbers = [] 209 for column in columns: 210 number = re.sub("APER_FILL_","",column) 211 if (int(number) >= 1 and int(number) <=10): 212 numbers.append(number) 213 self.logger.infoPair("Aperture Numbers",number) 214 215 #generate the sql to do the necessary ops on the columns 216 sql = "UPDATE StackApFlx AS a, SkyChip_xrad AS b SET " 217 cnt =0 218 for number in numbers: 219 if (cnt>0): 220 sql=sql+" , " 221 sql=sql+prefix+"flxR"+number+"=b.APER_FLUX_"+number +" / " + str(self.expTime) + ", " 222 sql=sql+prefix+"flxR"+number+"Err=b.APER_FLUX_ERR_"+number +" / " + str(self.expTime) + ", " 223 sql=sql+prefix+"flxR"+number+"Std=b.APER_FLUX_STDEV_"+number +" / " + str(self.expTime) + ", " 224 sql=sql+prefix+"flxR"+number+"Fill=b.APER_FILL_"+number + " " 225 cnt=cnt+1 226 227 sql=sql+"WHERE a.ippDetectID=b.IPP_IDET AND b.PSF_FWHM "+psfCondition 228 self.scratchDb.execute(sql) 229 230 #self.logger.infoPair("sql",sql) 231 232 #sql = "UPDATE StackApFlx AS a, SkyChip_xrad AS b SET \ 233 #"+prefix+"flxR1=b.APER_FLUX_1 / " + str(self.expTime) + ", \ 234 #"+prefix+"flxR1Err=b.APER_FLUX_ERR_1 / " + str(self.expTime) + ", \ 235 #"+prefix+"flxR1Std=b.APER_FLUX_STDEV_1 / " + str(self.expTime) + ", \ 236 #"+prefix+"flxR1Fill=b.APER_FILL_1, \ 237 #"+prefix+"flxR2=b.APER_FLUX_2 / " + str(self.expTime) + ", \ 238 ##"+prefix+"flxR2Err=b.APER_FLUX_ERR_2 / " + str(self.expTime) + ", \ 239 #"+prefix+"flxR2Std=b.APER_FLUX_STDEV_2 / " + str(self.expTime) + ", \ 240 #"+prefix+"flxR2Fill=b.APER_FILL_2, \ 241 #"+prefix+"flxR3=b.APER_FLUX_3 / " + str(self.expTime) + ", \ 242 #"+prefix+"flxR3Err=b.APER_FLUX_ERR_3 / " + str(self.expTime) + ", \ 243 #"+prefix+"flxR3Std=b.APER_FLUX_STDEV_3 / " + str(self.expTime) + ", \ 244 #"+prefix+"flxR3Fill=b.APER_FILL_3, \ 245 #"+prefix+"flxR4=b.APER_FLUX_4 / " + str(self.expTime) + ", \ 246 #"+prefix+"flxR4Err=b.APER_FLUX_ERR_4 / " + str(self.expTime) + ", \ 247 #"+prefix+"flxR4Std=b.APER_FLUX_STDEV_4 / " + str(self.expTime) + ", \ 248 #"+prefix+"flxR4Fill=b.APER_FILL_4, \ 249 #"+prefix+"flxR5=b.APER_FLUX_5 / " + str(self.expTime) + ", \ 250 #"+prefix+"flxR5Err=b.APER_FLUX_ERR_5 / " + str(self.expTime) + ", \ 251 #"+prefix+"flxR5Std=b.APER_FLUX_STDEV_5 / " + str(self.expTime) + ", \ 252 #"+prefix+"flxR5Fill=b.APER_FILL_5, \ 253 #"+prefix+"flxR6=b.APER_FLUX_6 / " + str(self.expTime) + ", \ 254 #"+prefix+"flxR6Err=b.APER_FLUX_ERR_6 / " + str(self.expTime) + ", \ 255 #"+prefix+"flxR6Std=b.APER_FLUX_STDEV_6 / " + str(self.expTime) + ", \ 256 #"+prefix+"flxR6Fill=b.APER_FILL_6, \ 257 #"+prefix+"flxR7=b.APER_FLUX_7 / " + str(self.expTime) + ", \ 258 #"+prefix+"flxR7Err=b.APER_FLUX_ERR_7 / " + str(self.expTime) + ", \ 259 #"+prefix+"flxR7Std=b.APER_FLUX_STDEV_7 / " + str(self.expTime) + ", \ 260 #"+prefix+"flxR7Fill=b.APER_FILL_7, \ 261 #"+prefix+"flxR8=b.APER_FLUX_8 / " + str(self.expTime) + ", \ 262 #"+prefix+"flxR8Err=b.APER_FLUX_ERR_8 / " + str(self.expTime) + ", \ 263 #"+prefix+"flxR8Std=b.APER_FLUX_STDEV_8 / " + str(self.expTime) + ", \ 264 #"+prefix+"flxR8Fill=b.APER_FILL_8, \ 265 #"+prefix+"flxR9=b.APER_FLUX_9 / " + str(self.expTime) + ", \ 266 #"+prefix+"flxR9Err=b.APER_FLUX_ERR_9 / " + str(self.expTime) + ", \ 267 #"+prefix+"flxR9Std=b.APER_FLUX_STDEV_9 / " + str(self.expTime) + ", \ 268 #"+prefix+"flxR9Fill=b.APER_FILL_9, \ 269 #"+prefix+"flxR10=b.APER_FLUX_10 / " + str(self.expTime) + ", \ 270 #"+prefix+"flxR10Err=b.APER_FLUX_ERR_10 / " + str(self.expTime) + ", \ 271 #"+prefix+"flxR10Std=b.APER_FLUX_STDEV_10 / " + str(self.expTime) + ", \ 272 #"+prefix+"flxR10Fill=b.APER_FILL_10 \ 273 #WHERE a.ippDetectID=b.IPP_IDET AND b.PSF_FWHM "+psfCondition 274 275 #self.scratchDb.execute(sql) 190 276 191 277 ''' … … 395 481 ,KRON_FLUX_ERR / " + str(self.expTime) + " \ 396 482 ,MOMENTS_R1 * 2.5 \ 397 ,PSF_CHISQ \483 ,PSF_CHISQ / PSF_NDOF \ 398 484 ,N_FRAMES \ 399 485 , '" + self.dateStr + "' \ -
branches/eam_branches/ipp-20121130/ippToPsps/src/Dvo.c
r34629 r34839 21 21 if (this->mysql) mysql_close(this->mysql); 22 22 23 free(this); 23 // libohana redirects free and gets confused by thigns allocated by calloc 24 // so call the real free funtion through this warpper 25 real_free(this); 24 26 } 25 27 … … 94 96 PhotCode *code = GetPhotcodebyCode(meas->photcode); 95 97 sprintf(sql, 96 "INSERT INTO dvoDetection (imageID, ippDetectID, detectID, ippObjID, objID, flags, zp, zpErr, airMass, expTime, ra, dec_, raErr, decErr) VALUES (%d, %u, %lu, %lu, %lu, %u, %f, %f, %f, %f, %lf, %lf, %f %f)",98 "INSERT INTO dvoDetection (imageID, ippDetectID, detectID, ippObjID, objID, flags, zp, zpErr, airMass, expTime, ra, dec_, raErr, decErr) VALUES (%d, %u, %lu, %lu, %lu, %u, %f, %f, %f, %f, %lf, %lf, %f, %f)", 97 99 image->imageID, // imageID 98 100 meas->detID, // ippDetectID 99 101 meas->extID, // detectID 100 102 (uint64_t)ave->catID*1000000000 + (uint64_t)ave->objID, // ippObjID 101 dvoDetections[i].ave.extID, // objID102 meas->dbFlags, // flags103 ave->extID, // objID 104 meas->dbFlags, // flags 103 105 code->C * 0.001 + code->K * (meas->airmass - 1) - meas->Mcal, // zp 104 meas->dMcal, // zpErr106 meas->dMcal, // zpErr 105 107 meas->airmass, 106 108 pow(10.0, 0.4 * meas->dt), // expTime 107 109 ave->R - meas->dR / 3600., // ra 108 110 ave->D - meas->dR / 3600., // dec 109 meas->dXccd * meas->pltscale, // estimate of raErr110 meas->dYccd * meas->pltscale// estimate of decErr111 meas->dXccd * 0.01 * fabs(meas->pltscale), // estimate of raErr 112 meas->dYccd * 0.01 * fabs(meas->pltscale) // estimate of decErr 111 113 ); 112 114 -
branches/eam_branches/ipp-20121130/ippTools/configure.ac
r34081 r34839 1 1 AC_PREREQ(2.61) 2 2 3 AC_INIT([ipptools], [1.1.7 1], [ipp-support@ifa.hawaii.edu])3 AC_INIT([ipptools], [1.1.73], [ipp-support@ifa.hawaii.edu]) 4 4 AC_CONFIG_SRCDIR([autogen.sh]) 5 5 -
branches/eam_branches/ipp-20121130/ippTools/share/Makefile.am
r34265 r34839 88 88 chiptool_listrun.sql \ 89 89 chiptool_pendingcleanupimfile.sql \ 90 chiptool_pendingcleanupimfile_all.sql \ 90 91 chiptool_pendingcleanuprun.sql \ 91 92 chiptool_pendingimfile.sql \ … … 172 173 difftool_pendingcleanuprun.sql \ 173 174 difftool_pendingcleanupskyfile.sql \ 175 difftool_pendingcleanupskyfile_all.sql \ 174 176 difftool_revertdiffskyfile_delete.sql \ 175 177 difftool_revertdiffskyfile_updated.sql \ … … 391 393 stacktool_sassskyfile.sql \ 392 394 stacktool_tosum.sql \ 395 stacktool_tobkg.sql \ 393 396 stacktool_tosummary.sql \ 394 397 stacktool_addsummary.sql \ … … 423 426 warptool_pendingcleanuprun.sql \ 424 427 warptool_pendingcleanupskyfile.sql \ 428 warptool_pendingcleanupskyfile_all.sql \ 425 429 warptool_revertoverlap.sql \ 426 430 warptool_revertwarped_delete.sql \ -
branches/eam_branches/ipp-20121130/ippTools/share/camtool_find_pendingimfile.sql
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippTools/share/camtool_find_pendingimfile.sql (added) merged: 34772 /trunk/ippTools/share/camtool_find_pendingimfile.sql (added) merged: 34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippTools/share/camtool_pendingcleanuprun.sql
r25324 r34839 2 2 camRun.cam_id, 3 3 rawExp.camera, 4 rawExp.exp_tag, 5 camRun.workdir, 4 6 camRun.state 5 7 FROM camRun -
branches/eam_branches/ipp-20121130/ippTools/share/chiptool_pendingcleanuprun.sql
r22751 r34839 1 SELECT 1 SELECT DISTINCT 2 2 chipRun.chip_id, 3 3 rawExp.camera, 4 chipRun.state 4 rawExp.exp_tag, 5 chipRun.state, 6 chipRun.workdir 5 7 FROM chipRun 6 8 JOIN rawExp -
branches/eam_branches/ipp-20121130/ippTools/share/chiptool_setimfiletoupdate.sql
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippTools/share/chiptool_setimfiletoupdate.sql (added) merged: 34772 /trunk/ippTools/share/chiptool_setimfiletoupdate.sql (added) merged: 34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippTools/share/difftool_pendingcleanuprun.sql
r32218 r34839 6 6 rawExp.camera, 7 7 diffRun.state, 8 diffRun.workdir, 9 diffRun.tess_id, 8 10 diffRun.label 9 11 FROM diffRun … … 35 37 rawExp.camera, 36 38 diffRun.state, 39 diffRun.workdir, 40 diffRun.tess_id, 37 41 diffRun.label 38 42 FROM diffRun … … 64 68 rawExp.camera, 65 69 diffRun.state, 70 diffRun.workdir, 71 diffRun.tess_id, 66 72 diffRun.label 67 73 FROM diffRun … … 93 99 rawExp.camera, 94 100 diffRun.state, 101 diffRun.workdir, 102 diffRun.tess_id, 95 103 diffRun.label 96 104 FROM diffRun -
branches/eam_branches/ipp-20121130/ippTools/share/pstamptool_revertdependent.sql
r29286 r34839 4 4 SET pstampDependent.fault = 0 5 5 -- fault count hook %s 6 WHERE pstampDependent.state = 'new' 6 WHERE pstampRequest.state ='run' 7 AND pstampJob.state ='run' 8 AND pstampDependent.state = 'new' 7 9 AND (pstampDependent.fault > 0) -
branches/eam_branches/ipp-20121130/ippTools/share/pxadmin_create_tables.sql
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippTools/share/pxadmin_create_tables.sql (added) merged: 34772 /trunk/ippTools/share/pxadmin_create_tables.sql (added) merged: 34789,34800
r34750 r34839 2119 2119 n_detections INT, 2120 2120 n_extended INT, 2121 n_forced INT, 2121 2122 zpt_obs FLOAT, 2122 2123 zpt_stdev FLOAT, - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippTools/share/stacktool_inputskyfile.sql
r32937 r34839 4 4 rawExp.exp_id, 5 5 rawExp.exp_name, 6 rawExp.exp_time, 6 7 rawExp.object, 7 8 rawExp.dateobs, -
branches/eam_branches/ipp-20121130/ippTools/share/stacktool_pendingcleanuprun.sql
r24186 r34839 8 8 stackRun.stack_id, 9 9 rawExp.camera, 10 stackRun.state 10 stackRun.state, 11 stackSumSkyfile.path_base 11 12 FROM stackRun 13 JOIN stackSumSkyfile using(stack_id) 12 14 JOIN stackInputSkyfile 13 15 USING(stack_id) -
branches/eam_branches/ipp-20121130/ippTools/share/staticskytool_defineskycalrun.sql
r32960 r34839 2 2 sky_id, 3 3 stack_id, 4 skycell_id, 5 filter, 4 6 staticskyRun.workdir, 5 7 staticskyRun.label, … … 11 13 JOIN stackRun USING(stack_id) 12 14 JOIN stackSumSkyfile USING(stack_id) 15 JOIN skycell USING(tess_id, skycell_id) 13 16 LEFT JOIN skycalRun USING(sky_id, stack_id) 14 17 WHERE staticskyRun.state = 'full' -
branches/eam_branches/ipp-20121130/ippTools/share/staticskytool_pendingskycalrun.sql
r34743 r34839 6 6 staticskyResult.path_base, 7 7 rawExp.camera, 8 0 ASsinglefilter8 staticskyResult.num_inputs = 1 AS singlefilter 9 9 FROM skycalRun 10 10 JOIN staticskyRun USING (sky_id) -
branches/eam_branches/ipp-20121130/ippTools/share/warptool_pendingcleanuprun.sql
r23418 r34839 1 1 SELECT 2 2 warpRun.warp_id, 3 warpRun.workdir, 3 4 rawExp.camera, 5 rawExp.exp_tag, 4 6 warpRun.state 5 7 FROM warpRun -
branches/eam_branches/ipp-20121130/ippTools/share/warptool_towarped.sql
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippTools/share/warptool_towarped.sql (added) merged: 34772 /trunk/ippTools/share/warptool_towarped.sql (added) merged: 34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippTools/src
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippTools/src (added) merged: 34772,34780,34786 /trunk/ippTools/src (added) merged: 34761,34766,34770,34789,34800,34815
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippTools/src/chiptool.c
r34501 r34839 1311 1311 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 1312 1312 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1313 PXOPT_LOOKUP_BOOL(all, config->args, "-all", false); 1313 1314 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1314 1315 … … 1319 1320 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 1320 1321 1321 psString query = pxDataGet("chiptool_pendingcleanupimfile.sql"); 1322 char *sql_file = all ? "chiptool_pendingcleanupimfile_all.sql" : "chiptool_pendingcleanupimfile.sql"; 1323 psString query = pxDataGet(sql_file); 1322 1324 if (!query) { 1323 1325 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); -
branches/eam_branches/ipp-20121130/ippTools/src/chiptoolConfig.c
r34501 r34839 296 296 psMetadataAddS64(pendingcleanupimfileArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0); 297 297 psMetadataAddStr(pendingcleanupimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "search by exp_id", NULL); 298 psMetadataAddBool(pendingcleanupimfileArgs, PS_LIST_TAIL, "-all", 0, "list all components regardless of data_state", false); 298 299 psMetadataAddBool(pendingcleanupimfileArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 299 300 psMetadataAddU64(pendingcleanupimfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); -
branches/eam_branches/ipp-20121130/ippTools/src/difftool.c
r34538 r34839 2561 2561 2562 2562 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", false, false); 2563 PXOPT_LOOKUP_BOOL(all, config->args, "-all", false); 2563 2564 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 2564 2565 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); … … 2570 2571 pxAddLabelSearchArgs (config, where, "-label", "diffRun.label", "=="); 2571 2572 2572 psString query = pxDataGet("difftool_pendingcleanupskyfile.sql"); 2573 char * sql_file = all ? "difftool_pendingcleanupskyfile_all.sql": "difftool_pendingcleanupskyfile.sql" ; 2574 psString query = pxDataGet(sql_file); 2573 2575 if (!query) { 2574 2576 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); … … 2740 2742 PS_ASSERT_PTR_NON_NULL(config, false); 2741 2743 2742 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 2743 PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", false, false); 2744 2745 psMetadata *where = psMetadataAlloc(); 2746 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 2747 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 2748 2749 if (!pxSetFaultCode(config->dbh, "diffSkyfile", where, fault, quality)) { 2750 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 2744 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 2745 2746 if (!state) { 2747 psMetadata *where = psMetadataAlloc(); 2748 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 2749 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 2750 2751 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 2752 PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", false, false); 2753 2754 if (!pxSetFaultCode(config->dbh, "diffSkyfile", where, fault, quality)) { 2755 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 2756 psFree (where); 2757 return false; 2758 } 2751 2759 psFree (where); 2752 return false; 2753 } 2754 psFree (where); 2760 } else { 2761 if (strcmp(state,"error_cleaned") == 0) { 2762 change_skyfile_data_state(config,"error_cleaned", "goto_cleaned"); 2763 } 2764 else if (strcmp(state, "error_scrubbed") == 0) { 2765 change_skyfile_data_state(config,"error_scrubbed", "goto_scrubbed"); 2766 } 2767 else if (strcmp(state, "error_purged") == 0) { 2768 change_skyfile_data_state(config,"error_purged", "goto_purged"); 2769 } 2770 else { 2771 psError(PS_ERR_UNKNOWN, false, "unhandled state given"); 2772 return(false); 2773 } 2774 } 2755 2775 2756 2776 return true; -
branches/eam_branches/ipp-20121130/ippTools/src/difftoolConfig.c
r34443 r34839 395 395 psMetadataAddStr(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "list blocks for specified label", NULL); 396 396 psMetadataAddS64(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-diff_id", 0, "search by diff ID", 0); 397 psMetadataAddBool(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-all", 0, "list all skycells regardless of data_state", false); 397 398 psMetadataAddBool(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 398 399 psMetadataAddU64(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 411 412 psMetadataAddBool(donecleanupArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 412 413 psMetadataAddU64(donecleanupArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 414 413 415 // -updatediffskyfile 414 416 psMetadata *updatediffskyfileArgs = psMetadataAlloc(); … … 416 418 psMetadataAddStr(updatediffskyfileArgs, PS_LIST_TAIL, "-skycell_id", 0, "search by skycell ID", NULL); 417 419 psMetadataAddS16(updatediffskyfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", 0); 418 psMetadataAddS16(updatediffskyfileArgs, PS_LIST_TAIL, "-set_quality", 0, "set quality", 0); 420 psMetadataAddS16(updatediffskyfileArgs, PS_LIST_TAIL, "-set_quality", 0, "set quality", 0); 421 psMetadataAddStr(updatediffskyfileArgs, PS_LIST_TAIL, "-set_state", 0, "set data_state state", NULL); 419 422 420 423 // -tocleanedskyfile -
branches/eam_branches/ipp-20121130/ippTools/src/magictool.c
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippTools/src/magictool.c (added) merged: 34772 /trunk/ippTools/src/magictool.c (added) merged: 34800
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20121130/ippTools/src/stacktool.c
r34731 r34839 37 37 static bool inputskyfileMode(pxConfig *config); 38 38 static bool tosumMode(pxConfig *config); 39 static bool tobkgMode(pxConfig *config); 39 40 static bool addsumskyfileMode(pxConfig *config); 40 41 static bool sumskyfileMode(pxConfig *config); … … 76 77 MODECASE(STACKTOOL_MODE_INPUTSKYFILE, inputskyfileMode); 77 78 MODECASE(STACKTOOL_MODE_TOSUM, tosumMode); 79 MODECASE(STACKTOOL_MODE_TOBKG, tobkgMode); 78 80 MODECASE(STACKTOOL_MODE_ADDSUMSKYFILE, addsumskyfileMode); 79 81 MODECASE(STACKTOOL_MODE_SUMSKYFILE, sumskyfileMode); … … 952 954 // negative simple so the default is true 953 955 if (!ippdbPrintMetadatas(stdout, output, "stackSumSkyfile", !simple)) { 956 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 957 psFree(output); 958 return false; 959 } 960 } 961 962 psFree(output); 963 964 return true; 965 } 966 967 static bool tobkgMode(pxConfig *config) 968 { 969 PS_ASSERT_PTR_NON_NULL(config, false); 970 971 psMetadata *where = psMetadataAlloc(); 972 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); 973 pxAddLabelSearchArgs (config, where, "-label", "stackRun.label", "=="); 974 975 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 976 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 977 978 psString query = pxDataGet("stacktool_tobkg.sql"); 979 if (!query) { 980 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 981 return false; 982 } 983 984 psString whereClause = psStringCopy(""); // WHERE conditions to add 985 if (psListLength(where->list)) { 986 psString new = psDBGenerateWhereConditionSQL(where, NULL); 987 psStringAppend(&whereClause, "\nAND %s", new); 988 psFree(new); 989 } 990 psFree(where); 991 992 psStringAppend(&query, "\nORDER by priority DESC, stack_id"); 993 994 // treat limit == 0 as "no limit" 995 if (limit) { 996 psString limitString = psDBGenerateLimitSQL(limit); 997 psStringAppend(&query, " %s", limitString); 998 psFree(limitString); 999 } 1000 1001 if (!p_psDBRunQueryF(config->dbh, query, whereClause)) { 1002 psError(PS_ERR_UNKNOWN, false, "database error"); 1003 psFree(query); 1004 return false; 1005 } 1006 psFree(query); 1007 1008 psArray *output = p_psDBFetchResult(config->dbh); 1009 if (!output) { 1010 psErrorCode err = psErrorCodeLast(); 1011 switch (err) { 1012 case PS_ERR_DB_CLIENT: 1013 psError(PXTOOLS_ERR_SYS, false, "database error"); 1014 case PS_ERR_DB_SERVER: 1015 psError(PXTOOLS_ERR_PROG, false, "database error"); 1016 default: 1017 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 1018 } 1019 1020 return false; 1021 } 1022 if (!psArrayLength(output)) { 1023 psTrace("stacktool", PS_LOG_INFO, "no rows found"); 1024 psFree(output); 1025 return true; 1026 } 1027 1028 if (psArrayLength(output)) { 1029 // negative simple so the default is true 1030 if (!ippdbPrintMetadatas(stdout, output, "stackBkgSkyfile", !simple)) { 954 1031 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 955 1032 psFree(output); … … 1681 1758 PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false); 1682 1759 PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", false, false); 1760 PXOPT_LOOKUP_S16(background_model, config->args, "-set_background_model", false, false); 1683 1761 1684 1762 psMetadata *where = psMetadataAlloc(); 1685 1763 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); 1686 1764 1687 if (!pxSetFaultCode(config->dbh, "stackSumSkyfile", where, fault, quality)) { 1765 if (background_model) { 1766 psMetadata *values = psMetadataAlloc(); 1767 PXOPT_COPY_S16(config->args, values, "-set_background_model", "background_model", "=="); 1768 long rows = psDBUpdateRows(config->dbh,"stackSumSkyfile", where, values); 1769 psFree(values); 1770 if (!rows) { 1771 // This maybe should rollback and error if rows != 1 1772 psError(PS_ERR_UNKNOWN, true, "no rows changed"); 1773 return false; 1774 } 1775 } 1776 else { 1777 if (!pxSetFaultCode(config->dbh, "stackSumSkyfile", where, fault, quality)) { 1688 1778 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 1689 1779 psFree (where); 1690 1780 return false; 1781 } 1691 1782 } 1692 1783 psFree (where); -
branches/eam_branches/ipp-20121130/ippTools/src/stacktool.h
r28375 r34839 31 31 STACKTOOL_MODE_INPUTSKYFILE, 32 32 STACKTOOL_MODE_TOSUM, 33 STACKTOOL_MODE_TOBKG, 33 34 STACKTOOL_MODE_ADDSUMSKYFILE, 34 35 STACKTOOL_MODE_SUMSKYFILE, -
branches/eam_branches/ipp-20121130/ippTools/src/stacktoolConfig.c
r34731 r34839 150 150 psMetadataAddBool(tosumArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 151 151 152 // -tobkg 153 psMetadata *tobkgArgs = psMetadataAlloc(); 154 psMetadataAddS64(tobkgArgs, PS_LIST_TAIL, "-stack_id", 0, "search by stack ID", 0); 155 psMetadataAddStr(tobkgArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by label", NULL); 156 psMetadataAddU64(tobkgArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 157 psMetadataAddBool(tobkgArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 158 152 159 // -addsumskyfile 153 160 psMetadata *addsumskyfileArgs = psMetadataAlloc(); … … 280 287 psMetadataAddS16(updatesumskyfileArgs, PS_LIST_TAIL, "-fault", 0, "set fault code (required)", 0); 281 288 psMetadataAddS16(updatesumskyfileArgs, PS_LIST_TAIL, "-set_quality", 0, "set quality", 0); 282 289 psMetadataAddS16(updatesumskyfileArgs, PS_LIST_TAIL, "-set_background_model", 0, "set background model", 0); 290 283 291 // -exportrun 284 292 psMetadata *exportrunArgs = psMetadataAlloc(); … … 304 312 PXOPT_ADD_MODE("-inputskyfile", "", STACKTOOL_MODE_INPUTSKYFILE, inputskyfileArgs); 305 313 PXOPT_ADD_MODE("-tosum", "", STACKTOOL_MODE_TOSUM, tosumArgs); 314 PXOPT_ADD_MODE("-tobkg", "", STACKTOOL_MODE_TOBKG, tobkgArgs); 306 315 PXOPT_ADD_MODE("-addsumskyfile", "", STACKTOOL_MODE_ADDSUMSKYFILE, addsumskyfileArgs); 307 316 PXOPT_ADD_MODE("-sumskyfile", "list results of stackRun", STACKTOOL_MODE_SUMSKYFILE, sumskyfileArgs); -
branches/eam_branches/ipp-20121130/ippTools/src/staticskytool.c
r34733 r34839 132 132 pxAddLabelSearchArgs(config, whereMD, "-select_data_group", "stackRun.data_group", "LIKE"); 133 133 pxAddLabelSearchArgs(config, whereMD, "-select_filter", "stackRun.filter", "LIKE"); 134 #ifdef notdef135 PXOPT_COPY_F32(config->args, whereMD, "-select_glat_min", "skycell.glat", ">=");136 PXOPT_COPY_F32(config->args, whereMD, "-select_glat_max", "skycell.glat", "<=");137 PXOPT_COPY_F32(config->args, whereMD, "-select_rahours_min", "skycell.radeg/15", ">=");138 PXOPT_COPY_F32(config->args, whereMD, "-select_rahours_max", "skycell.radeg/15", "<=");139 PXOPT_COPY_F32(config->args, whereMD, "-select_radeg_min", "skycell.radeg", ">=");140 PXOPT_COPY_F32(config->args, whereMD, "-select_radeg_max", "skycell.radeg", "<=");141 PXOPT_COPY_F32(config->args, whereMD, "-select_decdeg_min", "skycell.decdeg", ">=");142 PXOPT_COPY_F32(config->args, whereMD, "-select_decdeg_max", "skycell.decdeg", "<=");143 #endif144 134 if (!pxskycellAddWhere(config, whereMD)) { 145 135 psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments"); … … 686 676 psStringAppend(&query, "\nGROUP BY sky_id"); 687 677 if (num_filters) { 688 psStringAppend(&query, "\nHAVING COUNT(filter) >= %d", num_filters);678 psStringAppend(&query, "\nHAVING COUNT(filter) = %d", num_filters); 689 679 } 690 680 … … 1049 1039 pxAddLabelSearchArgs(config, whereMD, "-select_data_group", "staticskyRun.data_group", "LIKE"); 1050 1040 pxAddLabelSearchArgs(config, whereMD, "-select_filter", "stackRun.filter", "LIKE"); 1041 if (!pxskycellAddWhere(config, whereMD)) { 1042 psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments"); 1043 return false; 1044 } 1051 1045 1052 1046 PXOPT_LOOKUP_BOOL(rerun, config->args, "-rerun", false); … … 1128 1122 psString sky_label = psMetadataLookupStr(&status, row, "label"); 1129 1123 psString sky_data_group = psMetadataLookupStr(&status, row, "data_group"); 1124 psString sky_dist_group = psMetadataLookupStr(&status, row, "dist_group"); 1130 1125 1131 1126 // create a staticskyRun … … 1138 1133 label ? label : sky_label, 1139 1134 data_group ? data_group : sky_data_group, 1140 dist_group ,1135 dist_group ? dist_group : sky_dist_group, 1141 1136 reduction, 1142 1137 registered, … … 1159 1154 1160 1155 psMetadata *where = psMetadataAlloc(); 1161 PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycal_id", "=="); 1162 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 1163 PXOPT_COPY_STR(config->args, where, "-state", "state", "=="); 1156 PXOPT_COPY_S64(config->args, where, "-skycal_id", "skycal_id", "=="); 1157 PXOPT_COPY_S64(config->args, where, "-sky_id", "sky_id", "=="); 1158 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); 1159 PXOPT_COPY_STR(config->args, where, "-label", "skycalRun.label", "=="); 1160 PXOPT_COPY_STR(config->args, where, "-state", "skycalRun.state", "=="); 1161 if (!pxskycellAddWhere(config, where)) { 1162 psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments"); 1163 return false; 1164 } 1164 1165 if (!psListLength(where->list)) { 1165 1166 psFree(where); … … 1168 1169 } 1169 1170 1170 psString query = psStringCopy("UPDATE skycalRun ");1171 psString query = psStringCopy("UPDATE skycalRun JOIN stackRun using(stack_id) join skycell using(tess_id, skycell_id)"); 1171 1172 1172 1173 // pxUpdateRun gets parameters from config->args and updates … … 1276 1277 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 1277 1278 PXOPT_LOOKUP_S32(n_astrom, config->args, "-n_astrom", false, false); 1278 PXOPT_LOOKUP_S32(n_detections, config->args, "-n_detections", false, false); 1279 PXOPT_LOOKUP_S32(n_extended, config->args, "-n_extended", false, false); 1279 PXOPT_LOOKUP_S32(n_detections, config->args,"-n_detections", false, false); 1280 PXOPT_LOOKUP_S32(n_extended, config->args, "-n_extended", false, false); 1281 PXOPT_LOOKUP_S32(n_forced, config->args, "-n_forced", false, false); 1280 1282 1281 1283 PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false); … … 1318 1320 n_detections, 1319 1321 n_extended, 1322 n_forced, 1320 1323 zpt_obs, 1321 1324 zpt_stdev, -
branches/eam_branches/ipp-20121130/ippTools/src/staticskytoolConfig.c
r34733 r34839 126 126 psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-label", 0, "search by label", NULL); 127 127 psMetadataAddStr(resultArgs, PS_LIST_TAIL, "-data_group", 0, "search by data_group (LIKE comparison)", NULL); 128 psMetadataAddS16(resultArgs, PS_LIST_TAIL, "-num_filters", 0, "search by number of filters in the inputs (>=)", 0);128 psMetadataAddS16(resultArgs, PS_LIST_TAIL, "-num_filters", 0, "search by number of filters in the inputs", 0); 129 129 pxskycellAddArguments(resultArgs); 130 130 psMetadataAddS16(resultArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); … … 166 166 psMetadataAddStr(defineskycalrunArgs, PS_LIST_TAIL, "-select_data_group", PS_META_DUPLICATE_OK, "search by stackRun data_group (LIKE comparison, multiple OK)", NULL); 167 167 psMetadataAddStr(defineskycalrunArgs, PS_LIST_TAIL, "-select_filter", PS_META_DUPLICATE_OK, "search by filter (LIKE comparison, multiple OK)", NULL); 168 pxskycellAddArguments(defineskycalrunArgs); 168 169 psMetadataAddStr(defineskycalrunArgs, PS_LIST_TAIL, "-set_workdir", 0, "define workdir", NULL); 169 170 psMetadataAddStr(defineskycalrunArgs, PS_LIST_TAIL, "-set_label", 0, "define label", NULL); … … 181 182 psMetadata *updateskycalrunArgs = psMetadataAlloc(); 182 183 psMetadataAddS64(updateskycalrunArgs, PS_LIST_TAIL, "-skycal_id", 0, "search by skycal ID", 0); 184 psMetadataAddS64(updateskycalrunArgs, PS_LIST_TAIL, "-sky_id", 0, "search by sky ID", 0); 185 psMetadataAddS64(updateskycalrunArgs, PS_LIST_TAIL, "-stack_id", 0, "search by stack ID", 0); 183 186 psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL); 184 187 psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-label", 0, "search by label", 0); 188 pxskycellAddArguments(updateskycalrunArgs); 185 189 psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-set_label", 0, "define new value for label", NULL); 186 190 psMetadataAddStr(updateskycalrunArgs, PS_LIST_TAIL, "-set_state", 0, "define new state", NULL); … … 215 219 psMetadataAddS32(addskycalresultArgs, PS_LIST_TAIL, "-n_detections", 0, "define number of detections", 0); 216 220 psMetadataAddS32(addskycalresultArgs, PS_LIST_TAIL, "-n_extended", 0, "define number of extended detections", 0); 221 psMetadataAddS32(addskycalresultArgs, PS_LIST_TAIL, "-n_forced", 0, "define number of forced detections", 0); 217 222 218 223 psMetadataAddStr(addskycalresultArgs, PS_LIST_TAIL, "-path_base", 0, "define base output location", NULL); -
branches/eam_branches/ipp-20121130/ippTools/src/warptool.c
r34731 r34839 1838 1838 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1839 1839 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1840 PXOPT_LOOKUP_BOOL(all, config->args, "-all", false); 1840 1841 1841 1842 psMetadata *where = psMetadataAlloc(); … … 1843 1844 pxAddLabelSearchArgs (config, where, "-label", "warpRun.label", "=="); 1844 1845 1845 psString query = pxDataGet("warptool_pendingcleanupskyfile.sql"); 1846 char * sql_file = all ? "warptool_pendingcleanupskyfile_all.sql" : "warptool_pendingcleanupskyfile.sql"; 1847 psString query = pxDataGet(sql_file); 1846 1848 if (!query) { 1847 1849 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); … … 2057 2059 PXOPT_LOOKUP_S64(magicked, config->args, "-set_magicked", false, false); 2058 2060 PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", false, false); 2061 2059 2062 if (magicked) { 2060 2063 psStringAppend(&set_magicked_skyfile, "\n , warpSkyfile.magicked = %" PRId64, magicked); … … 2063 2066 if (quality) { 2064 2067 psStringAppend(&set_magicked_skyfile, "\n , warpSkyfile.quality = %"PRId16, quality); 2068 } 2069 PXOPT_LOOKUP_S16(background_model, config->args, "-set_background_model", false, false); 2070 if (background_model) { 2071 psStringAppend(&set_magicked_skyfile, "\n , warpSkyfile.background_model = %"PRId16, background_model); 2065 2072 } 2066 2073 } else if (!strcmp(data_state, "cleaned") || !strcmp(data_state, "purged")) { … … 2123 2130 // warp_id, skycell_id, fault are required 2124 2131 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 2125 2126 if (!state) { 2132 PXOPT_LOOKUP_S16(background_model, config->args, "-set_background_model", false, false); 2133 if (background_model) { 2134 // CZW 2012-12-06: I'm unclear why we don't use this form for all updates? 2135 psMetadata *where = psMetadataAlloc(); 2136 psMetadata *values = psMetadataAlloc(); 2137 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); 2138 PXOPT_COPY_STR(config->args, where, "-skycell_id", "skycell_id", "=="); 2139 PXOPT_COPY_S16(config->args, values, "-set_background_model", "background_model", "=="); 2140 long rows = psDBUpdateRows(config->dbh,"warpSkyfile", where, values); 2141 psFree(values); 2142 psFree(where); 2143 if (!rows) { 2144 // This maybe should rollback and error if rows != 1 2145 psError(PS_ERR_UNKNOWN, true, "no rows changed"); 2146 return false; 2147 } 2148 } 2149 else if (!state) { 2127 2150 psMetadata *where = psMetadataAlloc(); 2128 2151 PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "=="); -
branches/eam_branches/ipp-20121130/ippTools/src/warptoolConfig.c
r34731 r34839 364 364 psMetadataAddStr(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "list blocks for specified label", NULL); 365 365 psMetadataAddS64(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-warp_id", 0, "search by warp ID (required)", 0); 366 psMetadataAddBool(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-all", 0, "list all skycells regardless of data_state", false); 366 367 psMetadataAddBool(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 367 368 psMetadataAddU64(pendingcleanupskyfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); … … 409 410 psMetadataAddS16(updateskyfileArgs, PS_LIST_TAIL, "-set_quality", 0,"new quality value", 0); 410 411 psMetadataAddStr(updateskyfileArgs, PS_LIST_TAIL, "-set_state", 0, "set state", 0); 411 412 psMetadataAddS16(updateskyfileArgs, PS_LIST_TAIL, "-set_background_model", 0, "set the background_model value", 0); 412 413 // -exportrun 413 414 psMetadata *exportrunArgs = psMetadataAlloc(); -
branches/eam_branches/ipp-20121130/magic/censorObjects/src/censorLoop.c
r33626 r34839 29 29 30 30 31 32 33 31 // select the current recipe 34 32 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, CENSOR_RECIPE); … … 58 56 // check on the mask file at this level if possible 59 57 badMaskFile = censorBadFileByView(badMaskFile, inMask, config, view); 58 59 bool checkInputOnly = psMetadataLookupBool(NULL, config->arguments, "CHECK.INPUT.ONLY"); 60 60 61 61 // files associated with the science image … … 116 116 if (!readout->data_exists) { continue; } 117 117 118 if (!censorReadout (readout, config, view, badMaskFile)) ESCAPE; 118 if (!checkInputOnly) { 119 if (!censorReadout (readout, config, view, badMaskFile)) ESCAPE; 120 } 119 121 120 122 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE;
Note:
See TracChangeset
for help on using the changeset viewer.
