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_norm_apply.pl

    r15918 r16196  
    3333
    3434# Parse the command-line
    35 my ($det_id, $iter, $class_id, $value, $input_uri, $camera, $det_type, $dbname, $workdir, $no_update, $no_op);
     35my ($det_id, $iter, $class_id, $value, $input_uri, $camera, $det_type, $outroot, $dbname, $no_update, $no_op);
    3636GetOptions(
    3737    'det_id|d=s'        => \$det_id,     # Detrend ID                           
     
    4242    'camera|c=s'        => \$camera,     # Camera                               
    4343    'det_type|t=s'      => \$det_type,   # Detrend type                         
     44    'outroot|w=s'       => \$outroot,    # output file base name
    4445    'dbname|d=s'        => \$dbname,     # Database name                               
    45     'workdir|w=s'       => \$workdir,    # Working directory, for output files 
    4646    'no-update'         => \$no_update,  # Don't update the database           
    4747    'no-op'             => \$no_op,      # Don't do any operations               
     
    4949   
    5050pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    51 pod2usage( -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type",
    52            -exitval => 3)
    53     unless defined $det_id
    54     and defined $iter
    55     and defined $class_id
    56     and defined $value
    57     and defined $input_uri
    58     and defined $camera
    59     and defined $det_type;
     51pod2usage( -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type --outroot",
     52           -exitval => 3) unless
     53    defined $det_id    and
     54    defined $iter      and
     55    defined $class_id  and
     56    defined $value     and
     57    defined $input_uri and
     58    defined $camera    and
     59    defined $det_type  and
     60    defined $outroot;
    6061
    6162$ipprc->define_camera($camera);
     
    9091&my_die("Couldn't find input file: $input_uri\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri);
    9192
    92 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir;
    93 
    94 my $outputRoot = $ipprc->file_prepare( "$camera.$det_type.norm.$det_id.$iter", $workdir, $input_uri );
    95 
    96 my $output    = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
    97 my $b1name    = $ipprc->filename("PPIMAGE.BIN1",   $outputRoot, $class_id);
    98 my $b2name    = $ipprc->filename("PPIMAGE.BIN2",   $outputRoot, $class_id);
    99 my $statsName = $ipprc->filename("PPIMAGE.STATS",  $outputRoot, $class_id);
    100 
    101 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.trace"; # Trace messages
    102 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.log"; # Log messages
     93# outroot examples (HOST components must be set)
     94# file://data/ipp004.0/gpc1/20080130
     95# neb:///ipp004-v1/gpc1/20080130
     96# neb:///*/gpc1/20080130 (volume not specified)
     97
     98# check for existing directory, generate if needed
     99$ipprc->outroot_prepare($outroot);
     100
     101my $output    = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
     102my $b1name    = $ipprc->filename("PPIMAGE.BIN1",   $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
     103my $b2name    = $ipprc->filename("PPIMAGE.BIN2",   $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
     104my $statsName = $ipprc->filename("PPIMAGE.STATS",  $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
     105my $traceDest = $ipprc->filename("TRACE.IMFILE",   $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
     106my $logDest   = $ipprc->filename("LOG.IMFILE",     $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
    103107
    104108# Run normalisation
    105109unless ($no_op) {
    106     my $command = "$ppImage -file $input_uri $outputRoot";
     110    my $command = "$ppImage -file $input_uri $outroot";
    107111    $command .= " -norm $value -stats $statsName";
    108112    $command .= " -recipe PPIMAGE $RECIPE_PPIMAGE";
     
    118122        &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $class_id, $error_code);
    119123    }
    120     &my_die("Can't find expected output file: $output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($output);
    121     &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b1name);
    122     &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b2name);
     124    &my_die("Can't find expected output file: $output",    $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($output);
     125    &my_die("Can't find expected output file: $b1name",    $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b1name);
     126    &my_die("Can't find expected output file: $b2name",    $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($b2name);
    123127    &my_die("Can't find expected output file: $statsName", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -f $ipprc->file_resolve($statsName);
    124128   
     
    149153$command .= " -class_id $class_id";
    150154$command .= " -uri $output";
    151 $command .= " -path_base $outputRoot";
     155$command .= " -path_base $outroot";
    152156$command .= " -dbname $dbname" if defined $dbname;
    153157$command .= $stats->cmdflags();
Note: See TracChangeset for help on using the changeset viewer.