Changeset 38073 for trunk/pstamp/scripts/pstamp_job_run.pl
- Timestamp:
- Mar 31, 2015, 3:14:22 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstamp_job_run.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstamp_job_run.pl
r38062 r38073 92 92 my $stack_bkg_mk_mdc = can_run('stack_bkg_mk_mdc.pl') or (warn "Can't find stack_bkg_mk_mdc.pl" and $missing_tools = 1); 93 93 my $fpack = can_run('fpack') or (warn "Can't find fpack" and $missing_tools = 1); 94 94 my $staticskytool = can_run('staticskytool') or (warn "Can't find staticskytool" and $missing_tools = 1); 95 95 96 96 if ($missing_tools) { … … 177 177 # be copied from the cmf file. 178 178 $argString .= " -recipe PSPHOT STACKPHOT" 179 } 180 } elsif ($stage eq 'stack') { 181 # no astrom file for stack (skycal cmf) Go find a staticsky cmf and use that 182 # otherwise silently ignore the request for sources since the stack smf is not useful. 183 my $staticsky_cmf = findStaticskyCMF($params); 184 if ($staticsky_cmf) { 185 print "Using staticsky cmf file $staticsky_cmf for sources\n"; 186 $argString .= " -write_cmf"; 187 $fileArgs .= " -sources $staticsky_cmf"; 188 # Set psphot recipe to STACKPHOT so that the extended source paramters will 189 # be copied from the cmf file. 190 $argString .= " -recipe PSPHOT STACKPHOT"; 191 push @file_list, $staticsky_cmf; 192 } else { 193 print "No skycal or staticsky cmf for $params->{stack_id} ignoring request for sources\n"; 179 194 } 180 195 } elsif ($params->{cmf}) { … … 864 879 return 0; 865 880 } 881 sub findStaticskyCMF { 882 my $params = shift; 883 my $stack_id = $params->{stack_id}; 884 885 &my_die( "NO stack_id found in findStaticskyCMF\n", 886 $job_id, $PS_EXIT_PROG_ERROR, 'run') if !$stack_id; 887 888 my $command = "$staticskytool -dbname $params->{imagedb} -result -stack_id $stack_id"; 889 my $results = runToolAndParse($command, $verbose); 890 891 if (!$results) { 892 print "no staticsky results found for stack $stack_id\n"; 893 return undef; 894 } 895 896 my $latest; 897 my $latest_sky_id = 0; 898 foreach my $result (@$results) { 899 if ($result->{sky_id} > $latest_sky_id) { 900 $latest = $result; 901 $latest_sky_id = $result->{sky_id}; 902 } 903 } 904 if ($latest) { 905 # XXXX Use proper file rule 906 return $latest->{path_base} . ".stk.$stack_id.cmf"; 907 } 908 # Can't happen can it? 909 return undef; 910 } 866 911 867 912 sub my_die
Note:
See TracChangeset
for help on using the changeset viewer.
