IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29159


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

Location:
trunk/tools
Files:
3 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
  • trunk/tools/rundiffskycell.pl

    r29141 r29159  
    4141    if !$diff_id or !$skycell_id;
    4242
     43# if we're asked to update redirect the output
     44$redirect = 1 if $update;
     45
    4346my $ipprc =  PS::IPP::Config->new();
    4447my $dbh = getDBHandle();
    4548
    4649# 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'";
     50my $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'";
    4851
    4952my $stmt1 = $dbh->prepare($query1);
     
    5457my $bothways = $results->{bothways};
    5558my $reduction = $results->{reduction};
     59my $fault = $results->{fault};
     60
     61die "cannot update when skycell is not faulted\n" if $update and !$fault;
    5662
    5763die "path_base not found\n" if !$path_base;
     
    105111}
    106112
     113__END__
     114
     115=pod
     116
     117=head1 NAME
     118
     119rundiffskyfile.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
     125Query the database for the results of a diff skycell and rerun the processing, optionally reverting a faulted
     126run.
     127
     128=over 4
     129
     130=item * --diff_id <diff_id>
     131
     132The id of the diffSkyfile run to process.
     133
     134=item * --skycell_id <skycell_id>
     135
     136The skycell_id of the diffSkyfile run to process.
     137
     138=item * --threads <num_threads>
     139
     140The number of threads to use. Default 1.
     141Optional.
     142
     143
     144=item * --update
     145
     146Revert a faulted skycell before processing. If the skycell is not faulted no processing is done.
     147WARNING: insure that the standard science procesing either has diff stage turned off or the
     148label of this diffRun ommited from the list of labels otherwise it may attempt to processes this run at the same time.
     149Optional.
     150
     151=item *  --redirect-output
     152
     153Send the output of the command to the logfile. (This is the default if --update is supplied).
     154Optional.
     155
     156=item * --pretend
     157
     158Just print the commands that would be executed, but do not run them.
     159Optional.
     160
     161=item * --dbname <dbname>
     162
     163Name of the IPP databse to query. Default is 'gpc1'.
     164Optional.
     165
     166
     167=head1 SEE ALSO
     168L<runchipimfile.pl>, L<runcameraexp.pl>, L<rundiffskyfile.pl>
     169
     170=cut
  • trunk/tools/runwarpskycell.pl

    r29142 r29159  
    3636my $dbh = getDBHandle();
    3737
    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'";
     38my $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'";
    3939
    4040my $stmt1 = $dbh->prepare($query1);
     
    4949my $camera = $results->{camera};
    5050my $state = $results->{state};
     51my $fault = $results->{fault};
    5152
     53die "cannot update database for a skycell that is not faulted\n" if $update and !$fault;
    5254
    5355die "path_base not found\n" if !$path_base;
     
    121123}
    122124
     125__END__
     126
     127=pod
     128
     129=head1 NAME
     130
     131runwarpskyfile.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
     137Query the database for the results of a warp skycell and rerun the processing, optionally reverting a faulted
     138run.
     139
     140=over 4
     141
     142=item * --warp_id <warp_id>
     143
     144The id of the warpSkyfile run to process.
     145
     146=item * --skycell_id <skycell_id>
     147
     148The skycell_id of the warpSkyfile run to process.
     149
     150=item * --threads <num_threads>
     151
     152The number of threads to use. Default 1.
     153Optional.
     154
     155
     156=item * --update
     157
     158Revert a faulted skycell before processing. If the skycell is not faulted no processing is done.
     159WARNING: insure that the standard science procesing either has warp stage turned off or the
     160label of this warpRun ommited from the list of labels otherwise it may attempt to processes this run at the same time.
     161Optional.
     162
     163=item *  --redirect-output
     164
     165Send the output of the command to the logfile. (This is the default if --update is supplied).
     166Optional.
     167
     168=item * --pretend
     169
     170Just print the commands that would be executed, but do not run them.
     171Optional.
     172
     173=item * --dbname <dbname>
     174
     175Name of the IPP databse to query. Default is 'gpc1'.
     176Optional.
     177
     178
     179=head1 SEE ALSO
     180L<runchipimfile.pl>, L<runcameraexp.pl>, L<rundiffskyfile.pl>
     181
     182=cut
Note: See TracChangeset for help on using the changeset viewer.