Changeset 29159
- Timestamp:
- Sep 15, 2010, 11:02:40 AM (16 years ago)
- Location:
- trunk/tools
- Files:
-
- 3 edited
-
runcameraexp.pl (modified) (5 diffs)
-
rundiffskycell.pl (modified) (3 diffs)
-
runwarpskycell.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/runcameraexp.pl
r29158 r29159 32 32 my $dbh = getDBHandle(); 33 33 34 my $query = "SELECT rawExp.camera, rawExp.exp_tag, camProcessedExp.path_base, cam Run.dvodb, camRun.reduction, camRun.state FROM camRun JOIN camProcessedExp USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) WHERE cam_id = $cam_id";34 my $query = "SELECT rawExp.camera, rawExp.exp_tag, camProcessedExp.path_base, camProcessedExp.fault, camRun.dvodb, camRun.reduction, camRun.state FROM camRun JOIN camProcessedExp USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) WHERE cam_id = $cam_id"; 35 35 36 36 my $stmt = $dbh->prepare($query); … … 44 44 my $reduction = $results->{reduction}; 45 45 my $state = $results->{state}; 46 my $fault = $results->{fault}; 46 47 47 48 die "path_base not found\n" if !$path_base; … … 51 52 die "state not found\n" if !$state; 52 53 die "reduction not found\n" if !$reduction; 54 55 die "Cannot update when run is not faulted\n" if $update and ! $fault; 53 56 54 57 my $run_state; … … 63 66 $command .= " --reduction $reduction" if $reduction and ($reduction ne "NULL"); 64 67 $command .= " --dvodb $dvodb" if $dvodb and ($dvodb ne "NULL"); 65 $command .= " --redirect-output" if $redirect ;68 $command .= " --redirect-output" if $redirect or $update; 66 69 $command .= " --no-update" unless $update; 67 70 $command .= " --verbose" unless $no_verbose; 68 71 $command .= " --dbname $dbname" if $dbname; 72 69 73 70 74 … … 109 113 } 110 114 115 __END__ 116 117 =pod 118 119 =head1 NAME 120 121 runcameraexp.pl - gather the parameters for and execute camera_exp.pl 122 123 =head1 SYNOPSIS 124 125 perl runcameraexp.pl --cam_id <cam_id> [--update] [--redirect-output] [--pretend] [--dbname <dbname>] 126 127 Query the database for the results of a completed camera run and rerun the processing, optionally reverting a faulted 128 run. 129 130 =over 4 131 132 =item * --cam_id <cam_id> 133 134 The id of the camera run to process. 135 136 =item * --update 137 138 Revert a faulted run before processing. WARNING: insure that the standard science procesing either has camera stage turned off or the 139 label of this camRun ommited from the label list otherwise it may attempt to processes this run at the same time. 140 Optional. 141 142 =item * --redirect-output 143 144 Send the output of the command to the logfile. (This is the default if --update is supplied); 145 Optional. 146 147 =item * --pretend 148 149 Just print the commands that would be executed, but do not run them. 150 Optional. 151 152 153 =item * --dbname <dbname> 154 155 Name of the IPP databse to query. Default is 'gpc1'. 156 Optional. 157 158 159 =head1 SEE ALSO 160 L<runchipimfile.pl>, L<runwarpskyfile.pl>, L<rundiffskyfile.pl> 161 162 =cut -
trunk/tools/rundiffskycell.pl
r29141 r29159 41 41 if !$diff_id or !$skycell_id; 42 42 43 # if we're asked to update redirect the output 44 $redirect = 1 if $update; 45 43 46 my $ipprc = PS::IPP::Config->new(); 44 47 my $dbh = getDBHandle(); 45 48 46 49 # find warp warp diffs that have a cleaned magicDSRun 47 my $query1 = "SELECT path_base, diff_skyfile_id,bothways,reduction,diff_mode FROM diffRun JOIN diffSkyfile USING(diff_id) JOIN diffInputSkyfile USING(diff_id, skycell_id) WHERE diff_id = $diff_id AND skycell_id = '$skycell_id'";50 my $query1 = "SELECT path_base, diff_skyfile_id,bothways,reduction,diff_mode, diffSkyfile.fault FROM diffRun JOIN diffSkyfile USING(diff_id) JOIN diffInputSkyfile USING(diff_id, skycell_id) WHERE diff_id = $diff_id AND skycell_id = '$skycell_id'"; 48 51 49 52 my $stmt1 = $dbh->prepare($query1); … … 54 57 my $bothways = $results->{bothways}; 55 58 my $reduction = $results->{reduction}; 59 my $fault = $results->{fault}; 60 61 die "cannot update when skycell is not faulted\n" if $update and !$fault; 56 62 57 63 die "path_base not found\n" if !$path_base; … … 105 111 } 106 112 113 __END__ 114 115 =pod 116 117 =head1 NAME 118 119 rundiffskyfile.pl - gather the parameters for and execute diff_skycell.pl 120 121 =head1 SYNOPSIS 122 123 perl rundiffskyfile.pl --diff_id <diff_id> --skycell_id <skycell_id> [--threads <num_threads>] [--update] [--redirect-output] [--pretend] [--dbname <dbname>] 124 125 Query the database for the results of a diff skycell and rerun the processing, optionally reverting a faulted 126 run. 127 128 =over 4 129 130 =item * --diff_id <diff_id> 131 132 The id of the diffSkyfile run to process. 133 134 =item * --skycell_id <skycell_id> 135 136 The skycell_id of the diffSkyfile run to process. 137 138 =item * --threads <num_threads> 139 140 The number of threads to use. Default 1. 141 Optional. 142 143 144 =item * --update 145 146 Revert a faulted skycell before processing. If the skycell is not faulted no processing is done. 147 WARNING: insure that the standard science procesing either has diff stage turned off or the 148 label of this diffRun ommited from the list of labels otherwise it may attempt to processes this run at the same time. 149 Optional. 150 151 =item * --redirect-output 152 153 Send the output of the command to the logfile. (This is the default if --update is supplied). 154 Optional. 155 156 =item * --pretend 157 158 Just print the commands that would be executed, but do not run them. 159 Optional. 160 161 =item * --dbname <dbname> 162 163 Name of the IPP databse to query. Default is 'gpc1'. 164 Optional. 165 166 167 =head1 SEE ALSO 168 L<runchipimfile.pl>, L<runcameraexp.pl>, L<rundiffskyfile.pl> 169 170 =cut -
trunk/tools/runwarpskycell.pl
r29142 r29159 36 36 my $dbh = getDBHandle(); 37 37 38 my $query1 = "SELECT warpSkyfile.path_base, warp _skyfile_id, warpRun.tess_id, warpRun.reduction, chipRun.magicked, rawExp.camera, warpRun.state FROM warpRun JOIN warpSkyfile USING(warp_id) JOIN warpImfile USING(warp_id, skycell_id) JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) WHERE warp_id = $warp_id AND skycell_id = '$skycell_id'";38 my $query1 = "SELECT warpSkyfile.path_base, warpSkyfile.fault, warp_skyfile_id, warpRun.tess_id, warpRun.reduction, chipRun.magicked, rawExp.camera, warpRun.state FROM warpRun JOIN warpSkyfile USING(warp_id) JOIN warpImfile USING(warp_id, skycell_id) JOIN fakeRun USING(fake_id) JOIN camRun USING(cam_id) JOIN chipRun USING(chip_id) JOIN rawExp USING(exp_id) WHERE warp_id = $warp_id AND skycell_id = '$skycell_id'"; 39 39 40 40 my $stmt1 = $dbh->prepare($query1); … … 49 49 my $camera = $results->{camera}; 50 50 my $state = $results->{state}; 51 my $fault = $results->{fault}; 51 52 53 die "cannot update database for a skycell that is not faulted\n" if $update and !$fault; 52 54 53 55 die "path_base not found\n" if !$path_base; … … 121 123 } 122 124 125 __END__ 126 127 =pod 128 129 =head1 NAME 130 131 runwarpskyfile.pl - gather the parameters for and execute warp_skycell.pl 132 133 =head1 SYNOPSIS 134 135 perl runwarpskyfile.pl --warp_id <warp_id> --skycell_id <skycell_id> [--threads <num_threads>] [--update] [--redirect-output] [--pretend] [--dbname <dbname>] 136 137 Query the database for the results of a warp skycell and rerun the processing, optionally reverting a faulted 138 run. 139 140 =over 4 141 142 =item * --warp_id <warp_id> 143 144 The id of the warpSkyfile run to process. 145 146 =item * --skycell_id <skycell_id> 147 148 The skycell_id of the warpSkyfile run to process. 149 150 =item * --threads <num_threads> 151 152 The number of threads to use. Default 1. 153 Optional. 154 155 156 =item * --update 157 158 Revert a faulted skycell before processing. If the skycell is not faulted no processing is done. 159 WARNING: insure that the standard science procesing either has warp stage turned off or the 160 label of this warpRun ommited from the list of labels otherwise it may attempt to processes this run at the same time. 161 Optional. 162 163 =item * --redirect-output 164 165 Send the output of the command to the logfile. (This is the default if --update is supplied). 166 Optional. 167 168 =item * --pretend 169 170 Just print the commands that would be executed, but do not run them. 171 Optional. 172 173 =item * --dbname <dbname> 174 175 Name of the IPP databse to query. Default is 'gpc1'. 176 Optional. 177 178 179 =head1 SEE ALSO 180 L<runchipimfile.pl>, L<runcameraexp.pl>, L<rundiffskyfile.pl> 181 182 =cut
Note:
See TracChangeset
for help on using the changeset viewer.
