Changeset 34737
- Timestamp:
- Nov 29, 2012, 2:32:36 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/skycalibration.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/skycalibration.pl
r34151 r34737 33 33 my $psastro = can_run('psastro') or (warn "Can't find psastro" and $missing_tools = 1); 34 34 my $fhead = can_run('fhead') or (warn "Can't find fhead" and $missing_tools = 1); 35 my $fields = can_run('fields') or (warn "Can't find fields" and $missing_tools = 1); 35 36 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 36 37 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); … … 191 192 } 192 193 194 my $resolved = $ipprc->file_resolve($file); 195 if (!$resolved) { 196 &my_die("Unable to find input file: $file", $skycal_id, $PS_EXIT_SYS_ERROR); 197 } 198 199 # read the input header to find the number of detections and the number of detections 200 # with extended model 201 my $n_detections = 0; 202 my $n_extended = 0; 203 { 204 my $command = "echo $resolved | $fields -n SkyChip.psf NAXIS2"; 205 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 206 run(command => $command, verbose => 0); 207 # fields does not return 0 on success 208 (undef, $n_detections) = split " ", join "", @$stdout_buf; 209 chomp $n_detections; 210 &my_die("Unable to find number of detections from $file: ", $skycal_id, $PS_EXIT_SYS_ERROR) 211 unless defined $n_detections; 212 213 214 if (0) { 215 # use ppStatsFromMetadata for this 216 $command = "echo $resolved | $fields -n SkyChip.hdr NDET_EXT"; 217 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 218 run(command => $command, verbose => 0); 219 (undef, $n_extended) = split " ", join "", @$stdout_buf; 220 chomp $n_extended; 221 &my_die("Unable to find number of extended objects from $file: ", $skycal_id, $PS_EXIT_SYS_ERROR) 222 unless defined $n_extended; 223 } 224 } 225 226 193 227 # Perform psastro analysis 194 228 my $output_sources_filerule = 'PSASTRO.OUTPUT.CMF'; … … 246 280 { 247 281 my $command = "$staticskytool -skycal_id $skycal_id"; 282 $command .= " -n_detections $n_detections"; 283 $command .= " -n_extended $n_extended"; 248 284 $command .= " -addskycalresult -path_base $outroot"; 249 285 $command .= " $cmdflags";
Note:
See TracChangeset
for help on using the changeset viewer.
