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_norm_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
     
    134152my $jpeg2Name = $ipprc->filename("PPIMAGE.JPEG2", $outputRoot); # Binned JPEG #2
    135153
     154# Recipes to use in processing
     155my $recipe1 = RECIPES->{"bin1"}->{lc($det_type)};
     156&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe1;
     157
     158my $recipe2 = RECIPES->{"bin2"}->{lc($det_type)};
     159&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $exp_tag, $PS_EXIT_PROG_ERROR) unless defined $recipe2;
     160
    136161unless ($no_op) {
    137162    # Make the jpeg for binning 1
    138163    {
    139         my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE " . RECIPE1; # Command to run
     164        my $command = "$ppImage -list $list1Name $outputRoot -recipe PPIMAGE $recipe1"; # Command to run
    140165        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    141166            run(command => $command, verbose => 1);
     
    145170    # Make the jpeg for binning 2
    146171    {
    147         my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE " . RECIPE2; # Command to run
     172        my $command = "$ppImage -list $list2Name $outputRoot -recipe PPIMAGE $recipe2"; # Command to run
    148173        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    149174            run(command => $command, verbose => 1);
     
    153178
    154179unless ($no_update) {
    155     my $command = "$dettool -addnormalizedexp -det_id $det_id -iteration $iter " .
    156         "-recip " . RECIPE1() . "," . RECIPE2() . " -path_base $outputRoot " .
    157         "-bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev"; # Command to run
     180    my $command = "$dettool -addnormalizedexp -det_id $det_id -iteration $iter";
     181    $command .= " -recip $recipe1,$recipe2 -path_base $outputRoot ";
     182    $command .= " -bg $bg -bg_stdev $bg_stdev -bg_mean_stdev $bg_mean_stdev";
    158183    $command .= " -dbname $dbname" if defined $dbname;
    159184    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
Note: See TracChangeset for help on using the changeset viewer.