Changeset 38000 for trunk/ippScripts
- Timestamp:
- Mar 24, 2015, 2:37:14 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/sc_prepare_camera.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/sc_prepare_camera.pl
r37833 r38000 14 14 use Data::Dumper; 15 15 use File::Basename; 16 use File::Temp qw( tempfile ); 16 17 17 18 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); … … 30 31 my $remotetool = can_run('remotetool') or (warn "Can't find remotetool" and $missing_tools = 1); 31 32 my $camtool = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1); 33 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 32 34 33 35 if ($missing_tools) { … … 88 90 my ($workdir,$exp_tag,$reduction); 89 91 { 92 ### $command = "$camtool -processedexp -cam_id $cam_id "; ### THIS LINE ONLY TO TEST! 90 93 my $command = "$camtool -pendingexp -cam_id $cam_id "; 91 94 $command .= " -dbname $dbname " if defined($dbname); … … 142 145 my $pre_cmd_cmfs = "ls -1 ${remote_chip_path}*.cmf > ${remote_outroot}.cmflist"; 143 146 my $pre_cmd_masks= "ls -1 ${remote_chip_path}*.mk.fits > ${remote_outroot}.masklist"; 147 148 # Despite the previous comment, we do care about the output of pendingimfile, as that 149 # contains information for the exposure. 150 my ($statFile, $statName) = tempfile( "/tmp/cm.$cam_id.stats.XXXX", UNLINK => 1 ); 151 foreach my $line (@$stdout_buf) { 152 print $statFile $line; 153 } 154 close $statFile; 155 156 # parse the stats in the metadata file 157 $command = "$ppStatsFromMetadata $statName - CAMERA_EXP_IMFILE"; 158 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 159 run(command => $command, verbose => $verbose); 160 unless ($success) { 161 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 162 warn("Unable to perform ppStatsFromMetadata: $error_code\n"); 163 exit($error_code); 164 } 165 166 my $results = ''; 167 foreach my $line (@$stdout_buf) { 168 $results .= " $line"; 169 } 170 chomp($results); 171 172 144 173 145 174 my $recipe_psastro = $ipprc->reduction($reduction, 'PSASTRO'); # Recipe to use … … 163 192 $camtool_post_cmd .= " -dbname $dbname " if defined $dbname; 164 193 $camtool_post_cmd .= " -path_base $ipp_outroot -hostname $remote_hostname -dtime_script 0 "; 194 $camtool_post_cmd .= " $results "; # Add exposure information 165 195 my $post_cmd_echo = " echo -n \"$camtool_post_cmd\" > ${remote_outroot}.dbinfo "; 166 196 my $post_cmd_SfM = " ppStatsFromMetadata ${remote_outroot}.stats - CAMERA_EXP_FPA >> ${remote_outroot}.dbinfo ";
Note:
See TracChangeset
for help on using the changeset viewer.
