IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18562


Ignore:
Timestamp:
Jul 15, 2008, 10:33:17 AM (18 years ago)
Author:
eugene
Message:

implement redirect-output everywhere; cleanup logfile names; rename detrend_resid.pl to detrend_resid_imfile.pl; rename detrend_reject_imfile.pl to detrend_resid_exp.pl

Location:
trunk/ippScripts
Files:
2 added
2 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/Build.PL

    r18358 r18562  
    4242        scripts/detrend_norm_apply.pl
    4343        scripts/detrend_norm_exp.pl
    44         scripts/detrend_resid.pl
    45         scripts/detrend_reject_imfile.pl
     44        scripts/detrend_resid_imfile.pl
     45        scripts/detrend_resid_exp.pl
    4646        scripts/detrend_reject_exp.pl
    4747        scripts/chip_imfile.pl
  • trunk/ippScripts/scripts/camera_exp.pl

    r18360 r18562  
    2727
    2828my ( $exp_tag, $cam_id, $camera, $outroot, $recipe, $dbname, $reduction, $dvodb, $verbose, $no_update,
    29      $no_op, $save_temps );
     29     $no_op, $redirect, $save_temps );
    3030GetOptions(
    31            'exp_tag=s'          => \$exp_tag, # Exposure identifier
    32            'cam_id=s'          => \$cam_id, # Camtool identifier
    33            'recipe=s'          => \$recipe, # Recipe to use
    34            'camera|c=s'        => \$camera, # Camera
    35            'dbname|d=s'        => \$dbname, # Database name
    36            'outroot|w=s'       => \$outroot, # output file base name
    37            'reduction=s'       => \$reduction, # Reduction class
    38            'dvodb|w=s'         => \$dvodb,  # output DVO database
    39            'verbose'           => \$verbose,   # Print to stdout
    40            'no-update'         => \$no_update, # Update the database?
    41            'no-op'             => \$no_op, # Don't do any operations?
    42            'save-temps'        => \$save_temps, # Save temporary files?
    43            ) or pod2usage( 2 );
     31    'exp_tag=s'          => \$exp_tag, # Exposure identifier
     32    'cam_id=s'          => \$cam_id, # Camtool identifier
     33    'recipe=s'          => \$recipe, # Recipe to use
     34    'camera|c=s'        => \$camera, # Camera
     35    'dbname|d=s'        => \$dbname, # Database name
     36    'outroot|w=s'       => \$outroot, # output file base name
     37    'reduction=s'       => \$reduction, # Reduction class
     38    'dvodb|w=s'         => \$dvodb,  # output DVO database
     39    'verbose'           => \$verbose,   # Print to stdout
     40    'no-update'         => \$no_update, # Update the database?
     41    'no-op'             => \$no_op, # Don't do any operations?
     42    'redirect-output'   => \$redirect,
     43    'save-temps'        => \$save_temps, # Save temporary files?
     44    ) or pod2usage( 2 );
    4445
    4546pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     
    5455
    5556$ipprc->define_camera($camera);
     57
     58my $logDest = $ipprc->filename("LOG.EXP", $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
     59
     60$ipprc->redirect_output($logDest) if $redirect;
    5661
    5762# Recipes to use based on reduction class
     
    185190my $fpaStats   = $ipprc->filename("PSASTRO.STATS",      $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
    186191my $traceDest  = $ipprc->filename("TRACE.EXP",          $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
    187 my $logDest    = $ipprc->filename("LOG.EXP",            $outroot) or &my_die("Missing entry from camera config", $cam_id, $PS_EXIT_CONFIG_ERROR);
    188192
    189193# convert supplied DVO database name to UNIX filename
     
    320324    carp($msg);
    321325    if (defined $cam_id and not $no_update) {
    322         my $command = "$camtool -addprocessedexp -cam_id $cam_id -uri UNKNOWN -code $exit_code";
     326        my $command = "$camtool -addprocessedexp";
     327        $command .= " -cam_id $cam_id";
     328        $command .= " -uri UNKNOWN";
     329        $command .= " -code $exit_code";
     330        $command .= " -path_base $outroot";
    323331        $command .= " -hostname $host" if defined $host;
    324332        $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/chip_imfile.pl

    r18360 r18562  
    2626# Parse the command-line arguments
    2727my ( $exp_id, $chip_id, $class_id, $uri, $camera, $outroot, $dbname, $reduction, $verbose,
    28      $no_update, $no_op );
     28     $no_update, $no_op, $redirect );
    2929GetOptions(
    30            'exp_id=s'      => \$exp_id,    # Exposure identifier
    31            'chip_id=s'     => \$chip_id,   # Chiptool identifier
    32            'class_id=s'    => \$class_id,  # Class identifier
    33            'uri|u=s'       => \$uri,       # Input FITS file
    34            'camera|c=s'    => \$camera,    # Camera
    35            'outroot|w=s'   => \$outroot,   # output file base name
    36            'dbname|d=s'    => \$dbname,    # Database name
    37            'reduction=s'   => \$reduction, # Reduction class
    38            'verbose'       => \$verbose,   # Print to stdout
    39            'no-update'     => \$no_update, # Don't update the database?
    40            'no-op'         => \$no_op,     # Don't do any operations?
    41            ) or pod2usage( 2 );
     30    'exp_id=s'          => \$exp_id,    # Exposure identifier
     31    'chip_id=s'         => \$chip_id,   # Chiptool identifier
     32    'class_id=s'        => \$class_id,  # Class identifier
     33    'uri|u=s'           => \$uri,       # Input FITS file
     34    'camera|c=s'        => \$camera,    # Camera
     35    'outroot|w=s'       => \$outroot,   # output file base name
     36    'dbname|d=s'        => \$dbname,    # Database name
     37    'reduction=s'       => \$reduction, # Reduction class
     38    'verbose'           => \$verbose,   # Print to stdout
     39    'no-update'         => \$no_update, # Don't update the database?
     40    'no-op'             => \$no_op,     # Don't do any operations?
     41    'redirect-output'   => \$redirect,
     42    ) or pod2usage( 2 );
    4243
    4344pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     
    5253
    5354$ipprc->define_camera($camera);
     55
     56my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
     57
     58$ipprc->redirect_output($logDest) if $redirect;
    5459
    5560# Recipes to use based on reduction class
     
    125130my $outputStats   = $ipprc->filename("PPIMAGE.STATS",       $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    126131my $traceDest     = $ipprc->filename("TRACE.IMFILE",        $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    127 my $logDest       = $ipprc->filename("LOG.IMFILE",          $outroot, $class_id) or &my_die("Missing entry from camera config", $exp_id, $chip_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    128132
    129133# Run ppImage
  • trunk/ippScripts/scripts/detrend_correct_imfile.pl

    r18048 r18562  
    108108$command .= " -exp_id $exp_id";
    109109$command .= " -class_id $class_id";
    110 $command .= " -uri $outputImage -path_base $outputRoot";
     110$command .= " -uri $outputImage";
     111$command .= " -path_base $outputRoot";
    111112$command .= " -dbname $dbname" if defined $dbname;
    112113
     
    138139        $command .= " -exp_id $exp_id";
    139140        $command .= " -class_id $class_id";
     141        $command .= " -path_base $outputRoot";
    140142        $command .= " -code $exit_code";
    141143        $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/detrend_norm_apply.pl

    r18361 r18562  
    212212        $command .= " -iteration $iter";
    213213        $command .= " -class_id $class_id";
     214        $command .= " -path_base $outroot";
    214215        $command .= " -code $exit_code";
    215216        $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/detrend_norm_calc.pl

    r18362 r18562  
    2020use PS::IPP::Config 1.01 qw( :standard );
    2121
     22my $ipprc = PS::IPP::Config->new(); # IPP configuration
     23
    2224use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
    2325use Pod::Usage qw( pod2usage );
    2426
    2527# Parse command-line arguments
    26 my ($det_id, $iter, $detType, $outroot, $dbname, $verbose, $no_update, $no_op);
     28my ($det_id, $iter, $detType, $outroot, $dbname, $verbose, $no_update, $no_op, $redirect );
    2729GetOptions(
    28         'det_id|d=s'    => \$det_id,    # Detrend id                         
    29         'iteration|i=s' => \$iter,      # Iteration                         
    30         'det_type|t=s'  => \$detType,   # Detrend type                       
    31         'outroot|w=s'   => \$outroot,   # output file base name
    32         'dbname|d=s'    => \$dbname,    # Database name                     
    33         'verbose'       => \$verbose,   # Print to stdout
    34         'no-update'     => \$no_update, # Don't update the database?         
    35         'no-op'         => \$no_op,     # Don't do operations               
    36         ) or pod2usage( 2 );
     30    'det_id|d=s'        => \$det_id,    # Detrend id                         
     31    'iteration|i=s'     => \$iter,      # Iteration                         
     32    'det_type|t=s'      => \$detType,   # Detrend type                       
     33    'outroot|w=s'       => \$outroot,   # output file base name
     34    'dbname|d=s'        => \$dbname,    # Database name                     
     35    'verbose'           => \$verbose,   # Print to stdout
     36    'no-update'         => \$no_update, # Don't update the database?         
     37    'no-op'             => \$no_op,     # Don't do operations               
     38    'redirect-output'   => \$redirect,
     39    ) or pod2usage( 2 );
    3740
    3841pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     
    4447    defined $detType and
    4548    defined $outroot;
     49
     50my $logfile = $outroot . ".log";
     51
     52$ipprc->redirect_output($logfile) if $redirect;
    4653
    4754use constant STATISTIC => 'bg'; # Background statistic to use from the database
     
    225232        $command .= " -det_id $det_id";
    226233        $command .= " -iteration $iter";
     234        # XXX EAM : we should add this to the db : $command .= " -path_base $outroot";
    227235        $command .= " -code $exit_code";
    228236        $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/detrend_norm_exp.pl

    r17943 r18562  
    2626use Pod::Usage qw( pod2usage );
    2727
    28 my ($det_id, $iter, $det_type, $camera, $outroot, $dbname, $reduction, $verbose, $no_update, $no_op, $save_temps);
     28my ($det_id, $iter, $det_type, $camera, $outroot, $dbname, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps);
    2929GetOptions(
    30            'det_id|d=s'        => \$det_id,
    31            'iteration|i=s'     => \$iter,
    32            'camera|c=s'        => \$camera,
    33            'det_type|t=s'      => \$det_type,
    34            'outroot|w=s'       => \$outroot,   # output file base name
    35            'dbname|d=s'        => \$dbname, # Database name
    36            'reduction|=s'      => \$reduction,
    37            'verbose'           => \$verbose,   # Print to stdout
    38            'no-update'         => \$no_update,
    39            'no-op'             => \$no_op,
    40            'save-temps'        => \$save_temps, # Save temporary files?
    41            ) or pod2usage( 2 );
     30    'det_id|d=s'        => \$det_id,
     31    'iteration|i=s'     => \$iter,
     32    'camera|c=s'        => \$camera,
     33    'det_type|t=s'      => \$det_type,
     34    'outroot|w=s'       => \$outroot,   # output file base name
     35    'dbname|d=s'        => \$dbname, # Database name
     36    'reduction|=s'      => \$reduction,
     37    'verbose'           => \$verbose,   # Print to stdout
     38    'no-update'         => \$no_update,
     39    'no-op'             => \$no_op,
     40    'redirect-output'   => \$redirect,
     41    'save-temps'        => \$save_temps, # Save temporary files?
     42    ) or pod2usage( 2 );
    4243
    4344pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     
    4950    defined $det_type and
    5051    defined $outroot;
     52
     53my $logfile = $outroot . ".log";
     54
     55$ipprc->redirect_output($logfile) if $redirect;
    5156
    5257$ipprc->define_camera($camera);
     
    8792my ($files, $command, $success, $error_code, $full_buf, $stdout_buf, $stderr_buf);
    8893{
    89     $command  = "$dettool -normalizedimfile -det_id $det_id -iteration $iter"; # Command to run
     94    $command  = "$dettool -normalizedimfile"; # Command to run
     95    $command .= " -det_id $det_id";
     96    $command .= " -iteration $iter";
    9097    $command .= " -dbname $dbname" if defined $dbname;
    9198    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    181188        $command .= " -det_id $det_id";
    182189        $command .= " -iteration $iter";
     190        $command .= " -path_base $outroot ";
    183191        $command .= " -code $exit_code";
    184192        $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/detrend_process_exp.pl

    r18048 r18562  
    200200        $command .= " -exp_id $exp_id";
    201201        $command .= " -code $exit_code";
     202        $command .= " -path_base $outroot";
    202203        $command .= " -dbname $dbname" if defined $dbname;
    203204        system ($command);
  • trunk/ippScripts/scripts/detrend_process_imfile.pl

    r18049 r18562  
    5858$ipprc->define_camera($camera);
    5959
    60 my $logDest     = $ipprc->filename("LOG.IMFILE",     $outroot, $class_id)
    61       or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR);
     60my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    6261
    6362$ipprc->redirect_output($logDest) if $redirect;
     
    174173        $command .= " -exp_id $exp_id";
    175174        $command .= " -class_id $class_id";
     175        $command .= " -path_base $outroot";
    176176        $command .= " -code $exit_code";
    177177        $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/detrend_reject_exp.pl

    r18460 r18562  
    2828use Pod::Usage qw( pod2usage );
    2929
    30 my ($det_id, $iter, $det_type, $camera, $outroot, $filter, $dbname, $verbose, $no_update, $no_op);
     30my ($det_id, $iter, $det_type, $camera, $outroot, $filter, $dbname, $verbose, $no_update, $no_op, $redirect);
    3131GetOptions(
    32            'det_id|d=s'        => \$det_id,
    33            'iteration=s'       => \$iter,
    34            'det_type|t=s'      => \$det_type,
    35            'camera=s'          => \$camera,
    36            'outroot|w=s'       => \$outroot,   # output file base name
    37            'filter=s'          => \$filter,
    38            'dbname|d=s'        => \$dbname, # Database name
    39            'verbose'           => \$verbose,   # Print to stdout
    40            'no-update'         => \$no_update,
    41            'no-op'             => \$no_op,
     32    'det_id|d=s'        => \$det_id,
     33    'iteration=s'       => \$iter,
     34    'det_type|t=s'      => \$det_type,
     35    'camera=s'          => \$camera,
     36    'outroot|w=s'       => \$outroot,   # output file base name
     37    'filter=s'          => \$filter,
     38    'dbname|d=s'        => \$dbname, # Database name
     39    'verbose'           => \$verbose,   # Print to stdout
     40    'no-update'         => \$no_update,
     41    'no-op'             => \$no_op,
     42    'redirect-output'   => \$redirect,
    4243) or pod2usage( 2 );
    4344
     
    5051    defined $camera   and
    5152    defined $outroot;
     53
     54# check for existing directory, generate if needed
     55$ipprc->outroot_prepare($outroot);
     56
     57my $logName = "$outroot.log"; # Name for log
     58
     59$ipprc->redirect_output($logName) if $redirect;
    5260
    5361# values to extract from output metadata and the stats to calculate
     
    145153# neb:///*/gpc1/20080130 (volume not specified)
    146154
    147 # check for existing directory, generate if needed
    148 $ipprc->outroot_prepare($outroot);
    149 
    150 my $logName = "$outroot.log"; # Name for log
    151 
    152 my $logFile;
    153155unless ($no_op) {
    154     $logFile = $ipprc->file_create_append( $logName );
    155     print $logFile "Ensemble mean $ensMeanMean +/- $ensMeanStdev\n";
    156     print $logFile "Ensemble stdev $ensStdevMean +/- $ensStdevStdev\n";
    157     print $logFile "Ensemble mean rms (over imfiles) $ensMeanStdevMean +/- $ensMeanStdevStdev\n\n";
     156    print "Ensemble mean $ensMeanMean +/- $ensMeanStdev\n";
     157    print "Ensemble stdev $ensStdevMean +/- $ensStdevStdev\n";
     158    print "Ensemble mean rms (over imfiles) $ensMeanStdevMean +/- $ensMeanStdevStdev\n\n";
    158159}
    159160
     
    186187        # Rejected this at an earlier stage
    187188        unless ($no_op) {
    188             print $logFile "Rejecting $expID based on earlier determination.\n";
     189            print "Rejecting $expID based on earlier determination.\n";
    189190        }
    190191        $reject = 1;
     
    205206        my $delta = abs($mean - $ensMeanMean);
    206207        if ($delta > ($reject_mean * $ensMeanStdev)) {
    207             print $logFile "Rejecting $expID based on ensemble mean value: ";
     208            print "Rejecting $expID based on ensemble mean value: ";
    208209            $reject = 1;
    209210            #goto UPDATE;
    210211        } else {
    211             print $logFile "$expID OK against ensemble mean: ";
    212         }
    213         print $logFile "$mean --> $delta vs " . $reject_mean * $ensMeanStdev . "\n";
     212            print "$expID OK against ensemble mean: ";
     213        }
     214        print "$mean --> $delta vs " . $reject_mean * $ensMeanStdev . "\n";
    214215    } else {
    215         print $logFile "No rejection of $expID for ensemble mean\n";
     216        print "No rejection of $expID for ensemble mean\n";
    216217    }
    217218
     
    219220        my $delta = abs($stdev - $ensStdevMean);
    220221        if ($delta > ($reject_stdev * $ensStdevStdev)) {
    221             print $logFile "Rejecting $expID based on ensemble stdev: ";
     222            print "Rejecting $expID based on ensemble stdev: ";
    222223            $reject = 1;
    223224            #goto UPDATE;
    224225        } else {
    225             print $logFile "$expID OK against ensemble stdev: ";
    226         }
    227         print $logFile "$stdev --> $delta sigma vs " . $reject_stdev * $ensStdevStdev . "\n";
     226            print "$expID OK against ensemble stdev: ";
     227        }
     228        print "$stdev --> $delta sigma vs " . $reject_stdev * $ensStdevStdev . "\n";
    228229    } else {
    229         print $logFile "No rejection of $expID for ensemble stdev\n";
     230        print "No rejection of $expID for ensemble stdev\n";
    230231    }
    231232
     
    233234        my $delta = abs($meanStdev - $ensMeanStdevMean);
    234235        if ($delta > ($reject_meanstdev * $ensMeanStdevStdev)) {
    235             print $logFile "Rejecting $expID based on ensemble mean stdev: ";
     236            print "Rejecting $expID based on ensemble mean stdev: ";
    236237            $reject = 1;
    237238            #goto UPDATE;
    238239        } else {
    239             print $logFile "$expID OK against ensemble mean stdev: ";
    240         }
    241         print $logFile "$meanStdev --> $delta sigma vs " . $reject_meanstdev * $ensMeanStdevStdev. "\n";
     240            print "$expID OK against ensemble mean stdev: ";
     241        }
     242        print "$meanStdev --> $delta sigma vs " . $reject_meanstdev * $ensMeanStdevStdev. "\n";
    242243    } else {
    243         print $logFile "No rejection of $expID for ensemble mean stdev\n";
     244        print "No rejection of $expID for ensemble mean stdev\n";
    244245    }
    245246
     
    253254    if ((not $include and not $reject) or ($include and $reject)) {
    254255        unless ($no_op) {
    255             print $logFile "Status of $expID has changed.\n";
     256            print "Status of $expID has changed.\n";
    256257        }
    257258        $numChanges++;
     
    286287
    287288unless ($no_op) {
    288     print $logFile "Master: $master\n";
    289     print $logFile "Stop: $stop\n";
    290     close $logFile;
     289    print "Master: $master\n";
     290    print "Stop: $stop\n";
    291291}
    292292
     
    309309$command .= " -accept" if $master;
    310310$command .= " -dbname $dbname" if defined $dbname;
    311 ### XXX WE NEED to make this a recipe-driven option
    312311$command .= " -again" unless $stop;
    313312$command .= $stats->cmdflags();
     
    346345        $command .= " -det_id $det_id";
    347346        $command .= " -iteration $iter";
     347        # XXX EAM : we should add this to the db : $command .= " -path_base $outroot";
    348348        $command .= " -code $exit_code";
    349349        $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/detrend_stack.pl

    r18065 r18562  
    209209# Command to update the database
    210210$command  = "$dettool -addstacked";
    211 $command .= " -det_id $det_id -iteration $iter";
     211$command .= " -det_id $det_id";
     212$command .= " -iteration $iter";
    212213$command .= " -class_id $class_id";
    213214$command .= " -uri $outputStack";
     
    243244        $command .= " -iteration $iter";
    244245        $command .= " -class_id $class_id";
     246        # XXX EAM : we should add this to the db : $command .= " -path_base $outroot";
    245247        $command .= " -code $exit_code";
    246248        $command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/fake_imfile.pl

    r18020 r18562  
    4242# Parse the command-line arguments
    4343my ( $exp_id, $fake_id, $class_id, $chiproot, $camroot, $camera, $outroot,
    44      $dbname, $reduction, $verbose, $no_update, $no_op );
     44     $dbname, $reduction, $verbose, $no_update, $no_op, $redirect );
    4545GetOptions(
    46            'exp_id=s'      => \$exp_id,    # Exposure identifier
    47            'fake_id=s'     => \$fake_id,   # Chiptool identifier
    48            'class_id=s'    => \$class_id,  # Class identifier
    49            'chiproot=s'    => \$chiproot,  # Input Chip files (root)
    50            'camroot=s'     => \$camroot,   # Input Camera files (root)
    51            'camera|c=s'    => \$camera,    # Camera
    52            'outroot|w=s'   => \$outroot,   # output file base name
    53            'dbname|d=s'    => \$dbname,    # Database name
    54            'reduction=s'   => \$reduction, # Reduction class
    55            'verbose'       => \$verbose,   # Print to stdout
    56            'no-update'     => \$no_update, # Don't update the database?
    57            'no-op'         => \$no_op,     # Don't do any operations?
    58            ) or pod2usage( 2 );
     46    'exp_id=s'          => \$exp_id,    # Exposure identifier
     47    'fake_id=s'         => \$fake_id,   # Chiptool identifier
     48    'class_id=s'        => \$class_id,  # Class identifier
     49    'chiproot=s'        => \$chiproot,  # Input Chip files (root)
     50    'camroot=s'         => \$camroot,   # Input Camera files (root)
     51    'camera|c=s'        => \$camera,       # Camera
     52    'outroot|w=s'       => \$outroot,   # output file base name
     53    'dbname|d=s'        => \$dbname,    # Database name
     54    'reduction=s'       => \$reduction, # Reduction class
     55    'verbose'           => \$verbose,   # Print to stdout
     56    'no-update'         => \$no_update, # Don't update the database?
     57    'no-op'             => \$no_op,        # Don't do any operations?
     58    'redirect-output'   => \$redirect,
     59    ) or pod2usage( 2 );
    5960
    6061pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
     
    7172$ipprc->define_camera($camera);
    7273
     74my $logDest = $ipprc->filename("LOG.IMFILE", $outroot, $class_id)  or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);
     75
     76$ipprc->redirect_output($logDest) if $redirect;
     77
    7378# Recipes to use based on reduction class
    7479$reduction = 'DEFAULT' unless defined $reduction;
     
    116121my $cameraObjects = $ipprc->filename("PSASTRO.OUTPUT",      $camroot)             or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    117122my $traceDest     = $ipprc->filename("TRACE.IMFILE",        $outroot, $class_id)  or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    118 my $logDest       = $ipprc->filename("LOG.IMFILE",          $outroot, $class_id)  or &my_die("Missing entry from camera config", $exp_id, $fake_id, $class_id, $PS_EXIT_CONFIG_ERROR);
    119123
    120124# XXX check for existence of input data
  • trunk/ippScripts/scripts/warp_overlap.pl

    r18055 r18562  
    2727my $ipprc = PS::IPP::Config->new(); # IPP configuration
    2828
    29 my ($warp_id, $camera, $tess_dir, $dbname, $verbose, $no_update, $no_op, $save_temps);
     29my ($warp_id, $camera, $tess_dir, $dbname, $verbose, $no_update, $no_op, $logfile, $save_temps);
    3030GetOptions(
    3131    'warp_id|i=s'       => \$warp_id, # Warp identifier
     
    3636    'no-update'         => \$no_update, # Don't update the database?
    3737    'no-op'             => \$no_op, # Don't do any operations
     38    'logfile=s'         => \$logfile,
    3839    'save-temps'        => \$save_temps, # Save temporary files?
    3940) or pod2usage( 2 );
     41
     42$ipprc->redirect_output($logfile) if $logfile;
    4043
    4144pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
  • trunk/ippScripts/scripts/warp_skycell.pl

    r18056 r18562  
    2525my $ipprc = PS::IPP::Config->new(); # IPP configuration
    2626
    27 my ($warp_id, $skycell_id, $tess_dir, $camera, $dbname, $outroot, $verbose, $no_update, $no_op, $save_temps);
     27my ($warp_id, $skycell_id, $tess_dir, $camera, $dbname, $outroot, $verbose, $no_update, $no_op, $redirect, $save_temps);
    2828GetOptions(
    2929    'warp_id|i=s'       => \$warp_id, # Warp identifier
     
    3636    'no-update'         => \$no_update, # Don't update the database?
    3737    'no-op'             => \$no_op, # Don't do any operations?
     38    'redirect-output'   => \$redirect,
    3839    'save-temps'        => \$save_temps, # Save temporary files?
    3940) or pod2usage( 2 );
     
    5051
    5152$ipprc->define_camera($camera);
     53
     54my $logDest = $ipprc->filename("TRACE.EXP", $outroot, $skycell_id);
     55
     56$ipprc->redirect_output($logDest) if $redirect;
    5257
    5358my $STATS =
     
    119124my $outputStats = $ipprc->filename("SKYCELL.STATS", $outroot, $skycell_id );
    120125my $traceDest = $ipprc->filename("TRACE.EXP", $outroot, $skycell_id);
    121 my $logDest = $ipprc->filename("TRACE.EXP", $outroot, $skycell_id);
    122126
    123127my $skyFile = $ipprc->filename("SKYCELL.TEMPLATE", $outroot, $skycell_id );
Note: See TracChangeset for help on using the changeset viewer.