IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9091


Ignore:
Timestamp:
Oct 2, 2006, 11:54:11 AM (20 years ago)
Author:
Paul Price
Message:

Adding -no-update option (bug 825).

Location:
trunk/ippScripts/scripts
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/detrend_apply_norm.pl

    r9004 r9091  
    1717    $input,                     # Input file
    1818    $camera,                    # Camera
    19     $detType                    # Detrend type
     19    $detType,                   # Detrend type
     20    $no_update                  # Don't update the database
    2021    );
    2122GetOptions(
     
    2627    'input_uri|u=s'     => \$input,
    2728    'camera|c=s'        => \$camera,
    28     'det_type|t=s'      => \$detType
     29    'det_type|t=s'      => \$detType,
     30    'no-update'         => \$no_update
    2931    ) or pod2usage( 2 );
    3032   
     
    6264
    6365# Update the database
    64 {
     66unless ($no_update) {
    6567    my $command = "$dettool -addnormalizedimfile -det_id $detId -iteration $iter -class_id $classId ".
    6668        "-uri $output"; # Command to run
  • trunk/ippScripts/scripts/detrend_calc_norm.pl

    r9005 r9091  
    1616# Parse command-line arguments
    1717my ($detId,                     # Detrend id
    18     $iter                       # Iteration
     18    $iter,                      # Iteration
     19    $no_update                  # Don't update the database?
    1920    );
    2021GetOptions(
    2122        'det_id|d=s'    => \$detId,
    2223        'iteration|i=s' => \$iter,
     24        'no-update'     => \$no_update
    2325        ) or pod2usage( 2 );
    2426
     
    9496
    9597# Process output normalisations
    96 {
     98unless ($no_update) {
    9799    foreach my $normItem (@$norms) {
    98100        my $className = $normItem->{name}; # Name of component
  • trunk/ippScripts/scripts/detrend_create_resid.pl

    r9004 r9091  
    1616
    1717my ($det_id, $iter, $exp_id, $class_id, $det_type, $detrend,
    18         $input_uri);
     18        $input_uri, $no_update);
    1919GetOptions(
    2020    'det_id|d=s'        => \$det_id,
     
    2525    'detrend=s'         => \$detrend,
    2626    'input_uri|u=s'     => \$input_uri,
     27    'no-update'         => \$no_update
    2728) or pod2usage( 2 );
    2829
     
    104105
    105106# Add the processed file to the database
    106 {
     107unless ($no_update) {
    107108    my $command = "$dettool -addresidimfile -det_id $det_id -iteration $iter -exp_id $exp_id " .
    108109        "-class_id $class_id -recip $recipe -uri $outputName -b1_uri $bin1Name " .
  • trunk/ippScripts/scripts/detrend_process.pl

    r9090 r9091  
    1414use Pod::Usage qw( pod2usage );
    1515
    16 my ($det_id, $exp_id, $class, $class_id, $det_type, $input_uri, $output_uri);
     16my ($det_id, $exp_id, $class, $class_id, $det_type, $input_uri, $output_uri, $no_update);
    1717GetOptions(
    1818    'det_id|d=s'        => \$det_id,
     
    2222    'det_type|t=s'      => \$det_type,
    2323    'input_uri|u=s'     => \$input_uri,
     24    'no-update'         => \$no_update
    2425) or pod2usage( 2 );
    2526
     
    8586
    8687# Add the processed file to the database
    87 {
     88unless ($no_update) {
    8889    my $command = "$dettool -addprocessed -det_id $det_id -exp_id $exp_id " .
    8990        "-class_id $class_id -recip $recipe -uri $outputImage"; # Command to run dettool
  • trunk/ippScripts/scripts/detrend_reject_exp.pl

    r9004 r9091  
    1515use Pod::Usage qw( pod2usage );
    1616
    17 my ($det_id, $iter, $det_type);
     17my ($det_id, $iter, $det_type, $no_update);
    1818GetOptions(
    1919    'det_id|d=s'        => \$det_id,
    2020    'iteration=s'       => \$iter,
    2121    'det_type|t=s'      => \$det_type,
     22    'no-update'         => \$no_update
    2223) or pod2usage( 2 );
    2324
     
    158159
    159160# Put the result into the database
    160 {
    161     my $command = "$dettool -adddetrunsummary -det_id $det_id -iteration $iter " .
    162         "-bg " . $meanStats->mean() . " -bg_stdev " . $stdevStats->mean() .
    163         " -bg_mean_stdev " . $meanStdevStats->mean();
    164     $command .= " -reject" if not $master;
    165 
    166     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    167         run(command => $command, verbose => 1);
    168     die "Unable to perform dettool -adddetrunsummary: $error_code\n" if not $success;
    169 }
    170 
    171 # Re-run processing if required
    172 {
    173     my $command = "$dettool -updatedetrun -det_id $det_id";
    174     if ($stop) {
    175         $command .= ' -stop';
    176     } else {
    177         $command .= ' -again';
     161unless ($no_update) {
     162    {
     163        my $command = "$dettool -adddetrunsummary -det_id $det_id -iteration $iter " .
     164            "-bg " . $meanStats->mean() . " -bg_stdev " . $stdevStats->mean() .
     165            " -bg_mean_stdev " . $meanStdevStats->mean();
     166        $command .= " -reject" if not $master;
     167       
     168        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     169            run(command => $command, verbose => 1);
     170        die "Unable to perform dettool -adddetrunsummary: $error_code\n" if not $success;
    178171    }
    179172   
    180     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    181         run(command => $command, verbose => 1);
    182     die "Unable to perform dettool -updatedetrun: $error_code\n" if not $success;
     173    # Re-run processing if required
     174    {
     175        my $command = "$dettool -updatedetrun -det_id $det_id";
     176        if ($stop) {
     177            $command .= ' -stop';
     178        } else {
     179            $command .= ' -again';
     180        }
     181       
     182        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     183            run(command => $command, verbose => 1);
     184        die "Unable to perform dettool -updatedetrun: $error_code\n" if not $success;
     185    }
    183186}
    184187__END__
  • trunk/ippScripts/scripts/detrend_reject_imfile.pl

    r9004 r9091  
    1515use Pod::Usage qw( pod2usage );
    1616
    17 my ($det_id, $iter, $exp_id, $det_type);
     17my ($det_id, $iter, $exp_id, $det_type, $no_update);
    1818GetOptions(
    1919    'det_id|d=s'        => \$det_id,
     
    2121    'exp_id|e=s'        => \$exp_id,
    2222    'det_type|t=s'      => \$det_type,
     23    'no-update'         => \$no_update
    2324) or pod2usage( 2 );
    2425
     
    193194
    194195# Add the result into the database
    195 {
     196unless ($no_update) {
    196197    my $command = "$dettool -addresidexp -det_id $det_id -iteration $iter -exp_id $exp_id " .
    197198        "-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " .
  • trunk/ippScripts/scripts/detrend_stack.pl

    r9004 r9091  
    2222    'det_type|t=s'      => \$det_type,
    2323    'camera|c=s'        => \$camera,
     24    'no-update'         => \$no_update
    2425) or pod2usage( 2 );
    2526
     
    111112
    112113# Add the resultant into the database
    113 {
     114unless ($no_update) {
    114115    my $command = "$dettool -addstacked -det_id $det_id -iteration $iter -class_id $class_id" .
    115116        " -uri $outputStack -recip $recipe"; # Command to run
  • trunk/ippScripts/scripts/phase0exp.pl

    r8715 r9091  
    1010use Data::Dumper;
    1111
     12use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
     13
     14my ($expid, $no_update);
     15
     16GetOptions(
     17    'exp_id|e=s'    => \$expid,
     18    'no-update'     => \$no_update
     19) or pod2usage( 2 );
     20
     21pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     22pod2usage(
     23    -msg => "Required options: --exp_id",
     24    -exitval => 3,
     25) unless defined $expid;
     26
     27# Define setup
    1228use constant TYPE => "exp_type"; # Observation type keyword
    1329use constant DETRENDS => [ "bias", "dark", "flat", "fringe" ]; # Observation types to mark as detrend
     
    4258###                           "time" # Time of exposure --- not yet implemented
    4359                           ];
    44 
    45 if (scalar @ARGV == 0 || scalar @ARGV >= 2) {
    46     die "Perform phase 0 processing at the exposure level.\n\n" .
    47         "Usage: $0 EXP_ID\n\n";
    48 }
    49 my $expid = shift @ARGV;        # Exposure id
    5060
    5161
     
    106116
    107117# Output results to the database
    108 {
     118unless ($no_update) {
    109119    my $command = "$p0tool -updateexp -exp_id $expid"; # Command to execute to update exposure parameters
    110120   
Note: See TracChangeset for help on using the changeset viewer.