Changeset 11575
- Timestamp:
- Feb 1, 2007, 7:25:46 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/phase3.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/phase3.pl
r11492 r11575 132 132 133 133 # Generate the file list, and get the statistics 134 my $outputRoot = $exp_tag . '.p3'; # Root output name 135 $outputRoot = File::Spec->catfile( $workdir, $outputRoot ); 134 my $outputFile = "$exp_tag.p3"; 135 my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile ); 136 136 137 my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1 137 138 my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2 139 my $list3Name = $outputRoot . '.b3.list'; # Name for the input file list for chip astrometry 140 138 141 my @means; # Array of means 139 142 my @stdevs; # Array of stdevs 140 143 open my $list1File, '>' . $list1Name; 141 144 open my $list2File, '>' . $list2Name; 145 open my $list3File, '>' . $list3Name; 146 147 my $chipObjects; 142 148 foreach my $file (@$files) { 143 149 # use the b1_uri as OUTPUT root and convert the filenames … … 145 151 my $class_id = $file->{class_id}; 146 152 my $origRoot = $ipprc->convert_filename_absolute( $file->{b1_uri} ); # Original root name 153 154 # if there is only one chip, we use this name for the input to addstar 155 $chipObjects = $ipprc->filename("PSASTRO.OUTPUT", $origRoot, $class_id); 147 156 print $list1File $ipprc->filename("PPIMAGE.BIN1", $origRoot, $class_id); 148 157 print $list2File $ipprc->filename("PPIMAGE.BIN2", $origRoot, $class_id); 149 print $list1File $ipprc->filename("PSPHOT.OUTPUT", $origRoot, $class_id); 150 print $list1File $ipprc->filename("PSASTRO.OUTPUT", $origRoot, $class_id); 151 # XXX PSASTRO.OUTPUT is explicitly a CHIP output file 152 # XXX below the PSASTRO.OUTPUT must be an FPA output file 153 # print $list1File ($ipprc->convert_filename_absolute($file->{b1_uri}) . "\n"); 154 # print $list2File ($ipprc->convert_filename_absolute($file->{b2_uri}) . "\n"); 158 print $list3File $chipObjects; 155 159 push @means, $file->{bg}; 156 160 push @stdevs, $file->{bg_stdev}; … … 158 162 close $list1File; 159 163 close $list2File; 164 close $list3File; 160 165 161 166 # Output products --- need to synch with the camera configuration! 162 167 my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1 163 168 my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2 164 my $objects = $ipprc->filename("PSASTRO.OUTPUT", $outputRoot); # MEF psastro output 165 166 # if file == CHIP 167 # run psastro +mosastro on PSASTRO.OUTPUT.CHIP 168 # run addstar on PSASTRO.OUTPUT.FPA 169 170 # if file == FPA 171 # run addstar on PSASTRO.OUTPUT.CHIP 169 my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT", $outputRoot); # MEF psastro output 170 171 # run psastro +mosastro on the set of chips 172 # XXX note that this is wrong if imfiles are cells 173 if (@$files > 1) { 174 my $command = "$psastro -list $list3Name $outputRoot +mosastro -chipastro"; 175 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 176 run(command => $command, verbose => 1); 177 unless ($success) { 178 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 179 &my_die("Unable to perform psastro: $error_code", $exp_tag, $error_code); 180 } 181 &my_die("Unable to find expected output file: $fpaObjects", $exp_tag, $PS_EXIT_PROG_ERROR) unless -f $fpaObjects; 182 } else { 183 $fpaObjects = $chipObjects; 184 } 185 186 # run addstar on either the single chip output or the single fpa output 187 # XXX this construct requires the user to have a valid .ptolemyrc 188 # XXX which in turn points at ippconfig/dvo.site 189 { 190 my $command = "addstar -D CAMERA $camera $fpaObjects"; 191 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 192 run(command => $command, verbose => 1); 193 unless ($success) { 194 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 195 &my_die("Unable to perform addstar: $error_code", $exp_tag, $error_code); 196 } 197 } 172 198 173 199 # Make the jpeg for binning 1
Note:
See TracChangeset
for help on using the changeset viewer.
