IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 22, 2008, 5:36:36 PM (18 years ago)
Author:
eugene
Message:

updates from eam_branch_20080121: workdir changed to outroot

File:
1 edited

Legend:

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

    r15616 r16196  
    3232use Pod::Usage qw( pod2usage );
    3333
    34 my ($det_id, $iter, $exp_id, $exp_tag, $class_id, $det_type, $detrend, $input_uri, $camera, $mode, $dbname, $workdir, $reduction, $no_update, $no_op);
     34my ($det_id, $iter, $exp_id, $exp_tag, $class_id, $det_type, $detrend, $input_uri, $camera, $mode, $outroot, $dbname, $reduction, $no_update, $no_op);
    3535GetOptions(
    3636    'det_id|d=s'        => \$det_id,
     
    4444    'camera|c=s'        => \$camera,
    4545    'mode|m=s'          => \$mode,
     46    'outroot|w=s'       => \$outroot,   # output file base name
    4647    'dbname|d=s'        => \$dbname, # Database name
    47     'workdir|w=s'       => \$workdir,   # Working directory, for output files
    4848    'reduction=s'       => \$reduction, # Reduction class
    4949    'no-update'         => \$no_update,
     
    5252
    5353pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    54 pod2usage( -msg => "Required options: --det_id --iteration --exp_id --exp_tag --class_id --det_type --camera --input_uri --mode --detrend (not for 'verify' mode)",
    55            -exitval => 3)
    56     unless defined $det_id
    57     and defined $iter
    58     and defined $exp_id
    59     and defined $exp_tag
    60     and defined $class_id
    61     and defined $det_type
    62     and defined $input_uri
    63     and defined $camera
    64     and defined $mode
    65     and (defined $detrend or lc($mode) eq 'verify');
     54pod2usage( -msg => "Required options: --det_id --iteration --exp_id --exp_tag --class_id --det_type --camera --input_uri --mode --detrend --outroot (not for 'verify' mode)",
     55           -exitval => 3) unless
     56    defined $det_id    and
     57    defined $iter      and
     58    defined $exp_id    and
     59    defined $exp_tag   and
     60    defined $class_id  and
     61    defined $det_type  and
     62    defined $input_uri and
     63    defined $camera    and
     64    defined $mode      and
     65    defined $outroot   and
     66    (defined $detrend or lc($mode) eq 'verify');
    6667
    6768$ipprc->define_camera($camera);
     
    130131$ppImage .= " -dbname $dbname" if defined $dbname;
    131132
    132 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir;
    133 
    134 my $outputRoot = $ipprc->file_prepare( "$exp_tag/$exp_tag.detresid.$det_id.$iter", $workdir, $input_uri );
    135 
    136 my $outputName  = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
    137 my $bin1Name    = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id);
    138 my $bin2Name    = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id);
    139 my $outputStats = $ipprc->filename("PPIMAGE.STATS", $outputRoot, $class_id);
    140 
    141 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.trace"; # Trace messages
    142 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.log"; # Log messages
     133# outroot examples (HOST components must be set)
     134# file://data/ipp004.0/gpc1/20080130
     135# neb:///ipp004-v1/gpc1/20080130
     136# neb:///*/gpc1/20080130 (volume not specified)
     137
     138# check for existing directory, generate if needed
     139$ipprc->outroot_prepare($outroot);
     140
     141my $outputName  = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id);
     142my $bin1Name    = $ipprc->filename("PPIMAGE.BIN1",   $outroot, $class_id);
     143my $bin2Name    = $ipprc->filename("PPIMAGE.BIN2",   $outroot, $class_id);
     144my $outputStats = $ipprc->filename("PPIMAGE.STATS",  $outroot, $class_id);
     145my $traceDest   = $ipprc->filename("TRACE.IMFILE",   $outroot, $class_id);
     146my $logDest     = $ipprc->filename("LOG.IMFILE",     $outroot, $class_id);
    143147
    144148# Run ppImage & ppStats
    145149unless ($no_op) {
    146     my $command = "$ppImage -file $input_uri $outputRoot";
     150    my $command = "$ppImage -file $input_uri $outroot";
    147151    $command .= " -recipe PPIMAGE $recipe";
    148152    $command .= " -recipe PPSTATS RESIDUAL";
     
    205209$command .= " -recip $recipe";
    206210$command .= " -uri $outputName";
    207 $command .= " -path_base $outputRoot";
     211$command .= " -path_base $outroot";
    208212$command .= " -dbname $dbname" if defined $dbname;
    209213$command .= $stats->cmdflags();
Note: See TracChangeset for help on using the changeset viewer.