Changeset 33054 for trunk/ippScripts/scripts/background_warp.pl
- Timestamp:
- Jan 9, 2012, 1:47:47 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/background_warp.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/background_warp.pl
r28544 r33054 38 38 39 39 my ($warp_bg_id, $skycell_id, $tess_dir, $reduction, $camera, $dbname, $outroot, $threads, $verbose, $no_update, $no_op, $redirect, $save_temps); 40 my ($astrometry, $imageName, $maskName, $magicked); 40 41 GetOptions( 41 42 'warp_bg_id|i=s' => \$warp_bg_id, # Warp identifier … … 46 47 'reduction=s' => \$reduction, # Reduction class 47 48 'outroot=s' => \$outroot, # Output root name 49 'image-list=s' => \$imageName, # list of input image files 50 'mask-list=s' => \$maskName, # list of input mask files 51 'astrometry=s' => \$astrometry, 52 'magicked=s' => \$magicked, 48 53 'threads=s' => \$threads, # Number of threads to use for pswarp 49 54 'verbose' => \$verbose, # Print to stdout … … 64 69 and defined $outroot; 65 70 66 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $warp_bg_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 71 if ($imageName) { 72 # we have been invoked in a special mode where the caller tells us all about the inputs 73 # This is used by the postage stamp server to make non-background corrected images without 74 # the existence of a warpBackgroundRun (or chipBackgroundRun) 75 # Make sure all of the inputs were supplied 76 if (!(defined $maskName and defined $astrometry and defined $magicked)) { 77 print STDERR "mask-list, astrometry, and magicked must be supplied if image-list is used\n"; 78 if ($warp_bg_id) { 79 my_die( "invalid argument list.", $warp_bg_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); 80 } 81 exit $PS_EXIT_CONFIG_ERROR; 82 } 83 } 84 85 my $ipprc = PS::IPP::Config->new( $camera ) or 86 my_die( "Unable to set up", $warp_bg_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 67 87 68 88 my $logDest = $ipprc->filename("LOG.EXP", $outroot, $skycell_id) or my_die( "Unable to get log filename", $warp_bg_id, $skycell_id, $PS_EXIT_SYS_ERROR ); … … 97 117 # Get list of filenames 98 118 my $tempOutRoot = "/tmp/background.warp.$warp_bg_id.$skycell_id"; 99 my ($imageFile, $imageName) = tempfile( "$tempOutRoot.image.list.XXXX", UNLINK => !$save_temps); 100 my ($maskFile, $maskName) = tempfile( "$tempOutRoot.mask.list.XXXX", UNLINK => !$save_temps); 101 my $astrometry; # Astrometry filename 102 my $magicked; # Magicked status 103 { 119 if (!defined $imageName) { 120 # go find our inputs 121 my ($imageFile, $maskFile); 122 ($imageFile, $imageName) = tempfile( "$tempOutRoot.image.list.XXXX", UNLINK => !$save_temps); 123 ($maskFile, $maskName) = tempfile( "$tempOutRoot.mask.list.XXXX", UNLINK => !$save_temps); 104 124 my $command = "$bgtool -warpinputs"; 105 125 $command .= " -warp_bg_id $warp_bg_id"; … … 132 152 $astrometry = $astrom; 133 153 } 134 } 135 close $imageFile;136 close $maskFile; 154 close $imageFile; 155 close $maskFile; 156 } 137 157 138 158 &my_die("Can't find input astrometry: $astrometry", $warp_bg_id, $skycell_id, $PS_EXIT_PROG_ERROR) unless $ipprc->file_exists($astrometry);
Note:
See TracChangeset
for help on using the changeset viewer.
