Changeset 29098
- Timestamp:
- Sep 1, 2010, 2:05:56 PM (16 years ago)
- Location:
- tags/ipp-20100823
- Files:
-
- 3 edited
-
ippScripts/scripts/magic_destreak_cleanup.pl (modified) (7 diffs, 1 prop)
-
ippTasks/destreak.pro (modified) (2 diffs, 1 prop)
-
ippTools/share/magicdstool_tocleanup.sql (modified) (2 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20100823/ippScripts/scripts/magic_destreak_cleanup.pl
- Property svn:mergeinfo set to
r27785 r29098 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) { -
tags/ipp-20100823/ippTasks/destreak.pro
- Property svn:mergeinfo set to
r27946 r29098 600 600 book getword magicDSToCleanup $pageName magic_ds_id -var MAGIC_DS_ID 601 601 book getword magicDSToCleanup $pageName camera -var CAMERA 602 book getword magicDSToCleanup $pageName outroot -var OUTROOT602 book getword magicDSToCleanup $pageName stage -var STAGE 603 603 book getword magicDSToCleanup $pageName dbname -var DBNAME 604 604 … … 607 607 host anyhost 608 608 609 $run = magic_destreak_cleanup.pl --magic_ds_id $MAGIC_DS_ID -- camera $CAMERA --logfile $logfile609 $run = magic_destreak_cleanup.pl --magic_ds_id $MAGIC_DS_ID --stage $STAGE --camera $CAMERA --logfile $logfile 610 610 611 611 add_standard_args run -
tags/ipp-20100823/ippTools/share/magicdstool_tocleanup.sql
- Property svn:mergeinfo set to
r25837 r29098 1 1 SELECT 2 2 magic_ds_id, 3 stage, 3 4 magicDSRun.state, 4 5 magicDSRun.outroot, … … 9 10 WHERE magicDSRun.state = 'goto_cleaned' 10 11 -- XXX: need to add fault to magicDSRun 12 -- XXX: the database has been updated, but fault isn't yet used 11 13 -- AND magicDSRun.fault = 0 12 14
Note:
See TracChangeset
for help on using the changeset viewer.
