Changeset 33989 for trunk/ippScripts/scripts/addstar_run.pl
- Timestamp:
- Jun 7, 2012, 11:42:36 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/addstar_run.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/addstar_run.pl
r33525 r33989 38 38 } 39 39 my $minidvodb_path; 40 my $stage_extra1 ; 41 my ( $add_id, $camera, $stage, $stage_id, $ multi_num, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update,40 41 my ( $add_id, $camera, $stage, $stage_id, $stage_extra1, $outroot, $stageroot, $dbname, $reduction, $dvodb, $minidvodb, $minidvodb_name, $minidvodb_group, $image_only, $verbose, $no_update, 42 42 $no_op, $redirect, $save_temps); 43 43 GetOptions( … … 46 46 'stage|s=s' => \$stage, # Camera 47 47 'stage_id|w=s' => \$stage_id, 48 ' multi_num|w=s' => \$multi_num, # the number for a staticskymulti (for finding cmf)48 'stage_extra1|w=s' => \$stage_extra1, # the number for a staticskymulti (for finding cmf), or stack_id 49 49 'dbname|d=s' => \$dbname, # Database name 50 50 'outroot|w=s' => \$outroot, # output file base name … … 162 162 } 163 163 } 164 if (($stage =~/sta ticsky/) || ($stage =~/stack/)) {164 if (($stage =~/stack/)) { 165 165 $fpaObjects =~ s/smf$/cmf/; 166 166 $fpaObjectsAlt =~ s/smf$/cmf/; 167 } 167 168 } 169 my $fpaObjects1; 170 my $fpaObjects2; 168 171 my $checkalt = 0; 169 172 if ($stage =~/staticsky/) { 170 $fpaObjects =~ s/smf$/cmf/; #this should do nothing because it was already modded above 171 &my_die( "can't find the filter_num for staticsky_multi, giving up.", $add_id, $PS_EXIT_SYS_ERROR) unless (defined $multi_num); 172 my $nice_num = sprintf ("%03d", $multi_num); 173 $fpaObjects =~ s/cmf$/$nice_num.cmf/; #this make it look for .001.cmf, etc 174 if ($multi_num == 0) { 175 $checkalt =1 ; #if it's staticsky and multi_num = 0 there's an alternate file to try if this one doesn't work 176 } 173 $checkalt = 1; 174 my $sources = $ipprc->filename("PSPHOT.OUT.CMF.MEF", $stageroot); #this is mostly rigtht except the .cmf needs either 175 # .000.cmf or .stk.xxxxx.cmf 176 print "$sources\n\n\n"; 177 &my_die( "can't find the filter_num for staticsky_multi, giving up.", $add_id, $PS_EXIT_SYS_ERROR) unless (defined $stage_extra1); 178 179 180 $fpaObjects1 = $sources; 181 $fpaObjects2 = $sources; 182 $fpaObjects = $sources; 183 184 my $nice_num = sprintf ("%03d", $stage_extra1); 185 186 $fpaObjects1 =~ s/cmf$/stk.$stage_extra1.cmf/; 187 $fpaObjects2 =~ s/cmf$/$nice_num.cmf/; #this make it look for .001.cmf, etc 188 # we have 3 of them to try 189 my $realFile = $ipprc->file_resolve($fpaObjects); 190 my $realFile1 = $ipprc->file_resolve($fpaObjects1); 191 my $realFile2 = $ipprc->file_resolve($fpaObjects2); 192 if (!defined($realFile1)) { 193 if (!defined($realFile2)) { 194 print "using $fpaObjects\n"; 195 196 } else { 197 print "using $fpaObjects2\n"; 198 $fpaObjects = $fpaObjects2; 199 } 200 201 } else { 202 print "using $fpaObjects1\n"; 203 $fpaObjects = $fpaObjects1; 204 } 205 206 177 207 } 178 208 … … 230 260 my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar 231 261 232 my $realFile = $ipprc->file_resolve($fpaObjects); 233 if (!defined($realFile)) { 234 print "can't find $fpaObjects\n"; 235 if ($checkalt) { 236 $realFile = $ipprc->file_resolve($fpaObjectsAlt) or &my_die("Unable to resolve $fpaObjectsAlt", $add_id, $PS_EXIT_SYS_ERROR); 237 $fpaObjects = $fpaObjectsAlt; # want to make sure the correct value is used. 238 } else { 239 # try the 'good one' again and fail i 240 #$realFile = $ipprc->file_resolve($fpaObjects) or 241 &my_die("Unable to resolve $fpaObjects", $add_id, $PS_EXIT_SYS_ERROR); 242 } 243 244 } 262 my $realFile = $ipprc->file_resolve($fpaObjects) or &my_die("Unable to resolve $fpaObjects", $add_id, $PS_EXIT_SYS_ERROR); 263 264 265 245 266 246 267 # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
Note:
See TracChangeset
for help on using the changeset viewer.
