IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18473


Ignore:
Timestamp:
Jul 11, 2008, 8:37:41 AM (18 years ago)
Author:
eugene
Message:

setup redirect output

Location:
branches/eam_branch_20080706/ippScripts/scripts
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080706/ippScripts/scripts/camera_exp.pl

    r18360 r18473  
    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
  • branches/eam_branch_20080706/ippScripts/scripts/chip_imfile.pl

    r18360 r18473  
    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
  • branches/eam_branch_20080706/ippScripts/scripts/detrend_norm_calc.pl

    r18362 r18473  
    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
  • branches/eam_branch_20080706/ippScripts/scripts/detrend_norm_exp.pl

    r17943 r18473  
    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);
  • branches/eam_branch_20080706/ippScripts/scripts/detrend_process_imfile.pl

    r18049 r18473  
    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;
  • branches/eam_branch_20080706/ippScripts/scripts/detrend_reject_exp.pl

    r18467 r18473  
    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 
    152155my $logFile;
    153156unless ($no_op) {
     
    302305    exit($PS_EXIT_PROG_ERROR);
    303306}
     307
     308# Allow iteration to be turned off
     309my $allow_iter = metadataLookupBool($ipprc->{rejection}, "ITERATION"); # Allow iteration?
     310my $force_master = metadataLookupBool($ipprc->{rejection}, "MASTER"); # Force the stack to be accepted
     311$stop = 1 unless $allow_iter;
     312$master = 1 if $force_master;
    304313
    305314## add the summary statistics, and request a new iteration if needed
  • branches/eam_branch_20080706/ippScripts/scripts/detrend_stack.pl

    r18065 r18473  
    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";
  • branches/eam_branch_20080706/ippScripts/scripts/fake_imfile.pl

    r18020 r18473  
    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
  • branches/eam_branch_20080706/ippScripts/scripts/warp_overlap.pl

    r18055 r18473  
    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;
  • branches/eam_branch_20080706/ippScripts/scripts/warp_skycell.pl

    r18056 r18473  
    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.