Changeset 35154 for trunk/ippScripts/scripts/background_warp.pl
- Timestamp:
- Feb 12, 2013, 4:24:02 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/background_warp.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/background_warp.pl
r35134 r35154 39 39 40 40 my ($warp_bg_id, $skycell_id, $tess_dir, $reduction, $camera, $dbname, $outroot, $threads, $verbose, $no_update, $no_op, $redirect, $save_temps); 41 my ($astrometry, $imageName, $maskName, $weightName, $magicked , $exp_tag, $alternate_astrometry_label);41 my ($astrometry, $imageName, $maskName, $weightName, $magicked); 42 42 GetOptions( 43 43 'warp_bg_id|i=s' => \$warp_bg_id, # Warp identifier 44 44 'skycell_id|s=s' => \$skycell_id, # Skycell identifier 45 45 'tess_dir|s=s' => \$tess_dir, # Tesselation identifier 46 'exp_tag|=s' => \$exp_tag, # exposure tag47 46 'camera|c=s' => \$camera, # Camera name 48 47 'dbname|d=s' => \$dbname, # Database name … … 52 51 'mask-list=s' => \$maskName, # list of input mask files 53 52 'astrometry=s' => \$astrometry, 54 'alt_cam_label=s' => \$alternate_astrometry_label, # camRun.label for alternate astrometry55 53 'magicked=s' => \$magicked, 56 54 'threads=s' => \$threads, # Number of threads to use for pswarp … … 86 84 } 87 85 88 if ($alternate_astrometry_label) {89 my_die( "--exp_tag is required when using alternate astrometry", $warp_bg_id, $skycell_id, $PS_EXIT_PROG_ERROR )90 unless defined $exp_tag;91 }92 93 86 my $ipprc = PS::IPP::Config->new( $camera ) or 94 87 my_die( "Unable to set up", $warp_bg_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration … … 128 121 if (!defined $imageName) { 129 122 # go find our inputs 130 my $astrom_path_base;131 if (defined $alternate_astrometry_label) {132 my $command = "$camtool -processedexp -exp_tag $exp_tag -label $alternate_astrometry_label";133 $command .= " -dbname $dbname" if $dbname;134 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =135 run(command => $command, verbose => $verbose);136 unless ($success) {137 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);138 &my_die("Unable to perform camtool -processedexp: $error_code", $warp_bg_id, $error_code);139 }140 my $entries = $mdcParser->parse_list(join "", @$stdout_buf) or141 &my_die("Unable to parse metadata config doc", $warp_bg_id, $PS_EXIT_PROG_ERROR);142 my $entry = $entries->[0];143 $astrom_path_base = $entry->{path_base};144 }145 146 123 my ($imageFile, $maskFile, $weightFile); 147 124 ($imageFile, $imageName) = tempfile( "$tempOutRoot.image.list.XXXX", UNLINK => !$save_temps); … … 176 153 $magicked = $file->{magicked}; 177 154 178 if (!$astrom_path_base) { 179 my $cam_path = $file->{cam_path_base}; 180 my $astrom = $ipprc->filename($astromSource, $cam_path); 181 &my_die("Astrometry files don't match: $astrom vs $astrometry", $warp_bg_id, $skycell_id, $PS_EXIT_PROG_ERROR) if defined $astrometry and $astrom ne $astrometry; 182 $astrometry = $astrom; 183 } elsif (!$astrometry) { 184 # using alternate astrometry 185 $astrometry = $ipprc->filename($astromSource, $astrom_path_base); 186 } 155 my $cam_path = $file->{cam_path_base}; 156 my $astrom = $ipprc->filename($astromSource, $cam_path); 157 &my_die("Astrometry files don't match: $astrom vs $astrometry", $warp_bg_id, $skycell_id, $PS_EXIT_PROG_ERROR) if defined $astrometry and $astrom ne $astrometry; 158 $astrometry = $astrom; 187 159 } 188 160 close $imageFile;
Note:
See TracChangeset
for help on using the changeset viewer.
