IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11360


Ignore:
Timestamp:
Jan 29, 2007, 7:37:37 AM (19 years ago)
Author:
eugene
Message:

update workdir and outroot names

Location:
trunk
Files:
13 edited

Legend:

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

    r11333 r11360  
    2424
    2525# Parse the command-line
    26 my ($detId,                     # Detrend ID
     26my ($det_id,                     # Detrend ID
    2727    $iter,                      # Iteration
    28     $classId,                   # Class ID
     28    $class_id,                  # Class ID
    2929    $value,                     # Value to multiple (for normalisation)
    3030    $input,                     # Input file
    3131    $camera,                    # Camera
    32     $detType,                   # Detrend type
     32    $det_type,                  # Detrend type
    3333    $dbname,                    # Database name
    3434    $workdir,                   # Working directory, for output files
     
    3636    );
    3737GetOptions(
    38     'det_id|d=s'        => \$detId,
     38    'det_id|d=s'        => \$det_id,
    3939    'iteration|n=s'     => \$iter,
    40     'class_id|i=s'      => \$classId,
     40    'class_id|i=s'      => \$class_id,
    4141    'value|v=s'         => \$value,
    4242    'input_uri|u=s'     => \$input,
    4343    'camera|c=s'        => \$camera,
    44     'det_type|t=s'      => \$detType,
     44    'det_type|t=s'      => \$det_type,
    4545    'dbname|d=s'        => \$dbname,
    4646    'workdir|w=s'       => \$workdir, # Working directory, for output files
     
    5151pod2usage( -msg => "Required options: --det_id --iteration --class_id --value --input_uri --camera --det_type",
    5252    -exitval => 3,
    53     ) unless defined $detId
     53    ) unless defined $det_id
    5454    and defined $iter
    55     and defined $classId
     55    and defined $class_id
    5656    and defined $value
    5757    and defined $input
    5858    and defined $camera
    59     and defined $detType;
     59    and defined $det_type;
    6060
    6161$ipprc->define_camera($camera);
     
    8383
    8484# Output name
    85 my $outputRoot = $camera . '.' . $detType . '.norm.' . $detId . '.' . $iter; # Root output name
    86 $outputRoot = File::Spec->catfile( $workdir, $outputRoot );
     85my $outputFile = "$camera.$det_type.norm.$det_id.$iter"; # Root name
     86my $outputSubD = "$camera.$det_type.$det_id";
     87my $outputRoot = File::Spec->catfile( $workdir, $outputSubD, $outputFile );
    8788
    88 my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $classId);
    89 my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $classId);
    90 my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $classId);
     89my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
     90my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id);
     91my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id);
    9192
    92 my $statsName = $outputRoot . '.' . $classId . '.stats'; # Statistics file
     93my $statsName = $outputRoot . '.' . $class_id . '.stats'; # Statistics file
    9394
    9495# Run normalisation
    9596{
    9697    my $command = "$ppImage -file $input $outputRoot -norm $value -stat $statsName -recipe PPIMAGE " . RECIPE(); # Command to run
    97     $command .= ' -isfringe' if lc($detType) eq 'fringe';
     98    $command .= ' -isfringe' if lc($det_type) eq 'fringe';
    9899    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    99100        run(command => $command, verbose => 1);
    100101    unless ($success) {
    101102        $error_code = $error_code >> 8;
    102         &my_die("Unable to perform ppImage: $error_code", $detId, $iter, $classId, $error_code);
     103        &my_die("Unable to perform ppImage: $error_code", $det_id, $iter, $class_id, $error_code);
    103104    }
    104     &my_die("Can't find expected output file: $output", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $output;
    105     &my_die("Can't find expected output file: $b1name", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $b2name;
    106     &my_die("Can't find expected output file: $b2name", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $b1name;
    107     &my_die("Can't find expected output file: $statsName", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR) unless -e $statsName;
     105    &my_die("Can't find expected output file: $output", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $output;
     106    &my_die("Can't find expected output file: $b1name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b2name;
     107    &my_die("Can't find expected output file: $b2name", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $b1name;
     108    &my_die("Can't find expected output file: $statsName", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless -e $statsName;
    108109}
    109110
     
    112113{
    113114    my $statsFile;              # File handle
    114     open $statsFile, $statsName or &my_die("Can't open statistics file $statsName: $!\n", $detId, $iter, $classId, $PS_EXIT_SYS_ERROR);
     115    open $statsFile, $statsName or &my_die("Can't open statistics file $statsName: $!\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR);
    115116    my @contents = <$statsFile>; # Contents of file
    116117    close $statsFile;
    117118    my $mdcParser = PS::IPP::Metadata::Config->new;     # Parser for metadata config files
    118119    my $metadata = $mdcParser->parse(join "", @contents)
    119         or &my_die("Unable to parse metadata config", $detId, $iter, $classId, $PS_EXIT_PROG_ERROR);
     120        or &my_die("Unable to parse metadata config", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR);
    120121    $stats = PS::IPP::Metadata::Stats->new(); # Stats parser
    121     $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $detId, $iter, $classId, $PS_EXIT_PROG_ERROR);
     122    $stats->parse($metadata) or &my_die("Unable to find all values in statistics output.", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR);
    122123}
    123124
     
    127128$b2name = $ipprc->convert_filename_relative( $b2name );
    128129unless ($no_update) {
    129     my $command = "$dettool -addnormalizedimfile -det_id $detId -iteration $iter -class_id $classId ".
     130    my $command = "$dettool -addnormalizedimfile -det_id $det_id -iteration $iter -class_id $class_id ".
    130131        "-uri $output -b1_uri $b1name -b2_uri $b2name"; # Command to run
    131132    # Add the statistics triplet
  • trunk/ippScripts/scripts/detrend_norm_exp.pl

    r11333 r11360  
    117117
    118118# Generate the file list, and get the statistics
    119 my $outputRoot = $camera . '.' . $det_type . '.norm.' . $det_id . '.' . $iter; # Root output name
    120 $outputRoot = File::Spec->catfile( $workdir, $outputRoot );
     119my $outputFile = "$camera.$det_type.norm.$det_id.$iter"; # Root output name
     120my $outputSubD = "$camera.$det_type.$det_id";
     121my $outputRoot = File::Spec->catfile( $workdir, $outputSubD, $outputFile );
     122
    121123my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
    122124my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2
  • trunk/ippScripts/scripts/detrend_process_exp.pl

    r11333 r11360  
    113113    $workdir = $dir;
    114114}
    115 
    116 # Generate the file list, and get the statistics
    117 my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root output name
    118 $outputRoot = File::Spec->catfile( $workdir, $outputRoot );
     115my $outputFile = $exp_tag . '.detproc.' . $det_id; # Root name
     116my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile );
     117
     118# output files:
    119119my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
    120120my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2
  • trunk/ippScripts/scripts/detrend_process_imfile.pl

    r11333 r11360  
    8787    $workdir = $dir;
    8888}
    89 my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root name
    90 $outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    91 print "OUTPUTROOT: $outputRoot\n";
    92 $input_uri = $ipprc->convert_filename_absolute( $input_uri );
    93 
     89my $outputFile = "$exp_tag.detproc.$det_id"; # Root name
     90my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile );
    9491my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
    9592my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id);
     
    9794
    9895my $outputStats = $outputRoot . '.' . $class_id . '.stats';
     96
     97$input_uri = $ipprc->convert_filename_absolute( $input_uri );
    9998
    10099# Run ppImage
  • trunk/ippScripts/scripts/detrend_reject_imfile.pl

    r11333 r11360  
    9595
    9696# Generate the file list, and get the statistics
    97 my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root output name
    98 $outputRoot = File::Spec->catfile( $workdir, $outputRoot );
     97my $outputFile = "$exp_tag.detresid.$det_id.$iter"; # Root name
     98my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile );
     99
    99100my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
    100101my $list2Name = $outputRoot . '.b2.list'; # Name for the input file list for binning 2
     102
    101103my @means;                      # Array of means
    102104my @variances;                  # Array of variances
  • trunk/ippScripts/scripts/detrend_resid.pl

    r11333 r11360  
    117117    $workdir = $dir;
    118118}
    119 my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root name
    120 $outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    121 $input_uri = $ipprc->convert_filename_absolute( $input_uri );
    122 $detrend = $ipprc->convert_filename_absolute( $detrend ) if defined $detrend;
     119
     120my $outputFile = "$exp_tag.detresid.$det_id.$iter"; # Root name
     121my $outputRoot = File::Spec->catfile( $workdir, $exp_tag, $outputFile );
    123122
    124123my $outputName = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
     
    127126
    128127my $outputStats = $outputRoot . '.' . $class_id . '.stats';
     128
     129$detrend = $ipprc->convert_filename_absolute( $detrend ) if defined $detrend;
     130$input_uri = $ipprc->convert_filename_absolute( $input_uri );
    129131
    130132# Run ppImage
  • trunk/ippScripts/scripts/detrend_stack.pl

    r11333 r11360  
    100100
    101101# Stack the files
    102 my $outputRoot = $camera . '.' . $det_type . '.' . $det_id . '.' . $iter . '.' . $class_id; # Root name
    103 $outputRoot = File::Spec->catfile( $workdir, $outputRoot );
     102my $outputFile = "$camera.$det_type.$det_id.$iter.$class_id"; # Root name
     103my $outputSubD = "$camera.$det_type.$det_id";
     104my $outputRoot = File::Spec->catfile( $workdir, $outputSubD, $outputFile );
    104105my $outputStack = $outputRoot . '.fits'; # Output name
    105106my $outputStats = $outputRoot . '.stats'; # Statistics name
     107
    106108{
    107109    my $command = "$ppMerge $outputStack"; # Command to run
  • trunk/ippTasks/detrend.norm.pro

    r11346 r11360  
    2323book init detPendingNormImfile
    2424book init detPendingNormExp
     25
     26macro detnorm.reset
     27  book init detPendingNormStatImfile
     28  book init detPendingNormImfile
     29  book init detPendingNormExp
     30end
    2531
    2632macro detnorm.status
     
    120126    # XXX use ipp_filename.pl to lookup output file names
    121127    $outroot = `ipp_datapath.pl $WORKDIR`
    122     $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log
     128    $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID
     129    $logfile = $outroot/$CAMERA.$DET_TYPE.reject.$DET_ID.$ITERATION.log
    123130    stdout $logfile
    124131    stderr $logfile
     
    234241    # XXX use ipp_filename.pl to lookup output file names
    235242    $outroot = `ipp_datapath.pl $WORKDIR`
     243    $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID
    236244    $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log
    237245    stdout $logfile
     
    345353    # XXX add $WORKDIR/$LOG_DIR
    346354    $outroot = `ipp_datapath.pl $WORKDIR`
     355    $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID
    347356    $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log
    348357    stdout $logfile
  • trunk/ippTasks/detrend.process.pro

    r11346 r11360  
    2323book init detPendingProcessedExp
    2424
     25macro detproc.reset
     26  book init detPendingProcessedImfile
     27  book init detPendingProcessedExp
     28end
     29
    2530macro detproc.status
     31  echo detPendingProcessedImfile
    2632  book listbook detPendingProcessedImfile
     33  echo detPendingProcessedExp
    2734  book listbook detPendingProcessedExp
    2835end
     
    117124    end
    118125
    119     ## generate output log based on filerule
     126    ## output log filename
    120127    $outroot = `ipp_datapath.pl $WORKDIR`
    121128    $outroot = $outroot/$EXP_TAG
    122     $logfile = $outroot/$EXP_TAG.$CLASS_ID.detproc.$DET_ID.log
     129    $logfile = $outroot/$EXP_TAG.detproc.$DET_ID.$CLASS_ID.log
    123130    stdout $logfile
    124131    stderr $logfile
     
    213220    if ($pageName == NULL) break
    214221
     222    # XXX is ITERATION relevant here??
    215223    book setword detPendingProcessedExp $pageName state RUN
    216224    book getword detPendingProcessedExp $pageName det_id    -var DET_ID
  • trunk/ippTasks/detrend.reject.pro

    r11346 r11360  
    2121
    2222book init detRejectExp
     23
     24macro detreject.reset
     25  book init detRejectExp
     26end
    2327
    2428macro detreject.status
     
    101105    book getword detRejectExp $pageName mode      -var MODE     
    102106    book getword detRejectExp $pageName camera    -var CAMERA   
    103     book getword detRejectExp $pageName workdir   -var WORKDIR
     107    # book getword detRejectExp $pageName workdir   -var WORKDIR
     108    # XXX workdir is not being returned here
     109    $WORKDIR = NONE
    104110    book getword detRejectExp $pageName dbname    -var DBNAME
    105111    set_standard_args
     
    114120    # I'd like to add CAMERA to the log file...
    115121    $outroot = `ipp_datapath.pl $WORKDIR`
    116     $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.log
     122    $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID
     123    $logfile = $outroot/$CAMERA.$DET_TYPE.reject.$DET_ID.$ITERATION.log
    117124    stdout $logfile
    118125    stderr $logfile
  • trunk/ippTasks/detrend.resid.pro

    r11346 r11360  
    2222book init detPendingResidImfile
    2323book init detPendingResidExp
     24
     25macro detresid.reset
     26  book init detPendingResidImfile
     27  book init detPendingResidExp
     28end
    2429
    2530macro detresid.status
     
    122127    $outroot = `ipp_datapath.pl $WORKDIR`
    123128    $outroot = $outroot/$EXP_TAG
    124     $logfile = $outroot/$EXP_TAG.$CLASS_ID.detresid.$DET_ID.$ITERATION.log
     129    $logfile = $outroot/$EXP_TAG.detresid.$DET_ID.$ITERATION.$CLASS_ID.log
    125130    stdout $logfile
    126131    stderr $logfile
  • trunk/ippTasks/detrend.stack.pro

    r11346 r11360  
    2222book init detPendingStackedImfile
    2323
     24macro detstack.reset
     25  book init detPendingStackedImfile
     26end
     27
    2428macro detstack.status
     29  echo detPendingStackedImfile
    2530  book listbook detPendingStackedImfile
    2631end
     
    115120    # XXX use ipp_filename.pl to lookup output file names
    116121    $outroot = `ipp_datapath.pl $WORKDIR`
    117     $outroot = $outroot/$EXP_TAG
    118     $logfile = $outroot/$CAMERA.$DET_TYPE.$DET_ID.$ITERATION.$CLASS_ID.log
     122    $outroot = $outroot/$CAMERA.$DET_TYPE.$DET_ID
     123    $logfile = $outroot/$CAMERA.$DET_TYPE.stack.$DET_ID.$ITERATION.$CLASS_ID.log
    119124    stdout $logfile
    120125    stderr $logfile
  • trunk/ippTools/src/dettool.c

    r11233 r11360  
    657657    {
    658658        bool status = false;
    659         psString exp_type = psMetadataLookupStr(&status, config->args, "-select_exp_type");        if (!status) {
    660             psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_type");
     659        psString exp_type = psMetadataLookupStr(&status, config->args, "-select_exp_type");       
     660        if (!status) {
     661            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -select_exp_type");
    661662            return false;
    662663        }
     
    803804    }
    804805
    805     psString exp_type = psMetadataLookupStr(&status, config->args, "-exp_type");
    806     if (!status) {
    807         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_type");
    808         return false;
    809     }
    810 
    811806    psString filter = psMetadataLookupStr(&status, config->args, "-filter");
    812807    if (!status) {
     
    10341029            camera,
    10351030            telescope,
    1036             exp_type,
     1031            "NA",
    10371032            filter,
    10381033            airmass_min,
Note: See TracChangeset for help on using the changeset viewer.