Changeset 28260 for trunk/ippToPsps/scripts/ippToPsps_run.pl
- Timestamp:
- Jun 8, 2010, 3:01:48 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/scripts/ippToPsps_run.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/scripts/ippToPsps_run.pl
r28249 r28260 12 12 13 13 # globals 14 my ($verbose, $save_temps, $no_op, $no_update, $camera, $batchType, $output, $dvodb, $datastoreProduct, $survey, $singleExpId, $no_publish, $force );14 my ($verbose, $save_temps, $no_op, $no_update, $camera, $batchType, $output, $dvodb, $datastoreProduct, $survey, $singleExpId, $no_publish, $force, $initBatch); 15 15 16 16 # default values for certain globals … … 25 25 $datastoreProduct = "PSPS_test"; 26 26 $force = 0; 27 $initBatch = 0; 27 28 28 29 # get user args … … 62 63 defined $output and 63 64 defined $dvodb and 64 ( defined $survey or defined $singleExpId ); 65 (( defined $survey or defined $singleExpId ) or ( $batchType eq "init")); 66 67 if ($batchType eq "init") {$initBatch = 1;} 65 68 66 69 # check we can run programs and get camera config … … 130 133 131 134 my $query; 132 if (!$singleExpId) { 135 if ($initBatch) { 136 137 $query = $gpc1Db->prepare(<<SQL); 138 139 SELECT 0, 'NULL', 'ThreePi'; 140 SQL 141 } 142 elsif ($singleExpId) { 143 144 $query = $gpc1Db->prepare(<<SQL); 145 146 SELECT DISTINCT rawExp.exp_id, rawExp.exp_name, dist_group 147 FROM rawExp, chipRun 148 WHERE chipRun.exp_id = rawExp.exp_id 149 AND rawExp.exp_id = $singleExpId 150 SQL 151 } 152 else { 133 153 134 154 $query = $gpc1Db->prepare(<<SQL); … … 145 165 146 166 #AND rawExp.dateobs <= '2010-03-12' 147 148 # SELECT DISTINCT rawExp.exp_id, camRun.dist_group149 # FROM camRun, chipRun, rawExp150 # WHERE camRun.chip_id = chipRun.chip_id151 # AND chipRun.exp_id = rawExp.exp_id152 # AND camRun.dist_group LIKE 'ThreePi'153 # AND rawExp.exp_id > $lastExpId154 # ORDER BY rawExp.exp_id ASC155 #SQL156 167 #AND rawExp.exp_id > $lastExpId 157 168 #AND camRun.label LIKE '%$label%' … … 160 171 #AND rawExp.decl >= '-0.157079633' AND rawExp.decl <= '0.157079633' Jims Dec range 161 172 } 162 else {163 164 $query = $gpc1Db->prepare(<<SQL);165 166 SELECT DISTINCT rawExp.exp_id, rawExp.exp_name, dist_group167 FROM rawExp, chipRun168 WHERE chipRun.exp_id = rawExp.exp_id169 AND rawExp.exp_id = $singleExpId170 SQL171 }172 173 173 174 my $batchId = 0; … … 184 185 my ($expId, $expName, $distGroup) = @row; 185 186 186 if ( isExposureAlreadyProcessed($ippToPspsDb, $expId)) {187 if (!$initBatch && isExposureAlreadyProcessed($ippToPspsDb, $expId)) { 187 188 188 189 if ($force) {print "* Forcing....\n";} … … 202 203 my $batchDir = sprintf("B%03d", $batchId); 203 204 my $batchOutputPath = sprintf("$jobOutputPath/%s", $batchDir); 204 print "* Preparing exposure $expId as job '$job'...\n";205 206 # make directories207 205 mkdir($jobOutputPath, 0777); 208 206 mkdir($batchOutputPath, 0777); 207 208 print "* Preparing exposure $expId as job '$job'...\n"; 209 209 210 210 # run IppToPsps program … … 245 245 } 246 246 247 if ($batchType eq "init" ) {print "* Wrote initialisation batch\n"; last;} 248 247 if ($initBatch) {print "* Wrote initialisation batch\n";} 249 248 250 249 print "*\n*******************************************************************************\n\n"; … … 676 675 my ($outputPath) = @_; 677 676 678 my $success = runProgram( "NULL", $outputPath, 0, $batchType);677 my $success = runProgram("NULL", $outputPath, 0, "NULL", "NULL", $batchType); 679 678 return $success; 680 679 }
Note:
See TracChangeset
for help on using the changeset viewer.
