Changeset 27953
- Timestamp:
- May 13, 2010, 2:00:40 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm (modified) (8 diffs)
-
pstamp/scripts/pstamp_job_run.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r27916 r27953 248 248 # With the mdc file it has all of the information that it needs. 249 249 $image_name = "PPIMAGE.CHIP"; 250 $mask_name = "PPIMAGE.CHIP.MASK"; 250 # $mask_name = "PPIMAGE.CHIP.MASK"; 251 # XXX: really need to handle this properly! 252 $mask_name = "PSASTRO.OUTPUT.MASK"; 251 253 $weight_name = "PPIMAGE.CHIP.VARIANCE"; 252 254 $cmf_name = "PSPHOT.OUTPUT"; … … 430 432 $out->{imagedb} = $imagedb; 431 433 434 my $mask_base; 435 if ($want_astrom) { 436 if (! defined $out->{astrom}) { 437 if (! find_astrometry($ipprc, $imagedb, $out, $verbose)) { 438 print STDERR "failed to find astrometry for $stage $stage_id\n"; 439 next; 440 } 441 } 442 # XXX: do this right by looking at the recipe 443 $mask_base = $out->{cam_path_base}; 444 } else { 445 $mask_base = $base; 446 } 447 432 448 if ($base) { 433 449 $out->{image} = $ipprc->filename($image_name, $base, $class_id) if $image_name; 434 $out->{mask} = $ipprc->filename($mask_name, $ base, $class_id) if $mask_name;450 $out->{mask} = $ipprc->filename($mask_name, $mask_base, $class_id) if $mask_name; 435 451 $out->{weight} = $ipprc->filename($weight_name, $base, $class_id) if $weight_name; 436 452 $out->{cmf} = $ipprc->filename($cmf_name, $base, $class_id) if $cmf_name; 437 453 $out->{psf} = $ipprc->filename($psf_name, $base, $class_id) if $psf_name; 438 454 $out->{backmdl}= $ipprc->filename($backmdl_name, $base, $class_id) if $backmdl_name; 439 }440 if ($want_astrom and ! defined $out->{astrom}) {441 $out->{astrom} = find_astrometry($ipprc, $imagedb, $image, $verbose);442 455 } 443 456 … … 842 855 # cache of results of ppConfigDump 843 856 my %astromSources; 844 my $last_exp_id = 0;845 my $last AstromFile;857 # my $last_exp_id = 0; 858 my $lastCamRun; 846 859 847 860 # find the astrometry file for a given exposure 848 861 # return undef if no completed camRun exists 862 # XXX Right now this probably only works cameras where the astrometry is done at the camera stage 849 863 sub find_astrometry { 850 864 my $ipprc = shift; … … 856 870 857 871 my $exp_id = $image->{exp_id}; 858 if ( ($exp_id eq $last_exp_id) and $lastAstromFile) {872 if (defined $lastCamRun) { 859 873 # running camtool 60 times is really expensive when the answer is the same every time 860 return $lastAstromFile; 861 } 862 $last_exp_id = 0; 863 $lastAstromFile = undef; 874 $image->{astrom} = $lastCamRun->{astrom}; 875 $image->{cam_path_base} = $lastCamRun->{path_base}; 876 return 1; 877 } 878 # $last_exp_id = 0; 879 # $lastAstromFile = undef; 880 $lastCamRun = undef; 864 881 865 882 my $camRun = getCamRunByExpID($exp_id); … … 871 888 unless ($success) { 872 889 print STDERR @$stderr_buf; 873 return undef;890 return 0; 874 891 } 875 892 … … 879 896 if (!$output) { 880 897 print STDERR "no output returned from $command\n" if $verbose; 881 return undef;898 return 0; 882 899 } 883 900 my $camruns = parse_md_fast($mdcParser, $output); 884 901 if (!$camruns) { 885 return undef;902 return 0; 886 903 } 887 904 … … 897 914 if (!$camRun) { 898 915 # no cam runs for this exposure id therefore best astrometry is whatever is in the header 899 return undef;916 return 0; 900 917 } 901 918 updateCamRunCache($camRun); … … 927 944 my $astromFile = $ipprc->filename($astromSource, $camRoot); 928 945 if ($astromFile) { 929 $lastAstromFile = $astromFile; 930 $last_exp_id = $exp_id; 931 } 932 933 return $astromFile; 946 $lastCamRun = $camRun; 947 $lastCamRun->{astrom} = $astromFile; 948 # $last_exp_id = $exp_id; 949 } else { 950 return 0; 951 } 952 953 $image->{astrom} = $astromFile; 954 $image->{cam_path_base} = $camRoot; 955 956 return 1; 934 957 } 935 958 -
trunk/pstamp/scripts/pstamp_job_run.pl
r27947 r27953 89 89 $argString = $params->{job_args}; 90 90 91 # XXX: should we do any other sanity checking? 92 my_die("argument list is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString; 93 94 # XXX: remove -astrom from argString and add it here 95 91 96 $argString .= " -file $params->{image}"; 92 97 $argString .= " -mask $params->{mask}"; … … 94 99 $argString .= " -variance $params->{weight}"; 95 100 } 96 97 # XXX: should we do any other sanity checking?98 my_die("argument list is empty", $job_id, $PS_EXIT_DATA_ERROR) if !$argString;99 101 100 102 my $command = "$ppstamp $outputBase $argString";
Note:
See TracChangeset
for help on using the changeset viewer.
