IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11298


Ignore:
Timestamp:
Jan 25, 2007, 3:15:46 PM (19 years ago)
Author:
Paul Price
Message:

Adding -workdir to all scripts.

Location:
trunk/ippScripts/scripts
Files:
10 edited

Legend:

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

    r11297 r11298  
    2424    $detType,                   # Detrend type
    2525    $dbname,                    # Database name
     26    $workdir,                   # Working directory, for output files
    2627    $no_update                  # Don't update the database
    2728    );
     
    3536    'det_type|t=s'      => \$detType,
    3637    'dbname|d=s'        => \$dbname,
     38    'workdir|w=s'       => \$workdir, # Working directory, for output files
    3739    'no-update'         => \$no_update
    3840    ) or pod2usage( 2 );
     
    6062die "Can't find required tools.\n" if $missing_tools;
    6163
    62 my ($vol, $dir, $file) = File::Spec->splitpath( $input );
     64unless (defined $workdir) {
     65    my ($vol, $dir, $file) = File::Spec->splitpath( $input );
     66    $workdir = $dir;
     67}
    6368$input = $ipprc->convert_filename_absolute( $input );
    6469
    6570# Output name
    6671my $outputRoot = $camera . '.' . $detType . '.norm.' . $detId . '.' . $iter; # Root output name
    67 $outputRoot = File::Spec->catpath( $vol, $dir, $outputRoot );
     72$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    6873$outputRoot = $ipprc->convert_filename_absolute($outputRoot);
    6974
  • trunk/ippScripts/scripts/detrend_norm_calc.pl

    r11297 r11298  
    4040# Define which detrend types we normalise
    4141use constant NORMALIZE => {
    42     'bias' => 0,
    43     'dark' => 0,
    44     'shutter' => 0,
    45     'flat' => 1,
     42    'bias'     => 0,
     43    'dark'     => 0,
     44    'shutter'  => 0,
     45    'flat'     => 1,
    4646    'domeflat' => 1,
    47     'skyflat' => 1,
    48     'fringe' => 0,
     47    'skyflat'  => 1,
     48    'fringe'   => 0,
    4949    };
    5050
  • trunk/ippScripts/scripts/detrend_norm_exp.pl

    r11297 r11298  
    1919use Pod::Usage qw( pod2usage );
    2020
    21 my ($det_id, $iter, $det_type, $camera, $dbname, $no_update);
     21my ($det_id, $iter, $det_type, $camera, $dbname, $workdir, $no_update);
    2222GetOptions(
    2323    'det_id|d=s'        => \$det_id,
     
    2626    'det_type|t=s'      => \$det_type,
    2727    'dbname|d=s'        => \$dbname, # Database name
     28    'workdir|w=s'       => \$workdir,   # Working directory, for output files
    2829    'no-update'         => \$no_update
    2930) or pod2usage( 2 );
     
    9293}
    9394
    94 my $example = ${$files}[0]->{b1_uri}; # Example file, for path
    95 my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     95unless (defined $workdir) {
     96    my $example = ${$files}[0]->{b1_uri}; # Example file, for path
     97    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     98    $workdir = $dir;
     99}
    96100
    97101# Generate the file list, and get the statistics
    98102my $outputRoot = $camera . '.' . $det_type . '.norm.' . $det_id . '.' . $iter; # Root output name
    99 $outputRoot = File::Spec->catpath( $vol, $dir, $outputRoot );
     103$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    100104$outputRoot = $ipprc->convert_filename_absolute( $outputRoot );
    101105my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
     
    114118close $list2File;
    115119
    116 # Output products --- need to synch with the camera configuration!
     120# Output products
    117121my $jpeg1Name = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1
    118122my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
  • trunk/ippScripts/scripts/detrend_process_exp.pl

    r11297 r11298  
    1919use Pod::Usage qw( pod2usage );
    2020
    21 my ($det_id, $exp_tag, $camera, $dbname, $no_update);
     21my ($det_id, $exp_tag, $camera, $dbname, $workdir, $no_update);
    2222GetOptions(
    2323    'det_id|d=s'        => \$det_id,
     
    2525    'camera|c=s'        => \$camera,
    2626    'dbname|d=s'        => \$dbname, # Database name
     27    'workdir|w=s'       => \$workdir,   # Working directory, for output files
    2728    'no-update'         => \$no_update
    2829) or pod2usage( 2 );
     
    9091}
    9192
    92 my $example = ${$files}[0]->{b1_uri}; # Example filename
    93 my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     93unless (defined $workdir) {
     94    my $example = ${$files}[0]->{b1_uri}; # Example filename
     95    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     96    $workdir = $dir;
     97}
    9498
    9599# Generate the file list, and get the statistics
    96100my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root output name
    97 $outputRoot = File::Spec->catpath( $vol, $dir, $outputRoot );
     101$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    98102$outputRoot = $ipprc->convert_filename_absolute($outputRoot);
    99103my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
  • trunk/ippScripts/scripts/detrend_process_imfile.pl

    r11297 r11298  
    1818use Pod::Usage qw( pod2usage );
    1919
    20 my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $bdname, $no_update);
     20my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $bdname, $workdir, $no_update);
    2121GetOptions(
    2222    'det_id|d=s'        => \$det_id,
     
    2727    'camera|c=s'        => \$camera,
    2828    'dbname|d=s'        => \$dbname, # Database name
     29    'workdir|w=s'       => \$workdir, # Working directory, for output files
    2930    'no-update'         => \$no_update
    3031) or pod2usage( 2 );
     
    6667
    6768### Output file name
    68 my ($vol, $dir, $file) = File::Spec->splitpath( $input_uri );
     69unless (defined $workdir) {
     70    my ($vol, $dir, $file) = File::Spec->splitpath( $input_uri );
     71    $workdir = $dir;
     72}
    6973my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root name
    70 $outputRoot = File::Spec->catpath( $vol, $dir, $outputRoot );
     74$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    7175$outputRoot = $ipprc->convert_filename_absolute( $outputRoot );
    7276$input_uri = $ipprc->convert_filename_absolute( $input_uri );
  • trunk/ippScripts/scripts/detrend_reject_imfile.pl

    r11297 r11298  
    1919use Pod::Usage qw( pod2usage );
    2020
    21 my ($det_id, $iter, $exp_tag, $det_type, $camera, $filter, $reject, $dbname, $no_update);
     21my ($det_id, $iter, $exp_tag, $det_type, $camera, $filter, $reject, $dbname, $workdir, $no_update);
    2222GetOptions(
    2323           'det_id|d=s'        => \$det_id,
     
    2929           'reject'            => \$reject
    3030           'dbname|d=s'        => \$dbname, # Database name
     31           'workdir|w=s'       => \$workdir, # Working directory, for output files
    3132           'no-update'         => \$no_update,
    3233           ) or pod2usage( 2 );
     
    6869}
    6970
    70 my $example = ${$files}[0]->{b1_uri}; # Example file
    71 my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     71unless (defined $workdir) {
     72    my $example = ${$files}[0]->{b1_uri}; # Example file
     73    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     74    $workdir = $dir;
     75}
    7276
    7377# Generate the file list, and get the statistics
    7478my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root output name
    75 $outputRoot = File::Spec->catpath( $vol, $dir, $outputRoot );
     79$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    7680$outputRoot = $ipprc->convert_filename_absolute($outputRoot);
    7781my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
  • trunk/ippScripts/scripts/detrend_resid.pl

    r11297 r11298  
    2020
    2121my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend,
    22         $input_uri, $camera, $mode, $dbname, $no_update);
     22        $input_uri, $camera, $mode, $dbname, $workdir, $no_update);
    2323GetOptions(
    2424    'det_id|d=s'        => \$det_id,
     
    3232    'mode|m=s'          => \$mode,
    3333    'dbname|d=s'        => \$dbname, # Database name
     34    'workdir|w=s'       => \$workdir,   # Working directory, for output files
    3435    'no-update'         => \$no_update,
    3536) or pod2usage( 2 );
     
    99100
    100101### Output file names --- must match camera configuration!
    101 my ($vol, $dir, $file) = File::Spec->splitpath( $input_uri );
     102unless (defined $workdir) {
     103    my ($vol, $dir, $file) = File::Spec->splitpath( $input_uri );
     104    $workdir = $dir;
     105}
    102106my $outputRoot = $exp_tag . '.detresid.' . $det_id . '.' . $iter; # Root name
    103 $outputRoot = File::Spec->catpath( $vol, $dir, $outputRoot );
     107$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    104108$outputRoot = $ipprc->convert_filename_absolute( $outputRoot );
    105109$input_uri = $ipprc->convert_filename_absolute( $input_uri );
  • trunk/ippScripts/scripts/detrend_stack.pl

    r11297 r11298  
    1919use Pod::Usage qw( pod2usage );
    2020
    21 my ($det_id, $iter, $class_id, $det_type, $camera, $dbname, $no_update);
     21my ($det_id, $iter, $class_id, $det_type, $camera, $dbname, $workdir, $no_update);
    2222GetOptions(
    2323    'det_id|d=s'        => \$det_id,
     
    2727    'camera|c=s'        => \$camera,
    2828    'dbname|d=s'        => \$dbname, # Database name
     29    'workdir|w=s'       => \$workdir,   # Working directory, for output files
    2930    'no-update'         => \$no_update
    3031) or pod2usage( 2 );
     
    7576}
    7677
    77 my $example = ${$files}[0]->{uri}; # Example file
    78 my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     78unless (defined $workdir) {
     79    my $example = ${$files}[0]->{uri}; # Example file
     80    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     81    $workdir = $dir;
     82}
    7983
    8084# Stack the files
    8185my $outputRoot = $camera . '.' . $det_type . '.' . $det_id . '.' . $iter . '.' . $class_id; # Root name
    82 $outputRoot = File::Spec->catpath( $vol, $dir, $outputRoot );
     86$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    8387$outputRoot = $ipprc->convert_filename_absolute($outputRoot);
    8488my $outputStack = $outputRoot . '.fits'; # Output name
  • trunk/ippScripts/scripts/phase2.pl

    r11297 r11298  
    2222    $input,                     # Input FITS file
    2323    $camera,                    # Camera
    24     $outpath,                   # Outpath
    2524    $dbname,                    # Database name
     25    $workdir,                   # Working directory, for output files
    2626    $no_update                  # Don't update the database?
    2727    );
     
    3131    'uri|u=s'       => \$input,
    3232    'camera|c=s'    => \$camera,
    33     'outpath|o=s'   => \$outpath,
    3433    'dbname|d=s'    => \$dbname, # Database name
     34    'workdir|w=s'   => \$workdir,
    3535    'no-update'     => \$no_update
    3636) or pod2usage( 2 );
     
    4343    and defined $classId
    4444    and defined $input
    45     and defined $outpath
    4645    and defined $camera;
    4746
     
    5453die "Can't find required tools.\n" if $missing_tools;
    5554
    56 # XXX old verion Output file name
    57 # XXX old version (drop) : my ($vol, $dir, $file) = File::Spec->splitpath( $input );
     55unless (defined $workdir) {
     56    my ($vol, $dir, $file) = File::Spec->splitpath( $input );
     57    $workdir = $dir;
     58}
    5859
    5960### Output file name --- must match camera configuration!
    6061my $outputRoot =  $expTag . '.p2';
    61 $outputRoot = File::Spec->catpath( $outpath, $outputRoot );
     62$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    6263$outputRoot = $ipprc->convert_filename_absolute($outputRoot);
    6364$input = $ipprc->convert_filename_absolute ( $input );
  • trunk/ippScripts/scripts/phase3.pl

    r11297 r11298  
    1919use Pod::Usage qw( pod2usage );
    2020
    21 my ($exp_tag, $camera, $outpath, $dbname, $no_update);
     21my ($exp_tag, $camera, $outpath, $dbname, $workdir, $no_update);
    2222GetOptions(
    2323    'exp_tag|e=s'       => \$exp_tag,
    2424    'camera|c=s'        => \$camera,
    25     'outpath|o=s'       => \$outpath,
    2625    'dbname|d=s'        => \$dbname, # Database name
     26    'workdir|w=s'       => \$workdir,
    2727    'no-update'         => \$no_update
    2828) or pod2usage( 2 );
     
    9898}
    9999
    100 # XXX old verison, drop
    101 #my $example = ${$files}[0]->{b1_uri}; # Example filename
    102 #my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     100unless (defined $workdir) {
     101    my $example = ${$files}[0]->{b1_uri}; # Example filename
     102    my ($vol, $dir, $file) = File::Spec->splitpath( $example );
     103    $workdir = $dir;
     104}
    103105
    104106# Generate the file list, and get the statistics
    105107my $outputRoot = $exp_tag . '.p3'; # Root output name
    106 $outputRoot = File::Spec->catpath( $outpath, $outputRoot );
     108$outputRoot = File::Spec->catfile( $workdir, $outputRoot );
    107109$outputRoot = $ipprc->convert_filename_absolute($outputRoot);
    108110my $list1Name = $outputRoot . '.b1.list'; # Name for the input file list for binning 1
Note: See TracChangeset for help on using the changeset viewer.