IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 30, 2007, 12:41:30 PM (19 years ago)
Author:
eugene
Message:

make jpeg recipe depend on the data type (bias, flat) and the mode (positive image, residual image)

File:
1 edited

Legend:

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

    r13275 r13552  
    5656$ipprc->define_camera($camera);
    5757
    58 use constant RECIPE1 => 'PPIMAGE_J1'; # Recipe to use for ppImage to make JPEGs
    59 use constant RECIPE2 => 'PPIMAGE_J2'; # Recipe to use for ppImage to make JPEGs
    60 
     58# Recipes to use, as a function of the detrend type
     59use constant RECIPES => {
     60    'bin1' => {         # We're creating a master --- already processed the input
     61        'bias'     => 'PPIMAGE_J1_IMAGE_B',     # Bias only
     62        'dark'     => 'PPIMAGE_J1_IMAGE_B',     # Dark only
     63        'shutter'  => 'PPIMAGE_J1_IMAGE_B',     # Shutter only
     64        'flat'     => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     65        'domeflat' => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     66        'skyflat'  => 'PPIMAGE_J1_IMAGE_F',     # Flat-field only
     67        'fringe'   => 'PPIMAGE_J1_IMAGE_F',     # Fringe only
     68    },
     69    'bin2' => {         # We're checking the master --- input is not already processed
     70        'bias'     => 'PPIMAGE_J2_IMAGE_B',     # Bias only
     71        'dark'     => 'PPIMAGE_J2_IMAGE_B',     # Dark only
     72        'shutter'  => 'PPIMAGE_J2_IMAGE_B',     # Shutter only
     73        'flat'     => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     74        'domeflat' => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     75        'skyflat'  => 'PPIMAGE_J2_IMAGE_F',     # Flat-field only
     76        'fringe'   => 'PPIMAGE_J2_IMAGE_F',     # Fringe only
     77    },
     78};
    6179
    6280# Look for programs we need
     
    135153my $jpeg2 = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    136154
     155# Recipes to use in processing
     156my $recipe1 = RECIPES->{"bin1"}->{lc($det_type)};
     157&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe1;
     158
     159my $recipe2 = RECIPES->{"bin2"}->{lc($det_type)};
     160&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe2;
     161
    137162unless ($no_op) {
    138163    # Make the jpeg for binning 1
    139164    {
    140         my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
     165        my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run
    141166        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    142167            run(command => $command, verbose => 1);
     
    150175    # Make the jpeg for binning 2
    151176    {
    152         my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
     177        my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run
    153178        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    154179            run(command => $command, verbose => 1);
     
    162187
    163188unless ($no_update) {
    164     my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag " .
    165         "-recip " . RECIPE1() . "," . RECIPE2() . " -path_base $outputRoot " .
    166         "-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run
     189    my $command = "$dettool -addprocessedexp -det_id $det_id -exp_tag $exp_tag";
     190    $command .= " -recip $recipe1,$recipe2 -path_base $outputRoot";
     191    $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev";
    167192    $command .= " -dbname $dbname" if defined $dbname;
    168193    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note: See TracChangeset for help on using the changeset viewer.