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

    r15466 r16196  
    3232use Pod::Usage qw( pod2usage );
    3333
    34 my ($det_id, $exp_id, $class_id, $det_type, $exp_tag, $input_uri, $camera, $dbname, $workdir, $reduction, $no_update, $no_op);
     34my ($det_id, $exp_id, $class_id, $det_type, $exp_tag, $input_uri, $camera, $outroot, $dbname, $reduction, $no_update, $no_op);
    3535GetOptions(
    3636    'det_id|d=s'        => \$det_id,
     
    4141    'input_uri|u=s'     => \$input_uri,
    4242    'camera|c=s'        => \$camera,
     43    'outroot|w=s'       => \$outroot, # output file base name
    4344    'dbname|d=s'        => \$dbname, # Database name
    44     'workdir|w=s'       => \$workdir, # Working directory, for output files
    4545    'reduction=s'       => \$reduction, # Reduction class
    4646    'no-update'         => \$no_update,
     
    4949
    5050pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    51 pod2usage( -msg => "Required options: --det_id --exp_id --class_id --det_type --exp_tag --input_uri --camera",
    52            -exitval => 3)
    53     unless defined $det_id
    54     and defined $exp_id
    55     and defined $class_id
    56     and defined $det_type
    57     and defined $exp_tag
    58     and defined $input_uri
    59     and defined $camera;
     51pod2usage( -msg => "Required options: --det_id --exp_id --class_id --det_type --exp_tag --input_uri --camera --outroot",
     52           -exitval => 3) unless
     53    defined $det_id    and
     54    defined $exp_id    and
     55    defined $class_id  and
     56    defined $det_type  and
     57    defined $exp_tag   and
     58    defined $input_uri and
     59    defined $camera    and
     60    defined $outroot;
    6061
    6162# XXX this exits with status = 0 on failure
     
    8889&my_die("Couldn't find input file: $input_uri\n", $det_id, $exp_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri);
    8990
    90 $workdir = caturi( $workdir, "$camera.$det_type.$det_id" ) if defined $workdir;
     91# outroot examples (HOST components must be set)
     92# file://data/ipp004.0/gpc1/20080130
     93# neb:///ipp004-v1/gpc1/20080130
     94# neb:///*/gpc1/20080130 (volume not specified)
    9195
    92 my $outputRoot  = $ipprc->file_prepare( "$exp_tag/$exp_tag.detproc.$det_id", $workdir, $input_uri );
     96# check for existing directory, generate if needed
     97$ipprc->outroot_prepare($outroot);
    9398
    94 my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    95 my $outputBin1  = $ipprc->filename("PPIMAGE.BIN1",   $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    96 my $outputBin2  = $ipprc->filename("PPIMAGE.BIN2",   $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    97 my $outputStats = $ipprc->filename("PPIMAGE.STATS",  $outputRoot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
    98 
    99 my $traceDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.trace"; # Trace messages
    100 my $logDest = 'file:' . $ipprc->file_resolve($outputRoot) . ".$class_id.log"; # Log messages
     99my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     100my $outputBin1  = $ipprc->filename("PPIMAGE.BIN1",   $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     101my $outputBin2  = $ipprc->filename("PPIMAGE.BIN2",   $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     102my $outputStats = $ipprc->filename("PPIMAGE.STATS",  $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $exp_id, $class_id, $PS_EXIT_PROG_ERROR);
     103my $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);
     104my $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);
    101105
    102106# Run ppImage
    103107unless ($no_op) {
    104     my $command = "$ppImage -file $input_uri $outputRoot";
     108    my $command = "$ppImage -file $input_uri $outroot";
    105109    $command .= " -recipe PPIMAGE $recipe";
    106110    $command .= " -recipe PPSTATS CHIPSTATS";
     
    141145$command .= " -class_id $class_id";
    142146$command .= " -recip $reduction";
    143 $command .= " -uri $outputImage -path_base $outputRoot";
     147$command .= " -uri $outputImage -path_base $outroot";
    144148$command .= " -dbname $dbname" if defined $dbname;
    145149$command .= $stats->cmdflags();
Note: See TracChangeset for help on using the changeset viewer.