Changeset 29097 for trunk/ippScripts/scripts/magic_destreak_cleanup.pl
- Timestamp:
- Sep 1, 2010, 2:03:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/magic_destreak_cleanup.pl
r27785 r29097 38 38 39 39 # Parse the command-line arguments 40 my ($magic_ds_id, $camera );40 my ($magic_ds_id, $camera, $stage); 41 41 my ($dbname, $save_temps, $verbose, $no_update, $no_op, $logfile); 42 42 … … 44 44 'magic_ds_id=s' => \$magic_ds_id,# Magic destreak run identifier 45 45 'camera=s' => \$camera, # camera for evaluating file rules 46 'stage=s' => \$stage, # camera for evaluating file rules 46 47 'save-temps' => \$save_temps, # Save temporary files? 47 48 'dbname=s' => \$dbname, # Database name … … 56 57 -exitval => 3) unless 57 58 defined $magic_ds_id and 58 defined $camera; 59 # defined $stage and 60 # defined $stage_id; 59 defined $camera and 60 defined $stage; 61 61 62 62 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration … … 79 79 my $dbh = DBI->connect($dsn, $dbuser, $dbpassword) or die "Cannot connect to mysql server\n"; 80 80 81 my $q1 = "SELECT magicDSRun.*, camera, camProcessedExp.path_base AS cam_path_base, camRun.reduction AS cam_reduction, magicRun.inverse" 82 . " FROM magicDSRun JOIN magicRun USING(magic_id) JOIN rawExp USING(exp_id) LEFT JOIN camProcessedExp USING(cam_id) LEFT JOIN camRun USING(cam_id)" 83 . " WHERE magic_ds_id = $magic_ds_id"; 81 my $q1; 82 83 if ($stage ne 'diff') { 84 $q1 = "SELECT magicDSRun.*, camera, camProcessedExp.path_base AS cam_path_base, camRun.reduction AS cam_reduction" 85 . " FROM magicDSRun JOIN magicRun USING(magic_id) JOIN rawExp USING(exp_id) LEFT JOIN camProcessedExp USING(cam_id) LEFT JOIN camRun USING(cam_id)"; 86 } else { 87 $q1 = "SELECT magicDSRun.*, diffRun.diff_mode FROM magicDSRun JOIN diffRun ON stage_id = diffRun.diff_id AND stage = 'diff'"; 88 } 89 $q1 .= " WHERE magic_ds_id = $magic_ds_id"; 90 84 91 my $q2 = "SELECT * from magicDSFile where magic_ds_id = $magic_ds_id"; 85 92 … … 89 96 &my_die ("Unable to find magicDSRun $magic_ds_id", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if !$nrows; 90 97 my $run = $stmt1->fetchrow_hashref(); 98 $stmt1->finish(); 91 99 92 100 my $state = $run->{state}; 93 my $stage = $run->{stage};94 101 my $stage_id = $run->{stage_id}; 95 102 my $cam_path_base = $run->{cam_path_base}; 96 103 my $cam_reduction = $run->{cam_reduction}; 97 104 $cam_reduction = 'DEFAULT' if !$cam_reduction or ($cam_reduction eq 'NULL'); 98 my $inverse = $run->{inverse}; 105 106 my $warp_warp = ($stage eq 'diff' and $run->{diff_mode} eq 1); 99 107 100 108 … … 105 113 &my_die("clean not allowed for raw stage, use goto_restore", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if $stage eq "raw"; 106 114 107 my $recipe_psastro = $ipprc->reduction($cam_reduction, 'PSASTRO'); # Recipe to use 108 &my_die("Unrecognised PSASTRO recipe", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_psastro; 115 my $recipe_psastro; 116 if ($stage eq 'chip') { 117 $recipe_psastro = $ipprc->reduction($cam_reduction, 'PSASTRO'); # Recipe to use 118 &my_die("Unrecognised PSASTRO recipe", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_psastro; 119 } 109 120 110 121 … … 217 228 delete_files($rimage, $rmask, $rweight, $rsources, $rastrom, $bimage, $bmask, $bweight, $bsources, $bastrom, $bch_mask, $rch_mask); 218 229 219 if ($stage eq "diff" and $ inverse) {230 if ($stage eq "diff" and $warp_warp) { 220 231 my $name = "PPSUB.INVERSE"; 221 232 if ($backup_path_base) {
Note:
See TracChangeset
for help on using the changeset viewer.
