Changeset 35909
- Timestamp:
- Aug 8, 2013, 9:49:03 AM (13 years ago)
- Location:
- tags/ipp-20130712
- Files:
-
- 12 edited
- 1 copied
-
PS-IPP-PStamp (modified) (1 prop)
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (11 diffs)
-
ippTools/share/releasetool_listrelexp.sql (modified) (1 diff, 1 prop)
-
ippTools/share/warptool_warped.sql (modified) (1 diff, 1 prop)
-
ippTools/src/releasetool.c (modified) (1 diff)
-
pstamp (modified) (1 prop)
-
pstamp/scripts/Makefile.am (modified) (1 diff)
-
pstamp/scripts/psgetcalibinfo (copied) (copied from trunk/pstamp/scripts/psgetcalibinfo )
-
pstamp/scripts/pstamp_job_run.pl (modified) (6 diffs)
-
pstamp/src/ppstampArguments.c (modified) (2 diffs)
-
pstamp/src/ppstampMakeStamp.c (modified) (1 diff)
-
pstamp/src/ppstampOptions.c (modified) (2 diffs)
-
pstamp/src/ppstampOptions.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20130712/PS-IPP-PStamp
- Property svn:mergeinfo set to
-
tags/ipp-20130712/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r35625 r35909 176 176 $need_magic, $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $mjd_min, $mjd_max, 177 177 0, 0, # fwhm cuts are not applied here 178 undef, undef, undef, $verbose); 178 undef, 0, # no cam run information 179 undef, undef, $verbose); 179 180 180 181 return $results; … … 322 323 0, $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $mjd_min, $mjd_max, 323 324 getValOrZero($row->{FWHM_MIN}), getValOrZero($row->{FWHM_MAX}), 324 undef, $release_name, $survey,325 undef, 0, $release_name, $survey, 325 326 $verbose); 326 327 … … 351 352 my $fwhm_max = shift; 352 353 my $selectedAstrom = shift; 354 my $selected_cam_id = shift; 353 355 my $release_name = shift; 354 356 my $survey = shift; … … 602 604 # The image selectors are such that multiple runs my have be returned for the same exposure. 603 605 # Return only the latest one. 604 $images = filterRuns($stage, $ need_magic, $images, $inverse, $verbose);606 $images = filterRuns($stage, $choose_components, $need_magic, $images, $inverse, $verbose); 605 607 } 606 608 … … 699 701 $out->{astrom} = $selectedAstrom; 700 702 $out->{cam_path_base} = $selectedAstrom; 703 $out->{cam_id} = $selected_cam_id if $selected_cam_id; 701 704 if ($selectedAstrom =~ /\.smf$/) { 702 705 $out->{cam_path_base} =~ s/\.smf$//; … … 946 949 $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $mjd_min, $mjd_max, 947 950 $fwhm_min, $fwhm_max, 948 $chip->{astrom}, undef, undef,951 $chip->{astrom}, $chip->{cam_id}, undef, undef, 949 952 $verbose); 950 953 … … 970 973 $dateobs_begin, $dateobs_end, $filter, $data_group, $option_mask, $mjd_min, $mjd_max, 971 974 $fwhm_min, $fwhm_max, 972 undef, $release_name, $survey,975 undef, 0, $release_name, $survey, 973 976 $verbose); 974 977 … … 1302 1305 $image->{astrom} = $astromFile; 1303 1306 $image->{cam_path_base} = $camRoot; 1307 $image->{cam_id} = $camRun->{cam_id}; 1304 1308 1305 1309 return 1; … … 1649 1653 sub filterRuns { 1650 1654 my $stage = shift; 1655 my $drop_duplicate_runs = shift; 1651 1656 my $need_magic = shift; 1652 1657 my $inputs = shift; … … 1694 1699 } 1695 1700 1696 $printed = 1 if (($exp_id == $last_exp_id) and ($run_id == $last_run_id));1701 # $printed = 1 if (($exp_id == $last_exp_id) and ($run_id == $last_run_id)); 1697 1702 1698 1703 # skip if we need magicked run and this one has never been magicked … … 1702 1707 } 1703 1708 1704 if (($exp_id == $last_exp_id) and ($ run_id != $last_run_id)) {1709 if (($exp_id == $last_exp_id) and ($drop_duplicate_runs || ($run_id != $last_run_id))) { 1705 1710 print "Skipping duplicate ${stage}Run $run_id for $exp_id\n" if !$printed; 1706 1711 next; -
tags/ipp-20130712/ippTools/share/releasetool_listrelexp.sql
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/czw_branch/20130211/ippTools/share/releasetool_listrelexp.sql merged eligible /branches/eam_branches/ipp-20121219/ippTools/share/releasetool_listrelexp.sql merged eligible /branches/eam_branches/ipp-20130207/ippTools/share/releasetool_listrelexp.sql merged eligible /branches/eam_branches/ipp-20130307/ippTools/share/releasetool_listrelexp.sql merged eligible /branches/eam_branches/ipp-20130419/ippTools/share/releasetool_listrelexp.sql merged eligible /branches/eam_branches/ipp-20130509/ippTools/share/releasetool_listrelexp.sql merged eligible /trunk/ippTools/share/releasetool_listrelexp.sql merged eligible /branches/czw_branch/20101203/ippTools/share/releasetool_listrelexp.sql 29907-30631 /branches/czw_branch/20120906/ippTools/share/releasetool_listrelexp.sql 34410-34786 /branches/eam_branches/ipp-20101103/ippTools/share/releasetool_listrelexp.sql 29657-29920 /branches/eam_branches/ipp-20101205/ippTools/share/releasetool_listrelexp.sql 29959-30585 /branches/eam_branches/ipp-20110213/ippTools/share/releasetool_listrelexp.sql 30628-31149 /branches/eam_branches/ipp-20110404/ippTools/share/releasetool_listrelexp.sql 31166-31444 /branches/eam_branches/ipp-20110505/ippTools/share/releasetool_listrelexp.sql 31458-31658 /branches/eam_branches/ipp-20110710/ippTools/share/releasetool_listrelexp.sql 31852-32345 /branches/eam_branches/ipp-20110906/ippTools/share/releasetool_listrelexp.sql 32363-32631 /branches/eam_branches/ipp-20111110/ippTools/share/releasetool_listrelexp.sql 32645-32694 /branches/eam_branches/ipp-20120405/ippTools/share/releasetool_listrelexp.sql 33724-33957 /branches/eam_branches/ipp-20120601/ippTools/share/releasetool_listrelexp.sql 33977-34079 /branches/eam_branches/ipp-20120627/ippTools/share/releasetool_listrelexp.sql 34099-34256 /branches/eam_branches/ipp-20120805/ippTools/share/releasetool_listrelexp.sql 34292-34401 /branches/eam_branches/ipp-20120905/ippTools/share/releasetool_listrelexp.sql 34407-34747 /branches/eam_branches/ipp-20121130/ippTools/share/releasetool_listrelexp.sql 34755-34841 /branches/haf_add201112/ippTools/share/releasetool_listrelexp.sql 32980-33029
r35898 r35909 15 15 relExp.zpt_stdev, 16 16 relExp.mcal, 17 relExp.ubercal_dist, 17 18 relExp.path_base, 18 19 relExp.registered, -
Property svn:mergeinfo
set to (toggle deleted branches)
-
tags/ipp-20130712/ippTools/share/warptool_warped.sql
- Property svn:mergeinfo set to
r28627 r35909 13 13 rawExp.decl, 14 14 rawExp.exp_time, 15 camRun.cam_id, 15 16 magicDSRun.state AS dsRun_state, 16 17 IFNULL(magicDSRun.magic_ds_id, 0) AS magic_ds_id -
tags/ipp-20130712/ippTools/src/releasetool.c
r35898 r35909 778 778 779 779 if (priority_order) { 780 psStringAppend(&query, "\nAND priority > 0 order by exp_id, priority DESC"); 780 psStringAppend(&query, "\nAND priority > 0 ORDER BY exp_id, priority DESC"); 781 } else { 782 psStringAppend(&query, "\nORDER BY exp_id, relexp_id DESC"); 781 783 } 782 784 -
tags/ipp-20130712/pstamp
- Property svn:mergeinfo set to
-
tags/ipp-20130712/pstamp/scripts/Makefile.am
r33324 r35909 21 21 pstamp_get_image_job.pl \ 22 22 psmkreq \ 23 psgetcalibinfo \ 23 24 psstatus \ 24 25 pstampstopfaulted \ -
tags/ipp-20130712/pstamp/scripts/pstamp_job_run.pl
r35609 r35909 78 78 my $ppstamp = can_run('ppstamp') or (warn "Can't find ppstamp" and $missing_tools = 1); 79 79 my $pstamp_get_image_job = can_run('pstamp_get_image_job.pl') or (warn "Can't find pstamp_get_image_job.pl" and $missing_tools = 1); 80 my $psgetcalibinfo = can_run('psgetcalibinfo') or (warn "Can't find psgetcalibinfo" and $missing_tools = 1); 80 81 my $dquery_job_run = can_run('dquery_job_run.pl') or (warn "Can't find dquery_job_run.pl" and $missing_tools = 1); 81 my $streaksreplace = can_run('streaksreplace') or (warn "Can't find streaksreplace" and $missing_tools = 1);82 my $magicdstool = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1);83 82 my $whichnode = can_run('whichnode') or (warn "can't find whichnode" and $missing_tools = 1); 84 83 … … 100 99 # XXX: should we do any other sanity checking? 101 100 my_die("argument list is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString; 102 103 my $nan_masked = 1;104 my $muggle = 0;105 if (!$params->{magicked}) {106 $nan_masked = 0;107 } elsif ($params->{magicked} and ($options & ($PSTAMP_REQUEST_UNCENSORED | $PSTAMP_REQUIRE_UNCENSORED))) {108 # Attempt to find or create a muggle image109 $nan_masked = 0;110 $muggle = 1;111 }112 101 113 102 if ($stage eq "raw") { … … 122 111 my @file_list = ($params->{image}); 123 112 124 if ($ nan_masked or ($options & $PSTAMP_SELECT_MASK)) {113 if ($options & $PSTAMP_SELECT_MASK) { 125 114 $mask = $params->{mask}; 126 115 $fileArgs .= " -mask $mask"; … … 162 151 # find our output directory 163 152 my $outdir = dirname($outputBase); 164 my ($tmpImage, $tmpMask, $tmpVariance, $tmproot); 165 166 if ($muggle) { 167 # first see if the original uncensored images are around 168 if (check_for_backups($params, \$fileArgs)) { 169 # We're good to go. fileArgs has been edited to contain the paths for the original uncensored images 170 print "Making stamps from backup images\n"; 171 } elsif (($options & $PSTAMP_REQUIRE_UNCENSORED) and ($stage ne 'chip')) { 172 # user required uncensored but since stage isn't chip we can't rebuild them 173 my_die("uncensored inputs not available for job $job_id", $job_id, $PSTAMP_NOT_AVAILABLE, 'stop'); 174 } elsif (($options & $PSTAMP_REQUEST_UNCENSORED) and ($params->{state} ne 'full') and ($stage ne 'chip')) { 175 # we can only restore pixels for chip stage images if the data has been updated. 176 # the data will have been updated if the params->{state} the state when the job was queued is not 'full' ( 177 # XXX: we should probably be looking explicitly at the job and checking for a dep_id 178 print "Run state was $params->{state}: will make stamps from destreaked $stage images.\n"; 179 # make stamps from uncensored images 180 $muggle = 0; 153 154 my ($calib_fd, $calibfile); 155 if ($stage eq 'chip' or $stage eq 'warp') { 156 my $cam_id = $params->{cam_id}; 157 if (!$cam_id) { 158 carp "no cam_id found in job params\n"; 159 exit $PS_EXIT_PROG_ERROR; 160 } 161 ($calib_fd, $calibfile) = tempfile ("$outdir/calib.XXXX", UNLINK => !$save_temps); 162 close $calib_fd; 163 164 my $command = "$psgetcalibinfo --cam_id $cam_id --output $calibfile --dbname $params->{imagedb}"; 165 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 166 run(command => $command, verbose => $verbose); 167 168 my $exitStatus; 169 if (WIFEXITED($error_code)) { 170 $exitStatus = WEXITSTATUS($error_code); 181 171 } else { 182 # Try and replace the streaks from the recovery images 183 184 my $temp_dir = metadataLookupStr($ipprc->{_siteConfig}, "TEMP.DIR") or &my_die("Unable to find temporary directory in site configuration", $job_id, $PS_EXIT_CONFIG_ERROR); 185 $tmproot = tempdir("$temp_dir/psjob.$job_id.XXXX", CLEANUP => !$save_temps); 186 my $muggle_command = "$streaksreplace -stage $stage -tmproot $tmproot"; 187 # find the "directory" of the input path_base 188 my $inputdir = dirname($image); 189 my $base = basename($image); 190 $tmpImage = "$tmproot/$base"; 191 192 @file_list = (); 193 194 # XXX: We should get the recovery_path_base from the magicDSFile but that requires a bunch of file rule and 195 # stage work. Import the rule here. 196 my $recImage = "$inputdir/REC_$base"; 197 my $newFileArgs = " -file $tmpImage"; 198 $muggle_command .= " -image $image -recimage $recImage"; 199 push @file_list, $recImage; 200 201 if ($mask) { 202 $base = basename($mask); 203 $tmpMask = "$tmproot/$base"; 204 $newFileArgs .= " -mask $tmpMask"; 205 my $recMask = "$inputdir/REC_$base"; 206 $muggle_command .= " -mask $mask -recmask $recMask"; 207 push @file_list, $recMask; 208 } 209 210 if ($variance) { 211 $base = basename($variance); 212 $tmpVariance = "$tmproot/$base"; 213 $newFileArgs .= " -variance $tmpVariance"; 214 my $recVariance = "$inputdir/REC_$base"; 215 $muggle_command .= " -weight $variance -recweight $recVariance"; 216 push @file_list, $recVariance; 217 } 218 if (check_files(0, @file_list)) { 219 # recovery files exist and are accessible restore the excised pixels 220 221 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 222 run(command => $muggle_command, verbose => $verbose); 223 unless ($success) { 224 my $exitStatus = WEXITSTATUS($error_code); 225 my_die( "streaksreplace failed with error code: $exitStatus", $job_id, $exitStatus); 226 } 227 228 # set the ppstamp file arguments 229 $fileArgs = $newFileArgs; 230 } else { 231 if ($options & $PSTAMP_REQUIRE_UNCENSORED) { 232 my_die( "unable to restore uncensored images", $job_id, $PSTAMP_NOT_AVAILABLE); 233 } 234 # just make stamps from the censored images 235 print "Unable to restore uncensored images, will extract stamps from censored images\n"; 236 # these files won't be used so zap them 237 ($tmpImage, $tmpMask, $tmpVariance, $tmproot) = (undef, undef, undef, undef); 238 } 239 } 240 } 241 242 # MAGIC IS DEAD 243 $nan_masked = 0; 172 print STDERR "psgetcalibinfo failed error_code: $error_code\n"; 173 $exitStatus = $PS_EXIT_SYS_ERROR; 174 } 175 exit $exitStatus if $exitStatus; 176 177 if (-s $calibfile == 0) { 178 print "no calibration information found for $cam_id\n"; 179 $calibfile = undef; 180 } 181 } 182 183 # my ($tmpImage, $tmpMask, $tmpVariance, $tmproot); 244 184 245 185 my $command = "$ppstamp $outputBase $argString $fileArgs"; … … 247 187 $command .= " -nocompress" if ($options & $PSTAMP_SELECT_UNCOMPRESSED); 248 188 $command .= " -stage $stage"; 249 $command .= " -censor_masked" if $nan_masked; 250 $command .= " -dbname $dbname" if $dbname; 251 $command .= " -dbserver $dbserver" if $dbserver; 189 $command .= " -forheader $calibfile" if $calibfile; 252 190 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 253 191 run(command => $command, verbose => $verbose); … … 523 461 } 524 462 525 sub check_for_backups {526 my $params = shift;527 my $r_fileArgs = shift;528 529 my $command = "$magicdstool -destreakedfile -stage $params->{stage} -stage_id $params->{stage_id} -component $params->{component} -dbname $params->{imagedb}";530 my $results = runToolAndParse($command, $verbose);531 my $dsComponent = $results->[0];532 533 if ($dsComponent and ($dsComponent->{data_state} eq 'full')) {534 535 print "magicDSFile state is full. Backup images should exist\n";536 537 # replace the file names with the backup paths538 # fileArgs has the form: -file imagename [-mask maskname] [-weight weightname]539 my @args = split " ", $$r_fileArgs;540 541 my $newFileArgs;542 while (@args) {543 my $a = shift @args;544 my $f = shift @args;545 my_die( "unexpected fileArg list $$r_fileArgs", $job_id, $PS_EXIT_PROG_ERROR, 'run') if !$a or !$f;546 547 my $backup_image_name = $ipprc->destreaked_filename($f);548 my_die( "failed to extract backup image name from $f", $job_id, $PS_EXIT_PROG_ERROR, 'run') if !$backup_image_name;549 $newFileArgs .= " $a $backup_image_name";550 }551 $$r_fileArgs = $newFileArgs;552 553 return 1;554 }555 556 return 0;557 }558 559 463 my $neb; 560 464 sub storage_object_exists -
tags/ipp-20130712/pstamp/src/ppstampArguments.c
r34596 r35909 26 26 fprintf(stderr, " [-variance var_image] : variance image\n"); 27 27 fprintf(stderr, " [-sources sources] : sources cmf (ignored for chip stage)\n"); 28 fprintf(stderr, " [-forheader mdcfile : metadata config file contaiing keywords to add to fits headers\n"); 28 29 fprintf(stderr, " [-stage stage] : stage of input image (raw, chip, warp, stack, diff)\n"); 29 30 fprintf(stderr, " [-write_jpeg] : write a JPEG format of the image stamp\n"); … … 135 136 usage(); 136 137 } 138 139 if ((argnum = psArgumentGet(argc, argv, "-forheader"))) { 140 psArgumentRemove(argnum, &argc, argv); 141 if (argnum >= argc) { 142 psError(PSTAMP_ERR_ARGUMENTS, true, "metadata config filename value required with option -forheader"); 143 usage(); 144 } 145 146 const char *filename = argv[argnum]; 147 psArgumentRemove(argnum, &argc, argv); 148 149 unsigned int nFail = 0; 150 options->headerAdditions = psMetadataConfigRead(NULL, &nFail, filename, false); 151 if (nFail || !options->headerAdditions) { 152 psError(PS_ERR_UNKNOWN, false, "failed to read metadata from %s", filename); 153 return false; 154 } 155 } 137 156 138 157 if ((argnum = psArgumentGet(argc, argv, "-no_censor_masked"))) { -
tags/ipp-20130712/pstamp/src/ppstampMakeStamp.c
r35611 r35909 165 165 166 166 ppstampVersionMetadata(outHDU->header, options); 167 168 // copy any user supplied keywords 169 if (options->headerAdditions) { 170 if (!psMetadataOverlay(outHDU->header, options->headerAdditions)) { 171 psError(PS_ERR_UNKNOWN, false, "Failed to copy header additions to output\n"); 172 return false; 173 } 174 } 175 167 176 168 177 return true; -
tags/ipp-20130712/pstamp/src/ppstampOptions.c
r34596 r35909 10 10 { 11 11 psFree(options->chipName); 12 psFree(options->headerAdditions); 12 13 } 13 14 … … 30 31 options->cellName = NULL; 31 32 options->stage = NULL; 33 options->headerAdditions = NULL; 32 34 options->censorMasked = false; 33 35 options->writeJPEG = false; -
tags/ipp-20130712/pstamp/src/ppstampOptions.h
r34596 r35909 12 12 psString cellName; 13 13 psString stage; 14 psMetadata *headerAdditions; 14 15 bool censorMasked; 15 16 bool writeJPEG;
Note:
See TracChangeset
for help on using the changeset viewer.
