- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/publish_file.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/ippScripts/scripts/publish_file.pl
r25256 r27838 7 7 use Sys::Hostname; 8 8 my $host = hostname(); 9 print "Starting script $0 on $host\n\n"; 9 my $date = `date`; 10 print "\n\n"; 11 print "Starting script $0 on $host at $date\n\n"; 10 12 11 13 use DateTime; … … 32 34 my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1); 33 35 my $ppMops = can_run('ppMops') or (warn "Can't find ppMops" and $missing_tools = 1); 36 my $ppMonet = can_run('ppMonet') or (warn "Can't find ppMonet" and $missing_tools = 1); 34 37 my $dsreg = can_run('dsreg') or (warn "Can't find dsreg" and $missing_tools = 1); 35 38 if ($missing_tools) { … … 81 84 my ($dsFile, $dsFileName) = tempfile("/tmp/publish.$pub_id.ds.XXXX", UNLINK => !$save_temps ); 82 85 86 my $comment; # Comment for exposure 83 87 if ($stage eq 'camera') { 84 88 my $command = "camtool -processedexp -cam_id $stage_id"; … … 100 104 my $file = $ipprc->filename( "PSASTRO.OUTPUT", $path_base ); 101 105 $file = $ipprc->file_resolve($file); 106 my $exp_name = $comp->{exp_name}; 107 my $exp_id = $comp->{exp_id}; 108 my $chip_id = $comp->{chip_id}; 102 109 my $cam_id = $comp->{cam_id}; 110 my $zp = $comp->{zpt_obs}; 111 my $zp_err = $comp->{zpt_stdev}; 112 my $astrom = sqrt($comp->{sigma_ra}**2 + $comp->{sigma_dec}**2); 103 113 my $name = "cam_$cam_id"; 114 $comment = $comp->{comment}; 115 116 if ($product eq "MONET") { 117 my $output = $ipprc->file_resolve( "$outroot.csv.gz", 'create' ) or 118 &my_die( "Unable to resolve output file", $pub_id, $PS_EXIT_SYS_ERROR); 119 120 my $command = "$ppMonet $file $output"; 121 $command .= " -exp_name " . $exp_name if defined $exp_name; 122 $command .= " -exp_id " . $exp_id if defined $exp_id; 123 $command .= " -chip_id " . $chip_id if defined $chip_id; 124 $command .= " -cam_id " . $cam_id if defined $cam_id; 125 $command .= " -zp " . $zp if defined $zp; 126 $command .= " -zp_error " . $zp_err if defined $zp_err; 127 $command .= " -astrom_rms " . $astrom if defined $astrom; 128 129 unless ($no_op) { 130 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 131 run(command => $command, verbose => $verbose); 132 &my_die( "Unable to translate", $pub_id, $PS_EXIT_SYS_ERROR) unless $success; 133 &my_die( "Unable to find translated file $output", $pub_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $output ); 134 } else { 135 print "Not running: $command\n"; 136 } 137 138 $file = $output; 139 } 104 140 print $dsFile "$file|||$product|$name|\n"; 141 105 142 } elsif ($stage eq 'diff') { 106 143 my $command = "difftool -diffskyfile -diff_id $stage_id"; … … 124 161 my $path_base = $comp->{path_base}; # Base name for file 125 162 next if defined $comp->{quality} and $comp->{quality} > 0; 163 print "Warning: mis-matched comments\n" if defined $comment and $comment ne $comp->{comment}; 164 $comment = $comp->{comment} unless defined $comment; 126 165 127 166 (carp "Bad zpt_obs or exp_time for component" and next) if not defined $comp->{zpt_obs} or not defined $comp->{exp_time}; … … 182 221 } 183 222 184 close $mopsPositiveFile ;185 close $mopsNegativeFile ;223 close $mopsPositiveFile if $product eq 'IPP-MOPS'; 224 close $mopsNegativeFile if $product eq 'IPP-MOPS'; 186 225 187 226 if ($product eq 'IPP-MOPS') { … … 201 240 unless ($no_update) { 202 241 my $command = "$dsreg --add $stage.$stage_id --copy --abspath --product $product --type $product --list $dsFileName"; 242 $command .= " --ps0 \"$comment\"" if defined $comment; 203 243 204 244 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note:
See TracChangeset
for help on using the changeset viewer.
