IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 12, 2009, 11:06:44 AM (17 years ago)
Author:
eugene
Message:

make the use of det_type consistently upper-case in the scripts; change detType to det_type as needed

File:
1 edited

Legend:

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

    r24742 r24764  
    6262    defined $outroot;
    6363
     64# force det_type to be upper-case in this script
     65$det_type = uc($det_type);
     66
    6467my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    6568
     
    7275# Define which detrend types we normalise
    7376use constant DETTYPE => {
    74     'bias'             => 'bias',
    75     'dark'             => 'dark',
    76     'dark_premask'     => 'dark',
    77     'shutter'          => 'shutter',
    78     'flat_premask'     => 'flat',
    79     'domeflat_premask' => 'flat',
    80     'skyflat_premask'  => 'flat',
    81     'flat_raw'         => 'flat',
    82     'domeflat_raw'     => 'flat',
    83     'skyflat_raw'      => 'flat',
    84     'flat'             => 'flat',
    85     'domeflat'         => 'flat',
    86     'skyflat'          => 'flat',
    87     'fringe'           => 'fringe',
    88     'mask'             => 'mask',
    89     'darkmask'         => 'mask',
    90     'flatmask'         => 'mask',
    91     'ctemask'          => 'mask',
    92     'darktest'         => 'dark',
     77    'BIAS'             => 'BIAS',
     78    'DARK'             => 'DARK',
     79    'DARK_PREMASK'     => 'DARK',
     80    'SHUTTER'          => 'SHUTTER',
     81    'FLAT_PREMASK'     => 'FLAT',
     82    'DOMEFLAT_PREMASK' => 'FLAT',
     83    'SKYFLAT_PREMASK'  => 'FLAT',
     84    'FLAT_RAW'         => 'FLAT',
     85    'DOMEFLAT_RAW'     => 'FLAT',
     86    'SKYFLAT_RAW'      => 'FLAT',
     87    'FLAT'             => 'FLAT',
     88    'DOMEFLAT'         => 'FLAT',
     89    'SKYFLAT'          => 'FLAT',
     90    'FRINGE'           => 'FRINGE',
     91    'MASK'             => 'MASK',
     92    'DARKMASK'         => 'MASK',
     93    'FLATMASK'         => 'MASK',
     94    'CTEMASK'          => 'MASK',
     95    'DARKTEST'         => 'DARK',
    9396    };
    9497
    9598# convert supplied detrend type to a controlled namespace
    96 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR) unless exists DETTYPE()->{lc($det_type)};
    97 my $det_type_real = DETTYPE()->{lc($det_type)};
     99&my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $class_id, $PS_EXIT_PROG_ERROR) unless exists DETTYPE()->{$det_type};
     100my $det_type_real = DETTYPE()->{$det_type};
    98101
    99102&my_die("Couldn't find input file: $input_uri\n", $det_id, $iter, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input_uri);
     
    107110$ipprc->outroot_prepare($outroot);
    108111
    109 my $outFile = ($det_type_real eq "mask") ? 'PPIMAGE.OUTPUT.DETMASK' : 'PPIMAGE.OUTPUT';; # XXXX something of a hack (too many places to control things...)
    110 
    111 my $RECIPE_PPSTATS = ($det_type_real eq "dark") ? 'DARKSTATS' : 'DETSTATS';; # XXXX something of a hack (too many places to control things...)
     112my $outFile = ($det_type_real eq "MASK") ? 'PPIMAGE.OUTPUT.DETMASK' : 'PPIMAGE.OUTPUT';; # XXXX something of a hack (too many places to control things...)
     113
     114my $RECIPE_PPSTATS = ($det_type_real eq "DARK") ? 'DARKSTATS' : 'DETSTATS';; # XXXX something of a hack (too many places to control things...)
    112115
    113116my $output    = $ipprc->filename($outFile,        $outroot, $class_id) or &my_die("Missing entry from camera config", $det_id, $iter, $class_id, $PS_EXIT_CONFIG_ERROR);
     
    123126
    124127    # we cannot use ppImage to load a normalized mask : just copy it and build the jpeg images
    125     if ($det_type_real eq 'mask') {
     128    if ($det_type_real eq 'MASK') {
    126129        $RECIPE_PPIMAGE = 'PPIMAGE_BIN';
    127130        my $input_real = $ipprc->file_resolve($input_uri, 0);
     
    135138    $command .= " -recipe PPSTATS $RECIPE_PPSTATS";
    136139    $command .= " -F PPIMAGE.OUTPUT $outFile" unless $outFile eq 'PPIMAGE.OUTPUT';
    137     $command .= ' -isfringe' if $det_type_real eq 'fringe';
    138     $command .= ' -isdark' if $det_type_real eq 'dark';
     140    $command .= ' -isfringe' if $det_type_real eq 'FRINGE';
     141    $command .= ' -isdark' if $det_type_real eq 'DARK';
    139142    $command .= " -tracedest $traceDest -log $logDest";
    140143    $command .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.