IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 15, 2010, 11:02:40 AM (16 years ago)
Author:
bills
Message:

fail if --update and the component is not faulted. redirect output if update
add pod documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/runcameraexp.pl

    r29158 r29159  
    3232my $dbh = getDBHandle();
    3333
    34 my $query = "SELECT rawExp.camera, rawExp.exp_tag, camProcessedExp.path_base, 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";
     34my $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";
    3535
    3636my $stmt = $dbh->prepare($query);
     
    4444my $reduction = $results->{reduction};
    4545my $state = $results->{state};
     46my $fault = $results->{fault};
    4647
    4748die "path_base not found\n" if !$path_base;
     
    5152die "state not found\n" if !$state;
    5253die "reduction not found\n" if !$reduction;
     54
     55die "Cannot update when run is not faulted\n" if $update and ! $fault;
    5356
    5457my  $run_state;
     
    6366$command .= " --reduction $reduction" if $reduction and ($reduction ne "NULL");
    6467$command .= " --dvodb $dvodb" if $dvodb and ($dvodb ne "NULL");
    65 $command .= " --redirect-output" if $redirect;
     68$command .= " --redirect-output" if $redirect or $update;
    6669$command .= " --no-update" unless $update;
    6770$command .= " --verbose" unless $no_verbose;
    6871$command .= " --dbname $dbname" if $dbname;
     72
    6973
    7074
     
    109113}
    110114
     115__END__
     116
     117=pod
     118
     119=head1 NAME
     120
     121runcameraexp.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
     127Query the database for the results of a completed camera run and rerun the processing, optionally reverting a faulted
     128run.
     129
     130=over 4
     131
     132=item * --cam_id <cam_id>
     133
     134The id of the camera run to process.
     135
     136=item * --update
     137
     138Revert a faulted run before processing. WARNING: insure that the standard science procesing either has camera stage turned off or the
     139label of this camRun ommited from the label list otherwise it may attempt to processes this run at the same time.
     140Optional.
     141
     142=item *  --redirect-output
     143
     144Send the output of the command to the logfile. (This is the default if --update is supplied);
     145Optional.
     146
     147=item * --pretend
     148
     149Just print the commands that would be executed, but do not run them.
     150Optional.
     151
     152
     153=item * --dbname <dbname>
     154
     155Name of the IPP databse to query. Default is 'gpc1'.
     156Optional.
     157
     158
     159=head1 SEE ALSO
     160L<runchipimfile.pl>, L<runwarpskyfile.pl>, L<rundiffskyfile.pl>
     161
     162=cut
Note: See TracChangeset for help on using the changeset viewer.