IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9892


Ignore:
Timestamp:
Nov 7, 2006, 10:38:05 AM (20 years ago)
Author:
Paul Price
Message:

Output images from ppImage are specified by the FILERULES in the camera configuration.

Location:
trunk/ippScripts/scripts
Files:
8 edited

Legend:

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

    r9446 r9892  
    4747    and defined $detType;
    4848
     49$ipprc->define_camera($camera);
     50
    4951
    5052use constant RECIPE => 'PPIMAGE_N'; # Recipe to use with ppImage
     
    6264my $outputRoot = $camera . '.' . $detType . '.norm.' . $detId . '.' . $iter; # Root output name
    6365$outputRoot = File::Spec->rel2abs( File::Spec->catpath( $vol, $dir, $outputRoot ), $ipprc->workdir() );
    64 my $output = $outputRoot . '.' . $classId . '.fits'; # Main output file
    65 my $b1name = $outputRoot . '.' . $classId . '.b1.fits'; # Output file with binning 1
    66 my $b2name = $outputRoot . '.' . $classId . '.b2.fits'; # Output file with binning 2
     66
     67my $output = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $classId);
     68my $b1name = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $classId);
     69my $b2name = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $classId);
     70
    6771my $statsName = $outputRoot . '.' . $classId . '.stats'; # Statistics file
    6872
  • trunk/ippScripts/scripts/detrend_norm_exp.pl

    r9524 r9892  
    3636     and defined $camera
    3737     and defined $det_type;
     38
     39$ipprc->define_camera($camera);
    3840
    3941use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
     
    110112
    111113# Output products --- need to synch with the camera configuration!
    112 my $jpeg1Name = $outputRoot . ".b1.jpg"; # Binned JPEG #1
    113 my $jpeg2Name = $outputRoot . ".b2.jpg"; # Binned JPEG #2
     114my $jpeg1Name = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1
     115my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    114116
    115117# Make the jpeg for binning 1
  • trunk/ippScripts/scripts/detrend_process_exp.pl

    r9524 r9892  
    1919use Pod::Usage qw( pod2usage );
    2020
    21 my ($det_id, $exp_tag, $no_update);
     21my ($det_id, $exp_tag, $camera, $no_update);
    2222GetOptions(
    2323    'det_id|d=s'        => \$det_id,
    2424    'exp_tag|e=s'       => \$exp_tag,
     25    'camera|c=s'        => \$camera,
    2526    'no-update'         => \$no_update
    2627) or pod2usage( 2 );
     
    2829pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    2930pod2usage(
    30     -msg => "Required options: --det_id --exp_tag",
     31    -msg => "Required options: --det_id --exp_tag --camera",
    3132    -exitval => 3,
    3233) unless defined $det_id
    33     and defined $exp_tag;
     34    and defined $exp_tag,
     35    and defined $camera;
     36
     37$ipprc->define_camera($camera);
    3438
    3539use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
     
    105109close $list2File;
    106110
    107 # Output products --- need to synch with the camera configuration!
    108 my $jpeg1Name = $outputRoot . ".b1.jpg"; # Binned JPEG #1
    109 my $jpeg2Name = $outputRoot . ".b2.jpg"; # Binned JPEG #2
     111# Output products
     112my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1
     113my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    110114
    111115# Make the jpeg for binning 1
     
    114118    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    115119        run(command => $command, verbose => 1);
    116     die "Unable to find expected output file: $jpeg1Name\n" if not -f $jpeg1Name;
     120    die "Unable to find expected output file: $jpeg1\n" if not -f $jpeg1;
    117121}
    118122
     
    122126    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    123127        run(command => $command, verbose => 1);
    124     die "Unable to find expected output file: $jpeg2Name\n" if not -f $jpeg2Name;
     128    die "Unable to find expected output file: $jpeg2\n" if not -f $jpeg2;
    125129}
    126130
     
    128132# Add the result into the database
    129133$outputRoot = File::Spec->abs2rel( $outputRoot, $ipprc->workdir() );
    130 $jpeg1Name  = File::Spec->abs2rel( $jpeg1Name, $ipprc->workdir() );
    131 $jpeg2Name  = File::Spec->abs2rel( $jpeg2Name, $ipprc->workdir() );
     134$jpeg1  = File::Spec->abs2rel( $jpeg1, $ipprc->workdir() );
     135$jpeg2  = File::Spec->abs2rel( $jpeg2, $ipprc->workdir() );
    132136unless ($no_update) {
    133137    my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag " .
    134         "-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " .
     138        "-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1 -b2_uri $jpeg2 " .
    135139        "-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run
    136140    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
  • trunk/ippScripts/scripts/detrend_process_imfile.pl

    r9869 r9892  
    1818use Pod::Usage qw( pod2usage );
    1919
    20 my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $output_uri, $no_update);
     20my ($det_id, $exp_tag, $class_id, $det_type, $input_uri, $camera, $no_update);
    2121GetOptions(
    2222    'det_id|d=s'        => \$det_id,
    23     'exp_tag|e=s'        => \$exp_tag,
     23    'exp_tag|e=s'       => \$exp_tag,
    2424    'class_id|i=s'      => \$class_id,
    2525    'det_type|t=s'      => \$det_type,
    2626    'input_uri|u=s'     => \$input_uri,
     27    'camera|c=s'        => \$camera,
    2728    'no-update'         => \$no_update
    2829) or pod2usage( 2 );
     
    3031pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    3132pod2usage(
    32     -msg => "Required options: --det_id --exp_tag --class_id --det_type --input_uri",
     33    -msg => "Required options: --det_id --exp_tag --class_id --det_type --input_uri --camera",
    3334    -exitval => 3,
    3435) unless defined $det_id
     
    3637    and defined $class_id
    3738    and defined $det_type
    38     and defined $input_uri;
     39    and defined $input_uri
     40    and defined $camera;
     41
     42$ipprc->define_camera($camera);
    3943
    4044# Recipes to use, as a function of the detrend type
     
    5761die "Unrecognised detrend type: $det_type\n" if not defined $recipe;
    5862
    59 ### Output file name --- must match camera configuration!
     63### Output file name
    6064my ($vol, $dir, $file) = File::Spec->splitpath( $input_uri );
    6165my $outputRoot = $exp_tag . '.detproc.' . $det_id; # Root name
    6266$outputRoot = File::Spec->rel2abs( File::Spec->catpath( $vol, $dir, $outputRoot ), $ipprc->workdir() );
    6367$input_uri = File::Spec->rel2abs( $input_uri, $ipprc->workdir() );
    64 my $outputImage = $outputRoot . '.' . $class_id . '.fits';
     68
     69my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
     70my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id);
     71my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id);
     72
    6573my $outputStats = $outputRoot . '.' . $class_id . '.stats';
    66 my $outputBin1 = $outputRoot . '.' . $class_id . '.b1.fits';
    67 my $outputBin2 = $outputRoot . '.' . $class_id . '.b2.fits';
    6874
    6975# Run ppImage
  • trunk/ippScripts/scripts/detrend_reject_imfile.pl

    r9505 r9892  
    4040    and defined $det_type
    4141    and defined $camera;
     42
     43$ipprc->define_camera($camera);
    4244
    4345use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
     
    8789
    8890# Output products --- need to synch with the camera configuration!
    89 my $jpeg1Name = $outputRoot . ".b1.jpg"; # Binned JPEG #1
    90 my $jpeg2Name = $outputRoot . ".b2.jpg"; # Binned JPEG #2
     91my $jpeg1Name = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1
     92my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    9193
    9294# Make the jpeg for binning 1
     
    106108}
    107109
    108 $ipprc->define_camera( $camera);
    109110my $expected = rejection_limit( 'EXPECTED', $det_type, $filter ); # Expected mean
    110111# Rejection thresholds
  • trunk/ippScripts/scripts/detrend_resid.pl

    r9869 r9892  
    2020
    2121my ($det_id, $iter, $exp_tag, $class_id, $det_type, $detrend,
    22         $input_uri, $no_update);
     22        $input_uri, $camera, $no_update);
    2323GetOptions(
    2424    'det_id|d=s'        => \$det_id,
    2525    'iteration=s'       => \$iter,
    26     'exp_tag|e=s'        => \$exp_tag,
     26    'exp_tag|e=s'       => \$exp_tag,
    2727    'class_id|i=s'      => \$class_id,
    2828    'det_type|t=s'      => \$det_type,
    2929    'detrend=s'         => \$detrend,
    3030    'input_uri|u=s'     => \$input_uri,
     31    'camera|c=s'        => \$camera,
    3132    'no-update'         => \$no_update
    3233) or pod2usage( 2 );
     
    3435pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    3536pod2usage(
    36     -msg => "Required options: --det_id --iteration --exp_tag --class_id --det_type --detrend --input_uri",
     37    -msg => "Required options: --det_id --iteration --exp_tag --class_id --det_type --detrend --camera --input_uri",
    3738    -exitval => 3,
    3839) unless defined $det_id
     
    4243    and defined $det_type
    4344    and defined $detrend
    44     and defined $input_uri;
     45    and defined $input_uri
     46    and defined $camera;
     47
     48$ipprc->define_camera($camera);
    4549
    4650# Recipes to use, as a function of the detrend type
     
    8488$input_uri = File::Spec->rel2abs( $input_uri, $ipprc->workdir() );
    8589$detrend = File::Spec->rel2abs( $detrend, $ipprc->workdir() );
    86 my $outputName = $outputRoot . '.' . $class_id . '.fits'; # Name for
     90
     91my $outputName = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $class_id);
     92my $bin1Name =  $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $class_id);
     93my $bin2Name =  $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $class_id);
     94
    8795my $outputStats = $outputRoot . '.' . $class_id . '.stats';
    88 my $bin1Name = $outputRoot . '.' . $class_id . '.b1.fits';
    89 my $bin2Name =  $outputRoot . '.' . $class_id . '.b2.fits';
    9096
    9197# Run ppImage
  • trunk/ippScripts/scripts/phase2.pl

    r9446 r9892  
    2121    $classId,                   # Class Id
    2222    $input,                     # Input FITS file
     23    $camera,                    # Camera
    2324    $no_update                  # Don't update the database?
    2425    );
     
    2728    'class_id|i=s'  => \$classId,
    2829    'uri|u=s'       => \$input,
     30    'camera|c=s'    => \$camera,
    2931    'no-update'     => \$no_update
    3032) or pod2usage( 2 );
     
    3234pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    3335pod2usage(
    34     -msg => "Required options: --exp_tag --class_id --uri",
     36    -msg => "Required options: --exp_tag --class_id --uri --camera",
    3537    -exitval => 3,
    3638) unless defined $expTag
    3739    and defined $classId
    38     and defined $input;
     40    and defined $input
     41    and defined $camera;
     42
     43$ipprc->define_camera($camera);
    3944
    4045# Look for programs we need
     
    4954$outputRoot = File::Spec->rel2abs( File::Spec->catpath( $vol, $dir, $outputRoot ), $ipprc->workdir() );
    5055$input = File::Spec->rel2abs( $input, $ipprc->workdir() );
    51 my $outputImage = $outputRoot  . '.' . $classId . '.fits';
     56my $outputImage = $ipprc->filename("PPIMAGE.OUTPUT", $outputRoot, $classId);
     57my $outputBin1 = $ipprc->filename("PPIMAGE.BIN1", $outputRoot, $classId);
     58my $outputBin2 = $ipprc->filename("PPIMAGE.BIN2", $outputRoot, $classId);
    5259my $outputStats = $outputRoot  . '.' . $classId . '.stats';
    53 my $outputBin1Name = $outputRoot . '.' . $classId . '.b1.fits';
    54 my $outputBin2Name = $outputRoot . '.' . $classId . '.b2.fits';
    5560
    5661# Run ppImage
     
    6267    die "Unable to perform ppImage on $input: $error_code\n" if not $success;
    6368    die "Couldn't find expected output file: $outputImage\n" if not -f $outputImage;
    64     die "Couldn't find expected output file: $outputBin1Name\n" if not -f $outputBin1Name;
    65     die "Couldn't find expected output file: $outputBin2Name\n" if not -f $outputBin2Name;
     69    die "Couldn't find expected output file: $outputBin1\n" if not -f $outputBin1;
     70    die "Couldn't find expected output file: $outputBin2\n" if not -f $outputBin2;
    6671    die "Couldn't find expected output file: $outputStats\n" if not -f $outputStats;
    6772}
     
    8388# Add the processed file to the database
    8489$outputImage = File::Spec->abs2rel( $outputImage, $ipprc->workdir() );
    85 $outputBin1Name = File::Spec->abs2rel( $outputBin1Name, $ipprc->workdir() );
    86 $outputBin2Name = File::Spec->abs2rel( $outputBin2Name, $ipprc->workdir() );
     90$outputBin1 = File::Spec->abs2rel( $outputBin1, $ipprc->workdir() );
     91$outputBin2 = File::Spec->abs2rel( $outputBin2, $ipprc->workdir() );
    8792unless ($no_update) {
    8893    # Command to run dettool
     
    9297    $command .= " -recip " . RECIPE;
    9398    $command .= " -uri $outputImage";
    94     $command .= " -b1_uri $outputBin1Name";
    95     $command .= " -b2_uri $outputBin2Name";
     99    $command .= " -b1_uri $outputBin1";
     100    $command .= " -b2_uri $outputBin2";
    96101    $command .= " -bg " . $stats->bg_mean();
    97102    $command .= " -bg_stdev " . $stats->bg_stdev();
  • trunk/ippScripts/scripts/phase3.pl

    r9524 r9892  
    2222GetOptions(
    2323    'exp_tag|e=s'       => \$exp_tag,
     24    'camera|c=s'        => \$camera,
    2425    'no-update'         => \$no_update
    2526) or pod2usage( 2 );
     
    2728pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    2829pod2usage(
    29     -msg => "Required options: --exp_tag",
     30    -msg => "Required options: --exp_tag --camera",
    3031    -exitval => 3,
    31 ) unless defined $exp_tag;
     32) unless defined $exp_tag
     33    and defined $camera;
     34
     35$ipprc->define_camera($camera);
    3236
    3337use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
     
    110114
    111115# Output products --- need to synch with the camera configuration!
    112 my $jpeg1Name = $outputRoot . ".b1.jpg"; # Binned JPEG #1
    113 my $jpeg2Name = $outputRoot . ".b2.jpg"; # Binned JPEG #2
     116my $jpeg1 = $ipprc->filename("PPIMAGE.JPEG1", $outputRoot); # Binned JPEG #1
     117my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    114118
    115119# Make the jpeg for binning 1
     
    118122    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    119123        run(command => $command, verbose => 1);
    120     die "Unable to find expected output file: $jpeg1Name\n" if not -f $jpeg1Name;
     124    die "Unable to find expected output file: $jpeg1\n" if not -f $jpeg1;
    121125}
    122126
     
    126130    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    127131        run(command => $command, verbose => 1);
    128     die "Unable to find expected output file: $jpeg2Name\n" if not -f $jpeg2Name;
     132    die "Unable to find expected output file: $jpeg2\n" if not -f $jpeg2;
    129133}
    130134
     
    132136# Add the result into the database
    133137$outputRoot = File::Spec->abs2rel( $outputRoot, $ipprc->workdir() );
    134 $jpeg1Name  = File::Spec->abs2rel( $jpeg1Name, $ipprc->workdir() );
    135 $jpeg2Name  = File::Spec->abs2rel( $jpeg2Name, $ipprc->workdir() );
     138$jpeg1  = File::Spec->abs2rel( $jpeg1, $ipprc->workdir() );
     139$jpeg2  = File::Spec->abs2rel( $jpeg2, $ipprc->workdir() );
    136140unless ($no_update) {
    137141    my $command = "$p3tool -addprocessedexp -exp_tag $exp_tag -uri UNKNOWN " .
    138         "-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1Name -b2_uri $jpeg2Name " .
     142        "-recip " . RECIPE1() . "," . RECIPE2() . " -b1_uri $jpeg1 -b2_uri $jpeg2 " .
    139143        "-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev " .
    140144        "-sigma_ra 0.0 -sigma_dec 0.0 -nastro 0 -zp_mean 0.0 -zp_stdev 0.0"; # Command to run
Note: See TracChangeset for help on using the changeset viewer.