Changeset 27301 for trunk/ippScripts/scripts/magic_destreak_revert.pl
- Timestamp:
- Mar 16, 2010, 12:39:45 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/magic_destreak_revert.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_destreak_revert.pl
r27092 r27301 30 30 my $magicdstool = can_run('magicdstool') or (warn "Can't find magicdstool" and $missing_tools = 1); 31 31 my $isdestreaked = can_run('isdestreaked') or (warn "Can't find isdestreaked" and $missing_tools = 1); 32 my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1); 32 33 if ($missing_tools) { 33 34 warn("Can't find required tools."); … … 36 37 37 38 # Parse the command-line arguments 38 my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $bothways, $cam_path_base );39 my ($magic_ds_id, $camera, $streaks, $stage, $stage_id, $component, $uri, $path_base, $bothways, $cam_path_base, $cam_reduction); 39 40 my ($outroot, $recoveryroot, $replace, $release, $bytes, $md5sum); 40 41 my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile); … … 48 49 'path_base=s' => \$path_base, # path_base of the input 49 50 'cam_path_base=s'=> \$cam_path_base, # path_base of the associated camera run 51 'cam_reduction=s'=> \$cam_reduction, # reduction class of the associated camera run 50 52 'outroot=s' => \$outroot, # "directory" for temporary images (may be nebulous) 51 53 'recoveryroot=s' => \$recoveryroot,# "directory" for saving the images of excised pixels … … 78 80 79 81 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_ds_id, $component, $PS_EXIT_SYS_ERROR ) if $logfile; 82 my $recipe_psastro = $ipprc->reduction($cam_reduction, 'PSASTRO'); # Recipe to use 83 &my_die("Unrecognised PSASTRO recipe", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_psastro; 80 84 81 85 my $nebulousServer = metadataLookupStr( $ipprc->{_siteConfig}, 'NEB_SERVER' ); … … 112 116 } 113 117 114 &my_die("replace not allowed for non-nebulous files", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) 118 &my_die("replace not allowed for non-nebulous files", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) 115 119 if ($replace eq "T") and !$nebulousInput; 116 120 … … 156 160 $bimage = $backup_path_base . ".fits"; 157 161 } elsif ($stage eq "chip") { 162 # Check to see if we're using dynamic masks 163 my $dynamicMasks; # Use dynamic masks? 164 { 165 # Get the PSASTRO recipe 166 my $command = "$ppConfigDump -camera $camera -recipe PSASTRO $recipe_psastro -dump-recipe PSASTRO -"; 167 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 168 run(command => $command, verbose => $verbose); 169 unless ($success) { 170 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 171 &my_die("Unable to perform ppConfigDump: $error_code", $magic_ds_id, $component, 172 $PS_EXIT_CONFIG_ERROR); 173 } 174 my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or 175 &my_die("Unable to parse metadata config doc", $magic_ds_id, $component, 176 $PS_EXIT_CONFIG_ERROR); 177 178 $dynamicMasks = metadataLookupBool($recipeData, 'REFSTAR_MASK'); 179 } 180 158 181 # we use the mask output from the camera stage for input and replace 159 182 # the output of the chip stage with that mask as well. 160 183 $image = $ipprc->filename("PPIMAGE.CHIP", $path_base, $class_id); 161 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id);162 $ch_mask= $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id);163 184 $weight = $ipprc->filename("PPIMAGE.CHIP.VARIANCE", $path_base, $class_id); 185 186 if ($dynamicMasks) { 187 $mask = $ipprc->filename("PSASTRO.OUTPUT.MASK", $cam_path_base, $class_id); 188 $ch_mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id); 189 } else { 190 $mask = $ipprc->filename("PPIMAGE.CHIP.MASK", $path_base, $class_id); 191 } 164 192 165 193 $bimage = $ipprc->filename("PPIMAGE.CHIP", $backup_path_base, $class_id); … … 261 289 &my_die("failed to restore chip mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR); 262 290 } 263 } 291 } 264 292 265 293
Note:
See TracChangeset
for help on using the changeset viewer.
